Unit tests

- portability to help flod
This commit is contained in:
Federico Hernandez 2012-09-12 00:00:54 +02:00
parent 31bbc0ea2f
commit 112d0d8771
3 changed files with 13 additions and 3 deletions

1
test/.gitignore vendored
View file

@ -26,3 +26,4 @@ view.t
json_test json_test
run_all

View file

@ -10,6 +10,15 @@ set (test_SRCS autocomplete.t color.t config.t date.t directory.t dom.t
duration.t file.t i18n.t json.t list.t nibbler.t path.t rx.t duration.t file.t i18n.t json.t list.t nibbler.t path.t rx.t
t.t t2.t taskmod.t tdb2.t text.t uri.t util.t view.t json_test) t.t t2.t taskmod.t tdb2.t text.t uri.t util.t view.t json_test)
message ("-- Configuring run_all")
set (TESTBLOB "*.t")
if (CYGWIN)
set (TESTBLOB "*.t *.t.exe")
endif (CYGWIN)
configure_file (
${CMAKE_SOURCE_DIR}/test/run_all.in
${CMAKE_SOURCE_DIR}/test/run_all)
add_custom_target (test ./run_all --verbose add_custom_target (test ./run_all --verbose
DEPENDS ${test_SRCS} task_executable DEPENDS ${test_SRCS} task_executable
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)

View file

@ -2,7 +2,7 @@
if [ x"$1" = x"--verbose" ]; if [ x"$1" = x"--verbose" ];
then then
for i in *.t *.t.exe for i in ${TESTBLOB}
do do
echo '#' $i echo '#' $i
./$i > test.log 2>&1 ./$i > test.log 2>&1
@ -24,11 +24,11 @@ else
if [ -x "$VRAMSTEG" ]; then if [ -x "$VRAMSTEG" ]; then
BAR=1 BAR=1
COUNT=0 COUNT=0
TOTAL=`ls *.t | wc -l` TOTAL=`ls ${TESTBLOB} | wc -l`
START=`$VRAMSTEG --now` START=`$VRAMSTEG --now`
fi fi
for i in *.t *.t.exe for i in ${TESTBLOB}
do do
echo '#' $i >>all.log echo '#' $i >>all.log