diff --git a/.github/workflows/c-checks.yml b/.github/workflows/c-checks.yml index e48e17a..b11a9a9 100644 --- a/.github/workflows/c-checks.yml +++ b/.github/workflows/c-checks.yml @@ -30,22 +30,19 @@ jobs: cd c/build sh conanbuild.sh cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release + make all - name: Build and run build script run: | - cd c/build - make build - cd .. + cd c ./build/build - name: Build and run tests run: | - cd c/build - make test - ./test + cd c + ctest - name: Build and run example run: | - cd c/build - make example - ./example + cd c + ./build/example diff --git a/c/.gitignore b/c/.gitignore index 053256b..d1de379 100644 --- a/c/.gitignore +++ b/c/.gitignore @@ -2,3 +2,4 @@ build/ CMakeUserPresets.json docs/ data.h +Testing/ diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt index 23cc869..ffd1622 100644 --- a/c/CMakeLists.txt +++ b/c/CMakeLists.txt @@ -32,7 +32,7 @@ add_executable(example example/main.c) add_executable(example2 example/main.cpp) -# Link the test and example executables with the "kuliya" library +# Link the example executable with the "kuliya" library target_link_libraries(example kuliya) target_link_libraries(example2 kuliya) @@ -47,7 +47,7 @@ target_link_libraries(build jsmn::jsmn) find_package(libunistring REQUIRED) target_link_libraries(build libunistring::libunistring) -# Link test executable with "CppUTest" library +# Link test executable with required libraries find_package(CppUTest REQUIRED) target_link_libraries(test PRIVATE kuliya helpers cpputest::cpputest libunistring::libunistring) diff --git a/c/CTestTestfile.cmake b/c/CTestTestfile.cmake new file mode 100644 index 0000000..821087b --- /dev/null +++ b/c/CTestTestfile.cmake @@ -0,0 +1 @@ +add_test(KuliyaTests /build/test)