Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/fail/decl-clash.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let test = ();
let test = ();
4 changes: 4 additions & 0 deletions test/fail/ok/decl-clash.run-ir.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(unknown location): internal error, Env.Make(X).Clash("test")

Last environment:

4 changes: 4 additions & 0 deletions test/fail/ok/decl-clash.run-low.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(unknown location): internal error, Env.Make(X).Clash("test")

Last environment:

4 changes: 4 additions & 0 deletions test/fail/ok/decl-clash.run.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(unknown location): internal error, Env.Make(X).Clash("test")

Last environment:

4 changes: 4 additions & 0 deletions test/fail/ok/decl-clash.tc.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(unknown location): internal error, Env.Make(X).Clash("test")

Last environment:

4 changes: 4 additions & 0 deletions test/fail/ok/decl-clash.wasm.stderr.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(unknown location): internal error, Env.Make(X).Clash("test")

Last environment:

21 changes: 21 additions & 0 deletions test/run-dfinity/actor-reexport.as
Original file line number Diff line number Diff line change
@@ -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();
12 changes: 12 additions & 0 deletions test/run-dfinity/ok/actor-reexport.diff-ir.ok
Original file line number Diff line number Diff line change
@@ -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:
+
4 changes: 4 additions & 0 deletions test/run-dfinity/ok/actor-reexport.run-ir.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(unknown location): internal error, Failure("pattern bindings not yet supported in objects")

Last environment:

5 changes: 5 additions & 0 deletions test/run-dfinity/ok/actor-reexport.run-low.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
exported()
exported()
exported()
exported()
exported()
5 changes: 5 additions & 0 deletions test/run-dfinity/ok/actor-reexport.run.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
exported()
exported()
exported()
exported()
exported()
4 changes: 4 additions & 0 deletions test/run-dfinity/ok/actor-reexport.wasm.stderr.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(unknown location): internal error, Failure("pattern bindings not yet supported in objects")

Last environment:

37 changes: 22 additions & 15 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down Expand Up @@ -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 ];
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 ]
Expand All @@ -119,32 +139,19 @@ 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
fi
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
Expand Down