commit fa0027223d9664bec5f475be753b5f6258584cb5
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Sat Oct 3 12:06:01 2015 +0200
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Sat Oct 3 12:12:46 2015 +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.
diff --git a/cc1/tests/update.sh b/cc1/tests/update.sh
index 780320f..c2c882c 100755
--- 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