shithub: mc

Download patch

ref: e2c2808a2a5f83c7c8f204cd01035a1713be8787
parent: 0b99465823930170bb45c9264c10ed5936be5bb4
author: glenda@drat <glenda@drat>
date: Thu May 26 03:08:50 EDT 2016

Fix test scripts.

	Some tests are still busted.

--- a/lib/std/syswrap+plan9.myr
+++ b/lib/std/syswrap+plan9.myr
@@ -98,7 +98,8 @@
 
 
 	if opts & Ocreat != 0
-		fd = sys.create(path, (opts & ~Ocreat : sys.fdopt), (mode : int))
+		opts &= ~Ocreat
+		fd = sys.create(path, (opts : sys.fdopt), (mode : int))
 	else
 		fd = sys.open(path, (opts : sys.fdopt))
 	;;
--- a/test/bld.sub
+++ b/test/bld.sub
@@ -1,1 +1,2 @@
-cmd runtest {test} = ./runtest.sh ;;
+cmd runtest {test,tag=posixy} = ./runtest.sh ;;
+cmd runtest {test,tag=plan9} = ./runtest.rc ;;
--- a/test/runtest.rc
+++ b/test/runtest.rc
@@ -12,13 +12,13 @@
 
 fn pass {
 	passed=$passed ^ ' ' ^ $1
-	echo "!}>> ok"
+	echo '!}>> ok'
 }
 
 fn fail {
 	echo FAIL: $1
-	failed=$failed ^ ' ' ^ $1}
-	echo "!}>> fail $1"
+	failed=$failed ^ ' ' ^ $1
+	echo '!}>> fail '
 }
 
 fn expectstatus {
@@ -64,7 +64,7 @@
 	type=$1; shift
 	res=$1; shift
 
-	echo "test $test <<{!"
+	echo 'test' $test '<<{!'
 	build $test
 	switch($type) {
 	case E
@@ -79,7 +79,7 @@
 }
 
 fn F {
-	echo "test $test <<{!"
+	echo 'test' ^ $1 '<<{!'
 	@{ build $1 } > /dev/null
 	if (~ $status ''/)
 		fail $1
@@ -87,7 +87,7 @@
 		pass $1
 }
 
-echo "MTEST `{grep '^[BF]' tests | wc -l}"
+echo 'MTEST ' `{grep '^[BF]' tests | wc -l}
 
 . tests