diff options
author | kate.ward <kate.ward@forestent.com> | 2013-01-05 12:29:36 +0000 |
---|---|---|
committer | kate.ward <kate.ward@forestent.com> | 2013-01-05 12:29:36 +0000 |
commit | 4a16b43fddb91b62c1dfa2607881b3af2e4e8c18 (patch) | |
tree | dc6f1e35565c9dc3256f884d7c329f6b0ced2344 | |
parent | 81973e8b6fd5f5301a6936c3074909ccd0bae4ef (diff) | |
download | shflags-4a16b43fddb91b62c1dfa2607881b3af2e4e8c18.tar.gz |
added dry_run mode to gen_test_results
-rwxr-xr-x | source/1.0/bin/gen_test_results.sh | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/source/1.0/bin/gen_test_results.sh b/source/1.0/bin/gen_test_results.sh index b0650d8..eee4dde 100755 --- a/source/1.0/bin/gen_test_results.sh +++ b/source/1.0/bin/gen_test_results.sh @@ -43,6 +43,7 @@ os_version=`versions_osVersion` DEFINE_boolean force false 'force overwrite' f DEFINE_string output_dir "`pwd`" 'output dir' d DEFINE_string output_file "${os_name}-${os_version}.txt" 'output file' o +DEFINE_boolean dry_run false "supress logging to a file" n FLAGS "${@:-}" || exit $? eval set -- "${FLAGS_ARGV}" @@ -53,7 +54,7 @@ output=`shlib_relToAbsPath "${output}"` # checks [ -n "${FLAGS_suite}" ] || die 'suite flag missing' -if [ -f "${output}" ]; then +if [ ! ${FLAGS_dry_run} -a -f "${output}" ]; then if [ ${FLAGS_force} -eq ${FLAGS_TRUE} ]; then rm -f "${output}" else @@ -61,10 +62,21 @@ if [ -f "${output}" ]; then exit ${FLAGS_ERROR} fi fi -touch "${output}" 2>/dev/null || die "unable to write to '${output}'" +if [ ! ${FLAGS_dry_run} ]; then + touch "${output}" 2>/dev/null || die "unable to write to '${output}'" +fi # run tests -( cd "${SRC_DIR}"; ./${FLAGS_suite} |tee "${output}" ) +( + cd "${SRC_DIR}"; + if [ ${FLAGS_dry_run} ]; then + ./${FLAGS_suite} + else + ./${FLAGS_suite} |tee "${output}" + fi +) -echo >&2 -echo "output written to '${output}'" >&2 +if [ ! ${FLAGS_dry_run} ]; then + echo >&2 + echo "output written to '${output}'" >&2 +fi |