summaryrefslogtreecommitdiffstats
path: root/test.sh
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-07-26 22:15:15 +0200
committerLouis Burda <quent.burda@gmail.com>2023-07-26 22:15:15 +0200
commit33995e119a16fbf13c51cf3a72a6cc52d70a75a8 (patch)
tree872cb861564b452468954639851635410d714697 /test.sh
parent0f06ef7127b669207fd8f09b88ecb660b38eb971 (diff)
downloadtis100-33995e119a16fbf13c51cf3a72a6cc52d70a75a8.tar.gz
tis100-33995e119a16fbf13c51cf3a72a6cc52d70a75a8.zip
Add support for multiple input and output ports
Diffstat (limited to 'test.sh')
-rw-r--r--test.sh34
1 files changed, 24 insertions, 10 deletions
diff --git a/test.sh b/test.sh
index ff254af..63ed635 100644
--- a/test.sh
+++ b/test.sh
@@ -1,16 +1,30 @@
-#!/bin/sh
-
+#!/bin/bash
for f in test/*.asm; do
- in="$(echo "$f" | cut -d. -f1).in"
- out="$(echo "$f" | cut -d. -f1).out"
- tmp="/tmp/tis-test.out"
- ./tis100 "$f" "$in" "$tmp"
+ base=$(echo "$f" | cut -d. -f1)
+ args=""
+ for i in $base.in.*; do
+ c=$(echo "$i" | cut -d. -f3)
+ args="$args --in.$c $i"
+ done
+ for i in $base.out.*; do
+ c=$(echo "$i" | cut -d. -f3)
+ args="$args --out.$c /tmp/tis100-test.out.$c"
+ done
+ ./tis100 "$f" $args
if [ $? -ne 0 ]; then
echo "$f"
- elif ! diff "$out" "$tmp"; then
- cat "$tmp" | xxd 1>&2
- cat "$out" | xxd 1>&2
- echo "$f"
+ else
+ bad=0
+ for c in "abcdefghijklmnopqrstuvwyxz"; do
+ out="$base.in.$c"
+ tmp="/tmp/tis100-test.out.$c"
+ if [ -e "$out" -a -e "$tmp" ] && ! diff "$out" "$tmp"; then
+ cat "$tmp" | xxd 1>&2
+ cat "$out" | xxd 1>&2
+ bad=1
+ fi
+ done
+ [ $bad -ne 0 ] && echo "$f"
fi
done