From 736d8a3d81ab2ac8e5556f2dd5f6fed9d9137d18 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sat, 18 Nov 2017 16:15:09 +0100 Subject: Rename roundtrip and entity tests Rename the tests to reflect that they use the library, not the executable. --- test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6da3a6b..ae7d10d 100755 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -41,14 +41,14 @@ IF (PYTHONINTERP_FOUND) "--library-dir" "${CMAKE_CURRENT_BINARY_DIR}/../src" ) - add_test(roundtriptest_executable + add_test(roundtriptest_library ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/roundtrip_tests.py" "--spec" "${CMAKE_CURRENT_SOURCE_DIR}/spec.txt" "--library-dir" "${CMAKE_CURRENT_BINARY_DIR}/../src" ) - add_test(entity_executable + add_test(entity_library ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/entity_tests.py" "--library-dir" "${CMAKE_CURRENT_BINARY_DIR}/../src" -- cgit v1.2.3 From 772c4cbde52f1f295f66bb80a55d3db446742094 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sat, 18 Nov 2017 16:08:55 +0100 Subject: Also run API tests with CMARK_SHARED=OFF --- CMakeLists.txt | 2 +- api_test/CMakeLists.txt | 6 +++++- test/CMakeLists.txt | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4eb0541..a25b269 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ option(CMARK_SHARED "Build shared libcmark library" ON) option(CMARK_LIB_FUZZER "Build libFuzzer fuzzing harness" OFF) add_subdirectory(src) -if(CMARK_TESTS AND CMARK_SHARED) +if(CMARK_TESTS AND (CMARK_SHARED OR CMARK_STATIC)) add_subdirectory(api_test) endif() add_subdirectory(man) diff --git a/api_test/CMakeLists.txt b/api_test/CMakeLists.txt index 3151ccc..2701abb 100644 --- a/api_test/CMakeLists.txt +++ b/api_test/CMakeLists.txt @@ -8,7 +8,11 @@ include_directories( ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src ) -target_link_libraries(api_test libcmark) +if(CMARK_SHARED) + target_link_libraries(api_test libcmark) +else() + target_link_libraries(api_test libcmark_static) +endif() # Compiler flags if(MSVC) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ae7d10d..5c07fb7 100755 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,7 +9,7 @@ else(SPEC_TESTS) find_package(PythonInterp 3) endif(SPEC_TESTS) -if (CMARK_SHARED) +if (CMARK_SHARED OR CMARK_STATIC) add_test(NAME api_test COMMAND api_test) endif() -- cgit v1.2.3 From 9253cbff4f28651ec31ed1e1e714c9093a1ac222 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sat, 18 Nov 2017 15:51:24 +0100 Subject: Add static-only build to Travis test matrix --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index abb33cb..b8818c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,11 @@ language: c compiler: - clang - gcc +matrix: + include: + - os: linux + compiler: gcc + env: CMAKE_OPTIONS="-DCMARK_SHARED=OFF" addons: apt: # we need a more recent cmake than travis/linux provides (at least 2.8.9): @@ -26,7 +31,7 @@ before_install: fi script: - - make + - (mkdir -p build && cd build && cmake $CMAKE_OPTIONS ..) - make test - | if [ ${TRAVIS_OS_NAME:-'linux'} = 'linux' ] -- cgit v1.2.3