Skip to content

Commit 35788f4

Browse files
committed
Problem: Private class self tests hidden by public test failures
Solution: Shuffle the test order, so private classes are tested first. Assumption is that they are the internal implementation detail, and if they fail their selftests in a new iteration, the public classes would also fail for these reason (but without delivering the real cause of failure so clearly, being higher-level consumers). Signed-off-by: Jim Klimov <[email protected]> Asked-for-by: Jiri Kukacka <[email protected]>
1 parent 25e6b12 commit 35788f4

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

zproject_class.gsl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -247,22 +247,6 @@ typedef struct {
247247

248248
static test_item_t
249249
all_tests [] = {
250-
.for class where !draft & selftest & private ?<> 1
251-
. if first ()
252-
// Tests for stable public classes:
253-
. endif
254-
{ "$(class.c_name)", $(class.c_name)_test, true, true, NULL },
255-
.endfor
256-
.for class where draft & selftest & private ?<> 1
257-
. if first ()
258-
#ifdef $(PROJECT.PREFIX)_BUILD_DRAFT_API
259-
// Tests for draft public classes:
260-
. endif
261-
{ "$(class.c_name)", $(class.c_name)_test, false, true, NULL },
262-
. if last ()
263-
#endif // $(PROJECT.PREFIX)_BUILD_DRAFT_API
264-
. endif
265-
.endfor
266250
.for class where selftest & private ?= 1
267251
. if first ()
268252
#ifdef $(PROJECT.PREFIX)_BUILD_DRAFT_API
@@ -278,6 +262,22 @@ all_tests [] = {
278262
{ "private_classes", NULL, false, false, "$ALL" }, // compat option for older projects
279263
#endif // $(PROJECT.PREFIX)_BUILD_DRAFT_API
280264
. endif
265+
.endfor
266+
.for class where !draft & selftest & private ?<> 1
267+
. if first ()
268+
// Tests for stable public classes:
269+
. endif
270+
{ "$(class.c_name)", $(class.c_name)_test, true, true, NULL },
271+
.endfor
272+
.for class where draft & selftest & private ?<> 1
273+
. if first ()
274+
#ifdef $(PROJECT.PREFIX)_BUILD_DRAFT_API
275+
// Tests for draft public classes:
276+
. endif
277+
{ "$(class.c_name)", $(class.c_name)_test, false, true, NULL },
278+
. if last ()
279+
#endif // $(PROJECT.PREFIX)_BUILD_DRAFT_API
280+
. endif
281281
.endfor
282282
{NULL, NULL, 0, 0, NULL} // Sentinel
283283
};

0 commit comments

Comments
 (0)