Chromium Code Reviews| Index: run_remote_tests.sh |
| diff --git a/run_remote_tests.sh b/run_remote_tests.sh |
| index f1f49cfe18426dcb246241d37b19ba0a62e07e02..9f2b28611712858d79cf9f8cd2ea171eef12264f 100755 |
| --- a/run_remote_tests.sh |
| +++ b/run_remote_tests.sh |
| @@ -42,6 +42,7 @@ DEFINE_boolean build ${FLAGS_FALSE} "Build tests while running" b |
| DEFINE_string chroot "${DEFAULT_CHROOT_DIR}" "alternate chroot location" c |
| DEFINE_boolean cleanup ${FLAGS_FALSE} "Clean up temp directory" |
| DEFINE_integer iterations 1 "Iterations to run every top level test" i |
| +DEFINE_boolean quiet ${FLAGS_FALSE} "Hide most test logs on success" |
|
sosa
2011/02/15 22:16:47
maybe hide_info?
|
| DEFINE_string results_dir_root "" "alternate root results directory" |
| DEFINE_boolean verbose ${FLAGS_FALSE} "Show verbose autoserv output" v |
| DEFINE_boolean use_emerged ${FLAGS_FALSE} \ |
| @@ -69,7 +70,10 @@ function start_ssh_agent() { |
| fi |
| cp $FLAGS_private_key $tmp_private_key |
| chmod 0400 $tmp_private_key |
| - ssh-add $tmp_private_key |
| + |
| + # Run this way to capture normal stderr output but only display it |
| + # on failure. |
| + result="$(ssh-add $tmp_private_key 2>&1)" || die "$result" |
| } |
| function cleanup() { |
| @@ -319,13 +323,19 @@ function main() { |
| sudo chmod a+w ./server/{tests,site_tests} |
| echo ./server/autoserv ${autoserv_args} |
| - |
| + |
| + # run autoserv in subshell, capture it's output, and only display output |
| + # on error. |
| if [ ${FLAGS_build} -eq ${FLAGS_TRUE} ]; then |
| - # run autoserv in subshell |
| - (. ${BUILD_ENV} && tc-export CC CXX PKG_CONFIG && |
| - ./server/autoserv ${autoserv_args}) |
| + result="$(. ${BUILD_ENV} && tc-export CC CXX PKG_CONFIG && |
| + ./server/autoserv ${autoserv_args} 2>&1)" |
| else |
| - ./server/autoserv ${autoserv_args} |
| + result="$(./server/autoserv ${autoserv_args} 2>&1)" |
|
sosa
2011/02/15 22:16:47
I'm not sure this'll work with || to some var ...
|
| + fi |
| + |
| + if [ $? -ne 0 -o ${FLAGS_quiet} -eq ${FLAGS_FALSE} ]; then |
| + echo |
| + echo "$result" |
| fi |
| done |
| popd > /dev/null |