tis100

Reimplementation of Zachtronics TIS-100 as a TUI game
git clone https://git.sinitax.com/sinitax/tis100
Log | Files | Refs | sfeed.txt

test.sh (625B)


      1#!/bin/bash
      2
      3for f in test/*.asm; do
      4	base=$(echo "$f" | cut -d. -f1)
      5	args=""
      6	for i in $base.in.*; do
      7		c=$(echo "$i" | cut -d. -f3)
      8		args="$args --in.$c $i"
      9	done
     10	for i in $base.out.*; do
     11		c=$(echo "$i" | cut -d. -f3)
     12		args="$args --out.$c /tmp/tis100-test.out.$c"
     13	done
     14	./tis100 "$f" $args
     15	if [ $? -ne 0 ]; then
     16		echo "$f"
     17	else
     18		bad=0
     19		for c in "abcdefghijklmnopqrstuvwyxz"; do
     20			out="$base.in.$c"
     21			tmp="/tmp/tis100-test.out.$c"
     22			if [ -e "$out" -a -e "$tmp" ] && ! diff "$out" "$tmp"; then
     23				cat "$tmp" | xxd 1>&2
     24				cat "$out" | xxd 1>&2
     25				bad=1
     26			fi
     27		done
     28		[ $bad -ne 0 ] && echo "$f"
     29	fi
     30done
     31: