File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 sudo apt-get update
2424 sudo apt-get install -y \
2525 build-essential \
26- cmake
26+ cmake \
27+ libcriterion-dev
2728
2829 - name : Configure CMake
2930 run : |
3233 cmake ..
3334
3435 - name : Build
35- run : cmake --build build
36+ run : cmake --build build --target xpscan_tests
3637
3738 - name : Run tests
38- run : cd build && make test
39+ run : cd build && ./xpscan_tests
Original file line number Diff line number Diff line change @@ -5,16 +5,9 @@ set(CMAKE_CXX_STANDARD 17)
55set (SOURCES src/Scanner.cpp src/Exporter.cpp src/Printer.cpp)
66set (TEST_SOURCES tests/ExporterTest.cpp tests/ScannerTest.cpp tests/PrinterTest.cpp)
77
8- # Fetch Criterion (Testing library)
9- include (FetchContent )
10- FetchContent_Declare (criterion
11- GIT_REPOSITORY https://github.com/Snaipe/Criterion.git
12- GIT_TAG v2.4.2
13- GIT_SHALLOW TRUE
14- GIT_PROGRESS TRUE
15- )
16- set (FETCHCONTENT_QUIET FALSE )
17- FetchContent_MakeAvailable (criterion)
8+ # Find Criterion (Testing library)
9+ find_package (PkgConfig REQUIRED )
10+ pkg_check_modules (CRITERION REQUIRED criterion )
1811
1912# Look for threads
2013find_package (Threads REQUIRED )
@@ -28,7 +21,8 @@ target_link_libraries(xpscan PRIVATE Threads::Threads)
2821
2922# Tests runner
3023add_executable (xpscan_tests EXCLUDE_FROM_ALL ${TEST_SOURCES} ${SOURCES} )
31- target_link_libraries (xpscan_tests PRIVATE Threads::Threads criterion )
24+ target_include_directories (xpscan_tests PRIVATE ${CRITERION_INCLUDE_DIRS} )
25+ target_link_libraries (xpscan_tests PRIVATE Threads::Threads ${CRITERION_LIBRARIES} )
3226
3327# Test target
3428add_custom_target (test
You can’t perform that action at this time.
0 commit comments