scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit fa0027223d9664bec5f475be753b5f6258584cb5
parent 8b96dd8a8d2e271d27d9407d4e847f1d3f194e13
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat,  3 Oct 2015 12:06:01 +0200

Add optional parameter to update.sh

This tool is good when you want to update only one test,
so the previous behaviour of updating all the tests
was not always the desired result.

Diffstat:
Mcc1/tests/update.sh | 24+++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/cc1/tests/update.sh b/cc1/tests/update.sh @@ -1,8 +1,26 @@ #!/bin/sh +update() +{ + (echo '/^output/+;/^\*\//-c' + ../cc1 -I./ -w $1 2>&1 + printf ".\nw\n") | ed -s $1 +} + + +case $# in +1) + update $1 + exit + ;; +*) + echo "usage: update.sh [test]" >&2 + exit 1 + ;; +esac + + for i in *.c do - (echo '/^output/+;/^\*\//-c' - ../cc1 -w $i 2>&1 - printf ".\nw\n") | ed -s $i + update $i done