diff --git a/.travis.yml b/.travis.yml index a809e5e3..3d2f5b1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,4 +18,5 @@ addons: script: - mkdir tests - cd tests - - ../src/test/tpkg/run-one.sh 400-static-analysis +# - ../src/test/tpkg/run-all.sh + - ../src/test/tpkg/run-one.sh 400-static-analysis -V diff --git a/src/test/tpkg/tpkg b/src/test/tpkg/tpkg index 62d81a16..713adcfb 100755 --- a/src/test/tpkg/tpkg +++ b/src/test/tpkg/tpkg @@ -13,6 +13,7 @@ TPKG_BASE="." TPKG_ARGS="" TPKG_CURRENT=`pwd` TPKG_QUIET=0 # only output err() msgs +TPKG_VERBOSE=0 # Show live output of test execution TPKG_KEEP=0 # tpkg create doesn't remove dir/ TPKG_PASS=0 # how much must succeed TPKG_LOG=0 # don't log @@ -73,6 +74,14 @@ function out() { fi } +function write_result() { + if [[ $TPKG_VERBOSE -gt 0 ]]; then + tee -a $1 + else + cat >> $1 + fi +} + function epoch() { # make this sorta portable allthough not needed now epoch=0 @@ -89,9 +98,9 @@ function epoch() { function post() { if [ -f "${dsc_post}" ]; then err "[log] Executing post script: ${dsc_post} ${TPKG_ARGS}" - echo "--------- Start Post Output ------------------ " | tee -a result.$dsc_basename - ${SHELL} ${dsc_post} ${TPKG_ARGS} | tee -a result.$dsc_basename - echo "----------- End Post Output ------------------ " | tee -a result.$dsc_basename + echo "--------- Start Post Output ------------------ " | write_result result.$dsc_basename + ${SHELL} ${dsc_post} ${TPKG_ARGS} | write_result result.$dsc_basename + echo "----------- End Post Output ------------------ " | write_result result.$dsc_basename result=$? if [ $result -ne 0 ]; then err "[warning] Post-script executed with errors: $result." @@ -102,9 +111,9 @@ function post() { function pre() { if [ -f "${dsc_pre}" ]; then err "[log] Executing pre script: ${dsc_pre} ${TPKG_ARGS}" - echo "--------- Start Pre Output ------------------- " | tee -a result.$dsc_basename - ${SHELL} ${dsc_pre} ${TPKG_ARGS} | tee -a result.$dsc_basename - echo "----------- End Pre Output ------------------- " | tee -a result.$dsc_basename + echo "--------- Start Pre Output ------------------- " | write_result result.$dsc_basename + ${SHELL} ${dsc_pre} ${TPKG_ARGS} | write_result result.$dsc_basename + echo "----------- End Pre Output ------------------- " | write_result result.$dsc_basename result=$? if [ $result -ne 0 ]; then err "[warning] Pre-script executed with errors: $result." @@ -179,6 +188,7 @@ function usage() { out " -h\t\tshow this help" out " -v\t\tshow version" out " -q\t\tonly print errors" + out " -V\t\tshow live output when executing tests" out " -l\t\tlog test name to syslog when starting the test (using logger)" out " -p PRI\tlog using PRI as priority" out " -k\t\tdon't remove test directory when creating/executing a tpkg package" @@ -407,7 +417,7 @@ function extract_tpkg_to { #