2019-06-12 05:50:40 +00:00
|
|
|
#!/usr/bin/env zsh
|
2019-06-12 06:51:00 +00:00
|
|
|
# Either run the test with the given name, or rerun the most recently run test.
|
2019-06-12 06:54:05 +00:00
|
|
|
# Intended to be called from within Vim. Check out the vimrc.vim file.
|
2019-09-05 00:35:37 +00:00
|
|
|
# Unfortunately this only works with Linux at the moment. Some compiler passes
|
|
|
|
# take too long to run in emulated mode.
|
2019-06-12 06:51:00 +00:00
|
|
|
|
|
|
|
if [[ $2 == 'test-'* ]]
|
|
|
|
then
|
2019-07-04 06:39:51 +00:00
|
|
|
TEST_NAME=$2 envsubst '$TEST_NAME' < run_one_test.subx > /tmp/run_one_test.subx
|
2019-09-20 04:01:43 +00:00
|
|
|
FILES=$(ls [0-9]*.subx apps/subx-params.subx $1 |sort |uniq)
|
2019-07-04 06:39:51 +00:00
|
|
|
echo $FILES > /tmp/last_run_files
|
|
|
|
elif [[ -e /tmp/last_run_files ]]
|
2019-06-12 06:51:00 +00:00
|
|
|
then
|
2019-08-25 21:56:20 +00:00
|
|
|
FILES=$(cat /tmp/last_run_files)
|
2019-06-30 04:02:11 +00:00
|
|
|
else
|
2019-06-12 06:51:00 +00:00
|
|
|
echo "no test found"
|
|
|
|
exit 0 # don't open trace
|
|
|
|
fi
|
2019-06-12 05:50:40 +00:00
|
|
|
|
2019-06-17 07:23:57 +00:00
|
|
|
set -e
|
2019-06-12 07:14:21 +00:00
|
|
|
|
2020-01-10 04:53:02 +00:00
|
|
|
./translate_subx_debug init.linux $(echo $FILES) /tmp/run_one_test.subx
|
2020-04-09 07:45:36 +00:00
|
|
|
echo running
|
|
|
|
CFLAGS=$CFLAGS ./bootstrap --trace run a.elf
|