blob: 369d44d8c042aa01515110755eac98c9235c8179 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/bin/bash
TESTNUM=0
START=1
END=100000
# requires: first arg is a <=10-char label, second arg is command
# effects: runs banner with label, then runs the command; if it fails, prints
# label before exiting
function try_command()
{
TESTNUM=$((TESTNUM + 1))
if [ "$TESTNUM" -lt "$START" -o "$TESTNUM" -gt "$END" ]; then
echo "Skipping test #$TESTNUM"
return
fi
LABEL=$1
shift
# banner "$LABEL"
# run the command
$*
CODE=$?
if [ $CODE -ne 0 ]; then
echo Error: Failed in $LABEL subtest \#$TESTNUM with code $CODE \(rerun with: trlite $VMNUM $TESTNUM\)!
exit $CODE
fi
echo Success: $LABEL
}
# linux runtime tests
# TODO: Add buffer, it fails in Linux ATM
for i in error event promise; do
./outdir/linux/release/jslinux tests/test-$i.js > /tmp/output
cat /tmp/output
try_command "run t-$i" test ! $(grep "FAIL" /tmp/output)
done
|