diff --git a/test/fail/decl-clash.as b/test/fail/decl-clash.as new file mode 100644 index 00000000000..7b96dceba4e --- /dev/null +++ b/test/fail/decl-clash.as @@ -0,0 +1,2 @@ +let test = (); +let test = (); diff --git a/test/fail/ok/decl-clash.run-ir.ok b/test/fail/ok/decl-clash.run-ir.ok new file mode 100644 index 00000000000..e5371865582 --- /dev/null +++ b/test/fail/ok/decl-clash.run-ir.ok @@ -0,0 +1,4 @@ +(unknown location): internal error, Env.Make(X).Clash("test") + +Last environment: + diff --git a/test/fail/ok/decl-clash.run-low.ok b/test/fail/ok/decl-clash.run-low.ok new file mode 100644 index 00000000000..e5371865582 --- /dev/null +++ b/test/fail/ok/decl-clash.run-low.ok @@ -0,0 +1,4 @@ +(unknown location): internal error, Env.Make(X).Clash("test") + +Last environment: + diff --git a/test/fail/ok/decl-clash.run.ok b/test/fail/ok/decl-clash.run.ok new file mode 100644 index 00000000000..e5371865582 --- /dev/null +++ b/test/fail/ok/decl-clash.run.ok @@ -0,0 +1,4 @@ +(unknown location): internal error, Env.Make(X).Clash("test") + +Last environment: + diff --git a/test/fail/ok/decl-clash.tc.ok b/test/fail/ok/decl-clash.tc.ok new file mode 100644 index 00000000000..e5371865582 --- /dev/null +++ b/test/fail/ok/decl-clash.tc.ok @@ -0,0 +1,4 @@ +(unknown location): internal error, Env.Make(X).Clash("test") + +Last environment: + diff --git a/test/fail/ok/decl-clash.wasm.stderr.ok b/test/fail/ok/decl-clash.wasm.stderr.ok new file mode 100644 index 00000000000..e5371865582 --- /dev/null +++ b/test/fail/ok/decl-clash.wasm.stderr.ok @@ -0,0 +1,4 @@ +(unknown location): internal error, Env.Make(X).Clash("test") + +Last environment: + diff --git a/test/run-dfinity/actor-reexport.as b/test/run-dfinity/actor-reexport.as new file mode 100644 index 00000000000..c928d553b44 --- /dev/null +++ b/test/run-dfinity/actor-reexport.as @@ -0,0 +1,21 @@ +actor test { + exported() { + print("exported()\n"); + }; + let exported_too = exported; +}; + +actor test2 { + let exported_three = test.exported_too; + let (exported_four, exported_five) = + if (true) + (test.exported_too, test.exported_too) + else + (exported_three, exported_three) +}; + +test.exported(); +test.exported_too(); +test2.exported_three(); +test2.exported_four(); +test2.exported_five(); diff --git a/test/run-dfinity/ok/actor-reexport.diff-ir.ok b/test/run-dfinity/ok/actor-reexport.diff-ir.ok new file mode 100644 index 00000000000..a7ecec4b432 --- /dev/null +++ b/test/run-dfinity/ok/actor-reexport.diff-ir.ok @@ -0,0 +1,12 @@ +--- actor-reexport.run ++++ actor-reexport.run-ir +@@ -1,5 +1,4 @@ +-exported() +-exported() +-exported() +-exported() +-exported() ++(unknown location): internal error, Failure("pattern bindings not yet supported in objects") ++ ++Last environment: ++ diff --git a/test/run-dfinity/ok/actor-reexport.run-ir.ok b/test/run-dfinity/ok/actor-reexport.run-ir.ok new file mode 100644 index 00000000000..e96bfdfd541 --- /dev/null +++ b/test/run-dfinity/ok/actor-reexport.run-ir.ok @@ -0,0 +1,4 @@ +(unknown location): internal error, Failure("pattern bindings not yet supported in objects") + +Last environment: + diff --git a/test/run-dfinity/ok/actor-reexport.run-low.ok b/test/run-dfinity/ok/actor-reexport.run-low.ok new file mode 100644 index 00000000000..2fcbd2537a1 --- /dev/null +++ b/test/run-dfinity/ok/actor-reexport.run-low.ok @@ -0,0 +1,5 @@ +exported() +exported() +exported() +exported() +exported() diff --git a/test/run-dfinity/ok/actor-reexport.run.ok b/test/run-dfinity/ok/actor-reexport.run.ok new file mode 100644 index 00000000000..2fcbd2537a1 --- /dev/null +++ b/test/run-dfinity/ok/actor-reexport.run.ok @@ -0,0 +1,5 @@ +exported() +exported() +exported() +exported() +exported() diff --git a/test/run-dfinity/ok/actor-reexport.wasm.stderr.ok b/test/run-dfinity/ok/actor-reexport.wasm.stderr.ok new file mode 100644 index 00000000000..e96bfdfd541 --- /dev/null +++ b/test/run-dfinity/ok/actor-reexport.wasm.stderr.ok @@ -0,0 +1,4 @@ +(unknown location): internal error, Failure("pattern bindings not yet supported in objects") + +Last environment: + diff --git a/test/run.sh b/test/run.sh index 8a0367fabf1..ea5dba79696 100755 --- a/test/run.sh +++ b/test/run.sh @@ -42,6 +42,19 @@ shift $((OPTIND-1)) failures=no +function normalize () { + if [ -e "$1" ] + then + grep -a -E -v '^Raised by|Raised at|^Re-raised at|^Re-Raised at|^Called from' $1 | + sed 's/\x00//g' | + sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | + sed 's/^.*W, hypervisor:/W, hypervisor:/g' | + sed 's/wasm:0x[a-f0-9]*:/wasm:0x___:/g' | + cat > $1.norm + mv $1.norm $1 + fi +} + for file in "$@"; do if ! [ -r $file ] @@ -72,6 +85,7 @@ do $ECHO -n " [tc]" $ASC $ASC_FLAGS --check $base.as > $out/$base.tc 2>&1 tc_succeeded=$? + normalize $out/$base.tc diff_files="$diff_files $base.tc" if [ "$tc_succeeded" -eq 0 ]; @@ -81,11 +95,13 @@ do # Interpret $ECHO -n " [run]" $ASC $ASC_FLAGS -r $base.as > $out/$base.run 2>&1 + normalize $out/$base.run diff_files="$diff_files $base.run" # Interpret with lowering $ECHO -n " [run-low]" $ASC $ASC_FLAGS -r -a -A $base.as > $out/$base.run-low 2>&1 + normalize $out/$base.run-low diff_files="$diff_files $base.run-low" # Diff interpretations without/with lowering @@ -95,6 +111,7 @@ do # Interpret IR $ECHO -n " [run-ir]" $ASC $ASC_FLAGS -r -iR $base.as > $out/$base.run-ir 2>&1 + normalize $out/$base.run-ir diff_files="$diff_files $base.run-ir" # Diff interpretations without/with lowering @@ -110,7 +127,10 @@ do else $ASC $ASC_FLAGS $EXTRA_ASC_FLAGS --map -c $base.as -o $out/$base.wasm 2> $out/$base.wasm.stderr fi + normalize $out/$base.wasm.stderr diff_files="$diff_files $base.wasm.stderr" + + # Run compiled program if [ -e $out/$base.wasm ] then if [ "$SKIP_RUNNING" != yes ] @@ -119,12 +139,12 @@ do then $ECHO -n " [dvm]" $DVM_WRAPPER $out/$base.wasm > $out/$base.dvm-run 2>&1 + normalize $out/$base.dvm-run diff_files="$diff_files $base.dvm-run" else $ECHO -n " [wasm-run]" $WASM _out/$base.wasm > $out/$base.wasm-run 2>&1 - sed 's/wasm:0x[a-f0-9]*:/wasm:0x___:/g' $out/$base.wasm-run >$out/$base.wasm-run.temp - mv -f $out/$base.wasm-run.temp $out/$base.wasm-run + normalize $out/$base.wasm-run diff_files="$diff_files $base.wasm-run" fi fi @@ -132,19 +152,6 @@ do fi $ECHO "" - # normalize files - for file in $diff_files - do - if [ -e "$out/$file" ] - then - grep -a -E -v '^Raised by|Raised at|^Re-raised at|^Re-Raised at|^Called from' $out/$file | - sed 's/\x00//g' | - sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | - sed 's/^.*W, hypervisor:/W, hypervisor:/g' > $out/$file.norm - mv $out/$file.norm $out/$file - fi - done - if [ $ACCEPT = yes ] then for outfile in $diff_files