From 0cba6885fa150e934903c80329d4b08666be3dfa Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Fri, 30 Jun 2017 08:50:12 +1000 Subject: [PATCH] Spell the "-b" flag fully, as "-bench". --- cmd/puffs-test-c/main.go | 4 ++-- cmd/puffs/test.go | 2 +- test/c/testlib/testlib.c | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/puffs-test-c/main.go b/cmd/puffs-test-c/main.go index fbd9652a..5dc43256 100644 --- a/cmd/puffs-test-c/main.go +++ b/cmd/puffs-test-c/main.go @@ -14,7 +14,7 @@ import ( ) var ( - bench = flag.Bool("b", false, "whether to run benchmarks instead of regular tests") + bench = flag.Bool("bench", false, "whether to run benchmarks instead of regular tests") ) func main() { @@ -68,7 +68,7 @@ func do(filename string) (failed bool, err error) { outArgs := []string(nil) if *bench { - outArgs = append(outArgs, "-b") + outArgs = append(outArgs, "-bench") } outCmd := exec.Command(out, outArgs...) outCmd.Stdout = os.Stdout diff --git a/cmd/puffs/test.go b/cmd/puffs/test.go index f83404bb..9e5c2600 100644 --- a/cmd/puffs/test.go +++ b/cmd/puffs/test.go @@ -89,7 +89,7 @@ func benchTestDir(puffsRoot string, dirname string, langs []string, bench bool) command := "puffs-test-" + lang args := []string(nil) if bench { - args = append(args, "-b") + args = append(args, "-bench") } args = append(args, filepath.Join(puffsRoot, "test", lang, filepath.FromSlash(dirname))) cmd := exec.Command(command, args...) diff --git a/test/c/testlib/testlib.c b/test/c/testlib/testlib.c index 708c5ef9..aa88aa36 100644 --- a/test/c/testlib/testlib.c +++ b/test/c/testlib/testlib.c @@ -66,8 +66,11 @@ int main(int argc, char** argv) { bool bench = false; int i; for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "-b")) { + if (!strcmp(argv[i], "-bench")) { bench = true; + } else { + fprintf(stderr, "unknown flag \"%s\"\n", argv[i]); + return 1; } }