mu/run_one_test
Kartik Agaram d260b01748 6200 - --dump is not needed for incremental traces
This undoes commit 5764, which was ill-considered. We already had incremental
prints at that point to 'last_run'. As long as we don't run out of RAM
on large traces, there doesn't seem any need to print to stderr.

Now '--dump' is only needed when juggling multiple traces.
2020-04-09 00:56:32 -07:00

25 lines
774 B
Bash
Executable File

#!/usr/bin/env zsh
# Either run the test with the given name, or rerun the most recently run test.
# Intended to be called from within Vim. Check out the vimrc.vim file.
# Unfortunately this only works with Linux at the moment. Some compiler passes
# take too long to run in emulated mode.
if [[ $2 == 'test-'* ]]
then
TEST_NAME=$2 envsubst '$TEST_NAME' < run_one_test.subx > /tmp/run_one_test.subx
FILES=$(ls [0-9]*.subx apps/subx-params.subx $1 |sort |uniq)
echo $FILES > /tmp/last_run_files
elif [[ -e /tmp/last_run_files ]]
then
FILES=$(cat /tmp/last_run_files)
else
echo "no test found"
exit 0 # don't open trace
fi
set -e
./translate_subx_debug init.linux $(echo $FILES) /tmp/run_one_test.subx
echo running
CFLAGS=$CFLAGS ./bootstrap --trace run a.elf