Skip to content

Commit 67dde1f

Browse files
committed
Problem: number of tests might not be accurate
Solution: class might not have selftest or can be draft and the build is stable. So count the number of tests from test array and report real number.
1 parent 1158379 commit 67dde1f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

zproject_class.gsl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,18 @@ test_list (void)
300300
);
301301
}
302302

303+
static void
304+
test_number (void)
305+
{
306+
int n = 0;
307+
test_item_t *item;
308+
for (item = all_tests; item->testname; item++) {
309+
if (! streq (item->testname, "private_classes"))
310+
n++;
311+
}
312+
printf ("%d\\n", n);
313+
}
314+
303315
int
304316
main (int argc, char **argv)
305317
{
@@ -323,7 +335,7 @@ main (int argc, char **argv)
323335
else
324336
if (streq (argv [argn], "--number")
325337
|| streq (argv [argn], "-n")) {
326-
puts ("$(count (project.class))");
338+
test_number ();
327339
return 0;
328340
}
329341
else

0 commit comments

Comments
 (0)