diff --git a/cmd/puffs-c/test.go b/cmd/puffs-c/test.go index eb40542e..c657c0ac 100644 --- a/cmd/puffs-c/test.go +++ b/cmd/puffs-c/test.go @@ -28,7 +28,8 @@ import ( func isStringList(s string) bool { for i := 0; i < len(s); i++ { c := s[i] - if c == ',' || c == '-' || c == '.' || ('0' <= c && c <= '9') || c == '_' || ('a' <= c && c <= 'z') { + if c == ',' || c == '-' || c == '.' || ('0' <= c && c <= '9') || ('A' <= c && c <= 'Z') || + c == '_' || ('a' <= c && c <= 'z') { continue } return false diff --git a/cmd/puffs/test.go b/cmd/puffs/test.go index 4cf8a77f..042e2140 100644 --- a/cmd/puffs/test.go +++ b/cmd/puffs/test.go @@ -26,7 +26,8 @@ import ( func isStringList(s string) bool { for i := 0; i < len(s); i++ { c := s[i] - if c == ',' || c == '-' || c == '.' || ('0' <= c && c <= '9') || c == '_' || ('a' <= c && c <= 'z') { + if c == ',' || c == '-' || c == '.' || ('0' <= c && c <= '9') || ('A' <= c && c <= 'Z') || + c == '_' || ('a' <= c && c <= 'z') { continue } return false diff --git a/test/c/testlib/testlib.c b/test/c/testlib/testlib.c index 2e7bb006..c7b3a847 100644 --- a/test/c/testlib/testlib.c +++ b/test/c/testlib/testlib.c @@ -66,6 +66,17 @@ bool check_focus() { // No-op. Skip empty focus targets, which makes it convenient to // copy/paste a string with a trailing comma. } else { + // Strip a leading "Benchmark", if present, from the [p, q) string. + // Idiomatic C function names look like "test_puffs_gif_lzw_decode_pi" + // and won't start with "Benchmark". Stripping lets us conveniently + // copy/paste a string like "Benchmarkpuffs_gif_decode_10k/gcc" from the + // "puffs bench std/gif" output. + // + // TODO: strip the "/gcc". + if (!strncmp(p, "Benchmark", 9)) { + p += 9; + } + // See if proc_funcname (with or without a "test_" or "bench_" prefix) // starts with the [p, q) string. if (!strncmp(proc_funcname, p, q - p)) {