Skip to content

Commit

Permalink
Perl buildsystem: add test prepare targets
Browse files Browse the repository at this point in the history
Similar to the CMake prepare targets, these are useful when intending to
debug tests or run a server using a standard test configuration, which
requires the testfiles directory to be copied into the binary output tree.

(cherry picked from commit 2afecdd)
  • Loading branch information
qris committed Jul 23, 2017
1 parent f7dad7e commit 55a3fed
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions infrastructure/makebuildenv.pl.in
Expand Up @@ -697,14 +697,31 @@ __E
#
${makefile_ifdef_prefix}ifdef RELEASE
TARGET = $release_base_dir/$mod/$end_target_file
TEST_DEST = ../../$release_base_dir/$mod
TEST_MODE = RELEASE
${makefile_ifdef_prefix}else
TARGET = $debug_base_dir/$mod/$end_target_file
TEST_DEST = ../../$debug_base_dir/$mod
TEST_MODE = DEBUG
${makefile_ifdef_prefix}endif

TESTFILES_DEST = \$(TEST_DEST)/testfiles

.PHONY: default
default:
\$(MAKE) -C ../.. \$(TARGET)

.PHONY: prepare
prepare: default
../../runtest.pl -n ${name} \$(TEST_MODE)
test ! -r \$(TESTFILES_DEST) || chmod -R a+rwx \$(TESTFILES_DEST)
rm -rf \$(TESTFILES_DEST)
cp -p -R testfiles \$(TEST_DEST)

.PHONY: test
test: default
../../runtest.pl ${name} \$(TEST_MODE)

.PHONY: clean
clean:
\$(MAKE) -C ../.. clean_${type}_${name}
Expand Down

0 comments on commit 55a3fed

Please sign in to comment.