about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-07-03 23:39:51 -0700
committerKartik Agaram <vc@akkartik.com>2019-07-03 23:51:33 -0700
commit85cc81a5fb7a7faa7eb40a141d9ed7e840b3f24a (patch)
treeb77ba26cd4576b63675b09f6210fa2ae545521f5 /subx
parentd818fdd7e52616adf293061ccbb42517d0e6f98f (diff)
downloadmu-85cc81a5fb7a7faa7eb40a141d9ed7e840b3f24a.tar.gz
.
Revert a bad merge.
Diffstat (limited to 'subx')
-rwxr-xr-xsubx/run_one_test.sh16
1 files changed, 6 insertions, 10 deletions
diff --git a/subx/run_one_test.sh b/subx/run_one_test.sh
index 7ac3e5d0..caecd63c 100755
--- a/subx/run_one_test.sh
+++ b/subx/run_one_test.sh
@@ -4,9 +4,10 @@
 
 if [[ $2 == 'test-'* ]]
 then
-  export TEST_NAME=$2
-  echo $TEST_NAME > /tmp/last_test_run
-elif [[ -e /tmp/last_test_run ]]
+  TEST_NAME=$2 envsubst '$TEST_NAME' < run_one_test.subx > /tmp/run_one_test.subx
+  FILES=$(ls [0-9]*.subx apps/subx-common.subx $1 |sort |uniq)
+  echo $FILES > /tmp/last_run_files
+elif [[ -e /tmp/last_run_files ]]
 then
   FILES=`cat /tmp/last_run_files`
 else
@@ -15,12 +16,7 @@ else
 fi
 
 set -e
-if [[ $1 == */* ]]
-then
-  CFLAGS=$CFLAGS ./subx --debug translate [0-9]*.subx  apps/subx-common.subx $1 /tmp/run_one_test.subx -o /tmp/a.elf
-else
-  # don't mention files twice
-  CFLAGS=$CFLAGS ./subx --debug translate [0-9]*.subx apps/subx-common.subx    /tmp/run_one_test.subx -o /tmp/a.elf
-fi
+                                      # turn newlines into spaces
+CFLAGS=$CFLAGS ./subx --debug translate $(echo $FILES) /tmp/run_one_test.subx -o /tmp/a.elf
 
 ./subx --debug --trace run /tmp/a.elf