mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 08:55:11 +01:00
Make focus's "test_" or "bench_" prefix optional.
This commit is contained in:
1 parent
7e654ba652
commit
c62aa518a5
3 files changed
+16
-2
No files matched your search
+1
-1
@@ -52,7 +52,7 @@ const (
|
|||||||
ccompilersUsage = `comma-separated list of C compilers, e.g. "clang,gcc"`
|
ccompilersUsage = `comma-separated list of C compilers, e.g. "clang,gcc"`
|
||||||
|
|
||||||
focusDefault = ""
|
focusDefault = ""
|
||||||
focusUsage = `comma-separated list of tests or benchmarks (name prefixes) to focus on, e.g. "bench_puffs_gif_decode"`
|
focusUsage = `comma-separated list of tests or benchmarks (name prefixes) to focus on, e.g. "puffs_gif_decode"`
|
||||||
|
|
||||||
mimicDefault = false
|
mimicDefault = false
|
||||||
mimicUsage = `whether to compare Puffs' output with other libraries' output`
|
mimicUsage = `whether to compare Puffs' output with other libraries' output`
|
||||||
|
|||||||
+1
-1
@@ -122,7 +122,7 @@ const (
|
|||||||
ccompilersUsage = `comma-separated list of C compilers, e.g. "clang,gcc"`
|
ccompilersUsage = `comma-separated list of C compilers, e.g. "clang,gcc"`
|
||||||
|
|
||||||
focusDefault = ""
|
focusDefault = ""
|
||||||
focusUsage = `comma-separated list of tests or benchmarks (name prefixes) to focus on, e.g. "bench_puffs_gif_decode"`
|
focusUsage = `comma-separated list of tests or benchmarks (name prefixes) to focus on, e.g. "puffs_gif_decode"`
|
||||||
|
|
||||||
langsDefault = "c"
|
langsDefault = "c"
|
||||||
langsUsage = `comma-separated list of target languages (file extensions), e.g. "c,go,rs"`
|
langsUsage = `comma-separated list of target languages (file extensions), e.g. "c,go,rs"`
|
||||||
|
|||||||
@@ -61,9 +61,23 @@ bool check_focus() {
|
|||||||
while ((*q != ',') && (*q != '\x00')) {
|
while ((*q != ',') && (*q != '\x00')) {
|
||||||
q++;
|
q++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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)) {
|
if (!strncmp(proc_funcname, p, q - p)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
const char* unprefixed_proc_funcname = NULL;
|
||||||
|
if (!strncmp(proc_funcname, "test_", 5)) {
|
||||||
|
unprefixed_proc_funcname = proc_funcname + 5;
|
||||||
|
} else if (!strncmp(proc_funcname, "bench_", 6)) {
|
||||||
|
unprefixed_proc_funcname = proc_funcname + 6;
|
||||||
|
}
|
||||||
|
if (unprefixed_proc_funcname &&
|
||||||
|
!strncmp(unprefixed_proc_funcname, p, q - p)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (*q == '\x00') {
|
if (*q == '\x00') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user