In test/bench.py, added "internal" flag

This marks internal tests/benches (case.in="lfs.c") with an otherwise-unused
flag that is printed during --summary/--list-*. This just helps identify which
tests/benches are internal.
This commit is contained in:
Christopher Haster
2023-06-01 17:13:51 -05:00
parent 82027f3d90
commit 07244fb2d4
6 changed files with 35 additions and 15 deletions
+6 -6
View File
@@ -884,8 +884,8 @@ static void summary(void) {
sprintf(perm_buf, "%zu/%zu", perms.filtered, perms.total);
char flag_buf[64];
sprintf(flag_buf, "%s%s",
(flags & BENCH_REENTRANT) ? "r" : "",
(!flags) ? "-" : "");
(flags & BENCH_INTERNAL) ? "i" : "",
(!flags) ? "-" : "");
printf("%-23s %7s %7zu %7zu %11s\n",
"TOTAL",
flag_buf,
@@ -943,8 +943,8 @@ static void list_suites(void) {
sprintf(perm_buf, "%zu/%zu", perms.filtered, perms.total);
char flag_buf[64];
sprintf(flag_buf, "%s%s",
(bench_suites[i].flags & BENCH_REENTRANT) ? "r" : "",
(!bench_suites[i].flags) ? "-" : "");
(bench_suites[i].flags & BENCH_INTERNAL) ? "i" : "",
(!bench_suites[i].flags) ? "-" : "");
printf("%-*s %7s %7zu %11s\n",
name_width,
bench_suites[i].name,
@@ -996,8 +996,8 @@ static void list_cases(void) {
sprintf(perm_buf, "%zu/%zu", perms.filtered, perms.total);
char flag_buf[64];
sprintf(flag_buf, "%s%s",
(bench_suites[i].cases[j].flags & BENCH_REENTRANT)
? "r" : "",
(bench_suites[i].cases[j].flags & BENCH_INTERNAL)
? "i" : "",
(!bench_suites[i].cases[j].flags)
? "-" : "");
printf("%-*s %7s %11s\n",
+1 -1
View File
@@ -40,7 +40,7 @@ void bench_stop(void);
struct lfs_config;
enum bench_flags {
BENCH_REENTRANT = 0x1,
BENCH_INTERNAL = 0x1,
};
typedef uint8_t bench_flags_t;
+9 -5
View File
@@ -912,9 +912,10 @@ static void summary(void) {
char perm_buf[64];
sprintf(perm_buf, "%zu/%zu", perms.filtered, perms.total);
char flag_buf[64];
sprintf(flag_buf, "%s%s",
sprintf(flag_buf, "%s%s%s",
(flags & TEST_REENTRANT) ? "r" : "",
(!flags) ? "-" : "");
(flags & TEST_INTERNAL) ? "i" : "",
(!flags) ? "-" : "");
printf("%-23s %7s %7zu %7zu %11s\n",
"TOTAL",
flag_buf,
@@ -973,9 +974,10 @@ static void list_suites(void) {
char perm_buf[64];
sprintf(perm_buf, "%zu/%zu", perms.filtered, perms.total);
char flag_buf[64];
sprintf(flag_buf, "%s%s",
sprintf(flag_buf, "%s%s%s",
(test_suites[i].flags & TEST_REENTRANT) ? "r" : "",
(!test_suites[i].flags) ? "-" : "");
(test_suites[i].flags & TEST_INTERNAL) ? "i" : "",
(!test_suites[i].flags) ? "-" : "");
printf("%-*s %7s %7zu %11s\n",
name_width,
test_suites[i].name,
@@ -1028,9 +1030,11 @@ static void list_cases(void) {
char perm_buf[64];
sprintf(perm_buf, "%zu/%zu", perms.filtered, perms.total);
char flag_buf[64];
sprintf(flag_buf, "%s%s",
sprintf(flag_buf, "%s%s%s",
(test_suites[i].cases[j].flags & TEST_REENTRANT)
? "r" : "",
(test_suites[i].cases[j].flags & TEST_INTERNAL)
? "i" : "",
(!test_suites[i].cases[j].flags)
? "-" : "");
printf("%-*s %7s %11s\n",
+2 -1
View File
@@ -33,7 +33,8 @@ void test_trace(const char *fmt, ...);
struct lfs_config;
enum test_flags {
TEST_REENTRANT = 0x1,
TEST_INTERNAL = 0x1,
TEST_REENTRANT = 0x2,
};
typedef uint8_t test_flags_t;