summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-12-26 01:44:00 -0800
committerOri Bernstein <ori@eigenstate.org>2014-12-26 01:44:00 -0800
commitd7ad2c79c05658aa356318e8dd11ce8fd837db19 (patch)
tree7be0764667d1664eeb11f2b49314124112958b56 /test
parent25f2319f74103671395d0c151c550abe16928f62 (diff)
downloadmc-d7ad2c79c05658aa356318e8dd11ce8fd837db19.tar.gz
Get the test harness more or less working.
Thanks cinap!
Diffstat (limited to 'test')
-rw-r--r--test/runtest.rc32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/runtest.rc b/test/runtest.rc
index 1fea330..6667019 100644
--- a/test/runtest.rc
+++ b/test/runtest.rc
@@ -1,12 +1,12 @@
#!/bin/rc
-passed=""
-failed=""
+
+passed=''
+failed=''
npassed=0
nfailed=0
fn build {
rm -f $1 $1^.6 $1^.s $1^.use
- echo ../myrbuild/6.out -b $1 -C../6/6.out -M../muse/6.out -I../libstd -r../rt/_myrrt.6 $1^.myr
../myrbuild/6.out -b $1 -C../6/6.out -M../muse/6.out -I../libstd -r../rt/_myrrt.6 $1^.myr
}
@@ -20,14 +20,14 @@ fn fail {
}
fn expectstatus {
+ st='*'^$2
+ if(~ $2 0)
+ st=''
./$1 $3
- if(~ *$status $2){
+ if(eval '~ $status '$st)
pass $1
- return
- }
- if not {
+ if not
fail $1
- }
}
fn expectprint {
@@ -60,16 +60,16 @@ fn expectfcmp {
fn B {
test=$1; shift
type=$1; shift
- args=$1; shift
+ res=$1; shift
build $test
switch($type) {
case E
- expectstatus $test $res
+ expectstatus $test $res
case P
- expectprint $test $res
+ expectprint $test $res
case C
- expectcmp $test $res
+ expectcmp $test $res
case F
expectfcmp $test $res
}
@@ -77,7 +77,7 @@ fn B {
fn F {
@{ build $1 } > /dev/null
- if (~ $status "")
+ if (~ $status ''/)
fail $1
if not
pass $1
@@ -86,10 +86,10 @@ fn F {
. tests
-echo PASSED ^ " " ^ $passed
-if(~ $failed "")
+echo PASSED ^ ' ' ^ $passed
+if(~ $failed '')
echo SUCCESS
if not
- echo FAILURES ^ " " ^ $failed
+ echo FAILURES ^ ' ' ^ $failed