File tree Expand file tree Collapse file tree 6 files changed +36
-8
lines changed Expand file tree Collapse file tree 6 files changed +36
-8
lines changed Original file line number Diff line number Diff line change
1
+ name : CI for Linux
2
+
3
+ on : push
4
+
5
+ jobs :
6
+ test :
7
+ runs-on : ubuntu-latest
8
+
9
+ steps :
10
+ - uses : actions/checkout@v2
11
+ - name : build
12
+ run : |
13
+ mkdir build && cd build
14
+ cmake ../src
15
+ make
16
+ cd ..
17
+ - name : regression test
18
+ run : |
19
+ cd tests
20
+ pwd
21
+ ls -l
22
+ ./run_tests.sh
Original file line number Diff line number Diff line change @@ -21,12 +21,17 @@ project("datalog-cpp")
21
21
# specify the C++ standard
22
22
set (CMAKE_CXX_STANDARD 17 )
23
23
24
+ # unit-test library
25
+ add_library (tests_main STATIC ../tests/tests_main.cpp )
26
+
24
27
# types_test target
25
28
add_executable (types_test ../tests/types_test.cpp )
26
29
target_include_directories (types_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} )
30
+ target_link_libraries (types_test tests_main )
27
31
target_compile_definitions (types_test PUBLIC UNIX )
28
32
29
33
# variable_test target
30
34
add_executable (variable_test ../tests/variable_test.cpp )
31
35
target_include_directories (variable_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} )
36
+ target_link_libraries (variable_test tests_main )
32
37
target_compile_definitions (variable_test PUBLIC UNIX )
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+ ../build/types_test
4
+ ../build/variable_test
Original file line number Diff line number Diff line change
1
+ // tests-main.cpp
2
+ #define CATCH_CONFIG_MAIN
3
+ #include " catch.hpp"
Original file line number Diff line number Diff line change 1
- // Let Catch provide main():
2
- #define CATCH_CONFIG_MAIN
3
-
4
1
#include " catch.hpp"
5
2
#include " Datalog.h"
6
3
Original file line number Diff line number Diff line change 1
- // Let Catch provide main():
2
- #define CATCH_CONFIG_MAIN
3
-
4
1
#include " catch.hpp"
5
2
#include " Variable.h"
6
3
@@ -18,9 +15,9 @@ bool boundVariableTest() {
18
15
}
19
16
20
17
TEST_CASE ( " An new variable is unbound" , " [variable]" ) {
21
- REQUIRE ( freeVariableTest () );
18
+ REQUIRE ( freeVariableTest () == true );
22
19
}
23
20
24
21
TEST_CASE ( " A variable with a value is bound" , " [variable]" ) {
25
- REQUIRE ( freeVariableTest () );
22
+ REQUIRE ( boundVariableTest () == true );
26
23
}
You can’t perform that action at this time.
0 commit comments