ref: fa0027223d9664bec5f475be753b5f6258584cb5
parent: 8b96dd8a8d2e271d27d9407d4e847f1d3f194e13
author: Roberto E. Vargas Caballero <[email protected]>
date: Sat Oct 3 08:06:01 EDT 2015
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.
--- 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