diff --git a/README.md b/README.md index 1b40b34..9b06923 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7e22436..4d08a33 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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 .) @@ -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)