Skip to content

Commit

Permalink
jwt-cli: Add more tests and connect in with unit testing
Browse files Browse the repository at this point in the history
The tools/*.c files are not part of coverage, yet.

Signed-off-by: Ben Collins <[email protected]>
  • Loading branch information
benmcollins committed Feb 12, 2025
1 parent e976cdb commit 444ea08
Show file tree
Hide file tree
Showing 4 changed files with 302 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ if (WITH_TESTS)
set(CHECK_REQUIRED REQUIRED)
endif()
pkg_check_modules(CHECK check>=0.9.10 IMPORTED_TARGET ${CHECK_REQUIRED})
find_program (BATS_CMD bats)
else()
if (ENABLE_COVERAGE)
message(SEND_ERROR "You must set WITH_TESTS=ON to enable code coverage")
Expand Down Expand Up @@ -280,6 +281,10 @@ if (CHECK_FOUND)
jwt_add_test(NAME ${TEST})
endforeach()

if (BATS_CMD)
add_test(NAME jwt_cli COMMAND /bin/bash -c "export SRCDIR=\"${CMAKE_SOURCE_DIR}\"; \"${CMAKE_SOURCE_DIR}\"/tests/jwt-cli.bats")
endif()

add_custom_target(check
COMMAND ${CMAKE_CTEST_COMMAND}
DEPENDS ${UNIT_TESTS})
Expand Down
Loading

0 comments on commit 444ea08

Please sign in to comment.