ia64/xen-unstable

view tools/check/chk @ 6385:f34e732ed4bf

Xenstore testsuite robustness: save output rather than rerun on failure.
"make check" reruns a test which fails with more verbosity. If the test
fails intermittently, that doesn't work well: save the output and simply
dump it if the test fails.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Tue Aug 23 19:58:59 2005 +0000 (2005-08-23)
parents 0a4b76b6b5a0
children c76a8c8b7132 291e816acbf4 b2f4823b6ff0
line source
1 #!/bin/bash
3 function usage {
4 echo "Usage:"
5 echo "\t$0 [build|install|clean]"
6 echo
7 echo "Check suitability for Xen build or install."
8 echo "Exit with 0 if OK, 1 if not."
9 echo "Prints only failed tests."
10 echo
11 echo "Calling with 'clean' removes generated files."
12 exit 1
13 }
15 export PATH=${PATH}:/sbin:/usr/sbin
17 case $1 in
18 build)
19 check="CHECK-BUILD"
20 info=".chkbuild"
21 ;;
22 install)
23 check="CHECK-INSTALL"
24 info=".chkinstall"
25 ;;
26 clean)
27 rm -f .chkbuild .chkinstall
28 exit 0
29 ;;
30 *)
31 usage
32 ;;
33 esac
35 failed=0
37 echo "Xen ${check} " $(date) > ${info}
38 for f in check_* ; do
39 case $f in
40 *~)
41 continue
42 ;;
43 *)
44 ;;
45 esac
46 if ! [ -x $f ] ; then
47 continue
48 fi
49 if ! grep -q ${check} $f ; then
50 continue
51 fi
52 echo ' ' >> ${info}
53 echo "Checking $f" >> ${info}
54 if ./$f 1>>${info} 2>&1 ; then
55 echo OK >> ${info}
56 else
57 failed=1
58 echo "FAILED $f"
59 echo FAILED >> ${info}
60 fi
61 done
63 echo >> ${info}
65 if [ "$failed" == "1" ] ; then
66 echo "Checks failed. See `pwd`/${info} for details."
67 echo "FAILED" >> ${info}
68 exit 1
69 else
70 echo "OK" >> ${info}
71 exit 0
72 fi