summarylogtreecommitdiffstats
path: root/tests.patch
blob: 46e82c9c803d4a7c5ff63d03cc7a8ba00ab797da (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--- ./tests/wasm/run_wasm_tests.sh	2026-05-21 18:25:25.287077810 -0300
+++ ./tests/wasm/run_wasm_tests.sh	2026-05-21 18:25:25.287077810 -0300
@@ -1,20 +1,20 @@
 #!/bin/bash
 # Automated WASM target test suite
-# Usage: ./tests/wasm/run_wasm_tests.sh
+# Usage: /usr/share/perry/tests/run_wasm_tests.sh
 #
 # Compiles each .ts test file to WASM HTML, then runs it in Node.js
 # and compares output against expected output.
 
 set -e
-PERRY="./target/release/perry"
+PERRY="/usr/bin/perry"
 DIR="$(cd "$(dirname "$0")" && pwd)"
 PASS=0
 FAIL=0
 ERRORS=""
 
 if [ ! -f "$PERRY" ]; then
-  echo "Building perry..."
-  cargo build --release -p perry 2>/dev/null
+  echo "Perry not found!"
+  exit 1
 fi
 
 run_test() {
@@ -88,25 +88,24 @@
       echo "PASS $name"
       PASS=$((PASS + 1))
     else
-      echo "FAIL $name"
-      echo "  expected: $(echo "$expected" | head -3)"
-      echo "  actual:   $(echo "$actual" | head -3)"
+      echo "FAIL $name  (output mismatch)"
+      echo "* Expected:"
+      echo "$expected"
+      echo "* Actual:"
+      echo "$actual"
       FAIL=$((FAIL + 1))
-      ERRORS="$ERRORS\n  $name: output mismatch"
+      ERRORS="$ERRORS\n  $name - Output Mismatch"
     fi
   else
     # No expected file — just check it doesn't crash
     if echo "$actual" | grep -q "WASM_ERROR:"; then
       echo "FAIL $name (runtime error)"
-      echo "  $actual"
+      echo "$actual"
       FAIL=$((FAIL + 1))
-      ERRORS="$ERRORS\n  $name: $actual"
+      ERRORS="$ERRORS\n  $name - Runtime Error"
     else
-      echo "PASS $name (no crash)"
+      echo "PASS $name - No Crash"
       PASS=$((PASS + 1))
-      # Generate expected file
-      echo "$actual" > "$expected_file"
-      echo "  (generated $name.expected)"
     fi
   fi