We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
2 parents1cf923e +66ab130 commitf452d48Copy full SHA for f452d48
.github/workflows/linux_check.yml
@@ -0,0 +1,22 @@
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
19
+ cd tests
20
+ pwd
21
+ ls -l
22
+ ./run_tests.sh
src/CMakeLists.txt
@@ -21,12 +21,17 @@ project("datalog-cpp")
# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
23
24
+# unit-test library
25
+add_library(tests_mainSTATIC ../tests/tests_main.cpp)
26
27
# types_test target
28
add_executable(types_test ../tests/types_test.cpp)
29
target_include_directories(types_testPUBLIC${CMAKE_CURRENT_SOURCE_DIR})
30
+target_link_libraries(types_test tests_main)
31
target_compile_definitions(types_testPUBLICUNIX)
32
33
# variable_test target
34
add_executable(variable_test ../tests/variable_test.cpp)
35
target_include_directories(variable_testPUBLIC${CMAKE_CURRENT_SOURCE_DIR})
36
+target_link_libraries(variable_test tests_main)
37
target_compile_definitions(variable_testPUBLICUNIX)
tests/run_tests.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -e
+../build/types_test
+../build/variable_test
tests/tests_main.cpp
@@ -0,0 +1,3 @@
+// tests-main.cpp
+#defineCATCH_CONFIG_MAIN
+#include"catch.hpp"
tests/types_test.cpp
@@ -1,6 +1,3 @@
-// Let Catch provide main():
-#defineCATCH_CONFIG_MAIN
-
#include"catch.hpp"
#include"Datalog.h"
tests/variable_test.cpp
#include"Variable.h"
@@ -18,9 +15,9 @@ bool boundVariableTest() {
}
TEST_CASE("An new variable is unbound","[variable]" ) {
-REQUIRE(freeVariableTest() );
+REQUIRE(freeVariableTest()==true);
TEST_CASE("A variable with a value is bound","[variable]" ) {
+REQUIRE(boundVariableTest() ==true );