Mercurial > hg > aboriginal
annotate sources/more/smoketest-all.sh @ 860:6b80bbc15ded
Add some comments.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 25 Oct 2009 03:27:17 -0500 |
parents | 4952504f5c57 |
children | a181d81540ed |
rev | line source |
---|---|
740
5b063eb13fd0
Quick and dirty script to run smoketest.sh on all targets, to see if they can compile and run "hello world".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/bash |
5b063eb13fd0
Quick and dirty script to run smoketest.sh on all targets, to see if they can compile and run "hello world".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
860 | 3 # Run smoketest script on every build/system-image-* architecture. |
4 | |
5 # If $FORK is set, run them in parallel. | |
6 | |
778
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
7 . sources/functions.sh || exit 1 |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
8 |
758
75835debe6b5
Add --logs option to smoketest-all.sh to read existing logs from buildall.sh.
Rob Landley <rob@landley.net>
parents:
740
diff
changeset
|
9 if [ "$1" == "--logs" ] |
75835debe6b5
Add --logs option to smoketest-all.sh to read existing logs from buildall.sh.
Rob Landley <rob@landley.net>
parents:
740
diff
changeset
|
10 then |
778
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
11 for i in build/logs/smoketest-*.txt |
758
75835debe6b5
Add --logs option to smoketest-all.sh to read existing logs from buildall.sh.
Rob Landley <rob@landley.net>
parents:
740
diff
changeset
|
12 do |
778
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
13 NAME="$(echo $i | sed 's/.*smoketest-\(.*\)\.txt/\1/')" |
758
75835debe6b5
Add --logs option to smoketest-all.sh to read existing logs from buildall.sh.
Rob Landley <rob@landley.net>
parents:
740
diff
changeset
|
14 echo -n "Testing $NAME:" |
75835debe6b5
Add --logs option to smoketest-all.sh to read existing logs from buildall.sh.
Rob Landley <rob@landley.net>
parents:
740
diff
changeset
|
15 RESULT="$(grep 'Hello world!' "$i")" |
75835debe6b5
Add --logs option to smoketest-all.sh to read existing logs from buildall.sh.
Rob Landley <rob@landley.net>
parents:
740
diff
changeset
|
16 [ -z "$RESULT" ] && echo "FAIL" || echo "PASS" |
75835debe6b5
Add --logs option to smoketest-all.sh to read existing logs from buildall.sh.
Rob Landley <rob@landley.net>
parents:
740
diff
changeset
|
17 done |
75835debe6b5
Add --logs option to smoketest-all.sh to read existing logs from buildall.sh.
Rob Landley <rob@landley.net>
parents:
740
diff
changeset
|
18 |
75835debe6b5
Add --logs option to smoketest-all.sh to read existing logs from buildall.sh.
Rob Landley <rob@landley.net>
parents:
740
diff
changeset
|
19 exit |
75835debe6b5
Add --logs option to smoketest-all.sh to read existing logs from buildall.sh.
Rob Landley <rob@landley.net>
parents:
740
diff
changeset
|
20 fi |
75835debe6b5
Add --logs option to smoketest-all.sh to read existing logs from buildall.sh.
Rob Landley <rob@landley.net>
parents:
740
diff
changeset
|
21 |
778
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
22 function dotest() |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
23 { |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
24 [ -z "$FORK" ] && echo -n "Testing $1:" |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
25 [ ! -z "$VERBOSE" ] && VERBOSITY="tee >(cat >&2) |" |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
26 RESULT="$(./smoketest.sh "$1" 2>&1 | eval "$VERBOSITY grep 'Hello world!'")" |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
27 [ -z "$RESULT" ] && RESULT="FAIL" || RESULT="PASS" |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
28 [ -z "$FORK" ] && echo "$RESULT" || echo "Testing $1:$RESULT" |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
29 rm -f build/system-image-"$1"/hdb.img 2>/dev/null |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
30 } |
740
5b063eb13fd0
Quick and dirty script to run smoketest.sh on all targets, to see if they can compile and run "hello world".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 |
778
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
32 # Test all non-hw targets to see whether or not they can compile and run |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
33 # the included "hello world" program. |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
34 |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
35 for i in $(ls -pd build/system-image-* | sed -n 's@.*/system-image-\(.*\)/@\1@p' | grep -v "^hw-") |
740
5b063eb13fd0
Quick and dirty script to run smoketest.sh on all targets, to see if they can compile and run "hello world".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 do |
787
23bff7aa79eb
Teach buildall.sh to use new build.sh infrastructure, and replace doforklog with orthogonal maybe_fork and maybe_quiet functions.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
37 maybe_fork "dotest $i" |
740
5b063eb13fd0
Quick and dirty script to run smoketest.sh on all targets, to see if they can compile and run "hello world".
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
38 done |
778
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
39 |
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
758
diff
changeset
|
40 wait |