Skip to content

Commit

Permalink
using ctest
Browse files Browse the repository at this point in the history
  • Loading branch information
omdxp committed Apr 7, 2024
1 parent 6caf3a2 commit 7434417
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/c-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions c/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ build/
CMakeUserPresets.json
docs/
data.h
Testing/
4 changes: 2 additions & 2 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down
1 change: 1 addition & 0 deletions c/CTestTestfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_test(KuliyaTests /build/test)

0 comments on commit 7434417

Please sign in to comment.