Moved function that runs command for all unit tests to unit_test.sh.

Testclean target should work now.
This commit is contained in:
Roman Bovsunivskiy
2010-02-22 17:05:41 +00:00
parent 7b71ab2021
commit c72f02051d
3 changed files with 24 additions and 32 deletions
+3 -31
View File
@@ -7,41 +7,13 @@ SUBDIRS = src doc
DOLLAR = $
build_tests.commands = for directory in `find . -name unit_tests`; \
do \
home=`pwd`; \
echo; \
echo "Building test in "$${DOLLAR}$${DOLLAR}directory; \
cd $${DOLLAR}$${DOLLAR}directory; \
qmake -spec $${DOLLAR}$${DOLLAR}QMAKESPEC; \
make; \
cd $${DOLLAR}$${DOLLAR}home; \
done
build_tests.commands = ./unit_tests.sh make
build_tests.depends = all
run_tests.commands = for directory in `find . -name unit_tests`; \
do \
home=`pwd`; \
echo; \
echo "Running test in "$${DOLLAR}$${DOLLAR}directory; \
cd $${DOLLAR}$${DOLLAR}directory; \
qmake -spec $${DOLLAR}$${DOLLAR}QMAKESPEC; \
make run; \
cd $${DOLLAR}$${DOLLAR}home; \
done
run_tests.commands = ./unit_tests.sh make run
run_tests.depends = all
testclean.commands = for directory in `find . -name unit_tests`; \
do \
home=`pwd`; \
echo; \
echo "Cleaning test files in "$${DOLLAR}$${DOLLAR}directory; \
cd $${DOLLAR}$${DOLLAR}directory; \
qmake -spec $${DOLLAR}$${DOLLAR}QMAKESPEC; \
make clean; \
cd $${DOLLAR}$${DOLLAR}home; \
done
testclean.commands = ./unit_tests.sh make clean
tests.depends = run_tests
QMAKE_EXTRA_TARGETS += build_tests run_tests tests testclean
+9 -1
View File
@@ -13,5 +13,13 @@ run.commands = echo "Running tests..." && \
cd $${DOLLAR}$${DOLLAR}home; \
done; \
kill $${DOLLAR}$${DOLLAR}pid;
clean.commands = for directory in `find . -maxdepth 1 -type d -regex \'\./[A-Za-z0-9\-\_]*\'`; \
do \
cd $${DOLLAR}$${DOLLAR}directory; \
[ ! -e Makefile ] && qmake -spec $${DOLLAR}$${DOLLAR}QMAKESPEC; \
make clean; \
cd -; \
done
QMAKE_EXTRA_TARGETS += run
QMAKE_EXTRA_TARGETS += run clean
Executable
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
action=$@
for directory in $(find . -name unit_tests)
do
home=`pwd`
cd $directory
qmake -spec $QMAKESPEC
$action
cd $home
done