Skip to content

Commit

Permalink
Don't pass folder in cmake target test-perl-testsuite
Browse files Browse the repository at this point in the history
Passing arguments to tools/invoke-tests overrides TESTS
and makes it impossible to run individual tests as we
document in the README.md, for example:

    make test-perl-testsuite TESTS="t/23-baseclass.t"

Without this change all tests from t are always executed.
  • Loading branch information
kalikiana committed Jun 21, 2024
1 parent b55275c commit 3169942
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmake/test-targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ endif ()
find_program(PROVE_PATH prove)
find_program(UNBUFFER_PATH unbuffer)
if (PROVE_PATH)
set(INVOKE_TEST_ARGS --prove-tool "${PROVE_PATH}" --make-tool "${CMAKE_MAKE_PROGRAM}" --unbuffer-tool "${UNBUFFER_PATH}" --build-directory "${CMAKE_CURRENT_BINARY_DIR}" t)
set(INVOKE_TEST_ARGS --prove-tool "${PROVE_PATH}" --make-tool "${CMAKE_MAKE_PROGRAM}" --unbuffer-tool "${UNBUFFER_PATH}" --build-directory "${CMAKE_CURRENT_BINARY_DIR}")
add_test(
NAME test-perl-testsuite
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/invoke-tests" ${INVOKE_TEST_ARGS}
Expand Down
4 changes: 2 additions & 2 deletions tools/invoke-tests
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ args=()
# use unbuffer if it was found so e.g. timestamps on OBS builds will be useful
# note: When executing tests with prove it seems that the output is only flushed after one test has finished unless there's a terminal.
[[ $unbuffer_path ]] && [[ $unbuffer_path != 'UNBUFFER_PATH-NOTFOUND' ]] && args+=("$unbuffer_path")
# split TESTS on white-spaces to allow specifying multiple tests as documented
TESTS=${TESTS:-"-r t xt"}
# run tests from t only by default
TESTS=${TESTS:-"t"}
# shellcheck disable=SC2206
args+=("$prove_path" $PROVE_ARGS $TESTS)
(cd "$source_directory" && "${args[@]}")

0 comments on commit 3169942

Please sign in to comment.