Skip to content

Commit

Permalink
Merge pull request graphql#84 from ErikWittern/fix-tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
leebyron authored Aug 26, 2019
2 parents 1244dce + 86cb955 commit 9ca3937
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ pure C API.
libgraphqlparser requires a C++ compiler that supports C++11. It
also requires Mac OS X or Linux.

To run tests, please download googletest from
To run tests, first, compile and install the library as described above. Then,
please download googletest from
https://github.com/google/googletest/archive/release-1.8.0.zip
and unzip it in the `test` subdirectory.
and unzip it in the `test` subdirectory. In consequence, a folder
`googletest-release-1.8.0` should be contained in `test`. Next, within the
`test` folder, run `cmake .` and `make` to generate the `runTests` binary.
To execute the tests run `./test/runTests` from the main folder.

## Building libgraphqlparser

Expand Down Expand Up @@ -69,6 +73,7 @@ and it should also simplify the task of creating bindings to other
programming languages.

## License

libgraphqlparser is MIT-licensed.

## Related Projects
Expand Down
8 changes: 5 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ ADD_SUBDIRECTORY(googletest-release-1.8.0/googletest)

ENABLE_TESTING()

INCLUDE_DIRECTORIES(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
INCLUDE_DIRECTORIES(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR} /usr/local/include/graphqlparser)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -g")

FILE(COPY valgrind.supp DESTINATION .)

Expand All @@ -16,8 +18,8 @@ FILE(COPY schema-kitchen-sink.json DESTINATION .)

ADD_EXECUTABLE(runTests ParserTests.cpp JsonVisitorTests.cpp BuildCAPI.c)

TARGET_LINK_LIBRARIES(runTests gtest gtest_main)
find_library(LIBGRAPHQLPARSER_LIBRARY libgraphqlparser.dylib HINTS /usr/local/lib)

TARGET_LINK_LIBRARIES(runTests graphqlparser)
TARGET_LINK_LIBRARIES(runTests gtest gtest_main ${LIBGRAPHQLPARSER_LIBRARY})

ADD_TEST(gtest_tests runTests)

0 comments on commit 9ca3937

Please sign in to comment.