mirror of
https://github.com/void-linux/void-packages.git
synced 2025-08-02 19:02:57 +02:00
common/build-style: fix do_check for cmake.
make was accidentally left hardcoded to query if a test target was available, which meant tests wouldn't be run for most of the applications, since they were now using ninja.
This commit is contained in:
parent
cdbe6d3471
commit
8c41deaff7
1 changed files with 24 additions and 10 deletions
|
@ -79,9 +79,13 @@ do_build() {
|
||||||
}
|
}
|
||||||
|
|
||||||
do_check() {
|
do_check() {
|
||||||
|
: ${make_cmd:=ninja}
|
||||||
|
|
||||||
cd ${cmake_builddir:=build}
|
cd ${cmake_builddir:=build}
|
||||||
|
|
||||||
if [ -z "$make_cmd" ] && [ -z "$make_check_target" ]; then
|
if [ -z "$make_check_target" ]; then
|
||||||
|
case $make_cmd in
|
||||||
|
make)
|
||||||
if make -q test 2>/dev/null; then
|
if make -q test 2>/dev/null; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
|
@ -90,9 +94,19 @@ do_check() {
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
ninja)
|
||||||
|
if ! ninja -t query test >/dev/null 2>&1; then
|
||||||
|
msg_warn 'No target to "ninja test".\n'
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
msg_warn "Can't run tests with '$make_cmd', define do_check.\n"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: ${make_cmd:=ninja}
|
|
||||||
: ${make_check_target:=test}
|
: ${make_check_target:=test}
|
||||||
|
|
||||||
CTEST_OUTPUT_ON_FAILURE=TRUE ${make_cmd} ${make_check_args} ${make_check_target}
|
CTEST_OUTPUT_ON_FAILURE=TRUE ${make_cmd} ${make_check_args} ${make_check_target}
|
||||||
|
|
Loading…
Add table
Reference in a new issue