Skip to content

Commit f36e753

Browse files
committed
ci - update test suite for parity with Ratel
1 parent 84ec3ca commit f36e753

File tree

3 files changed

+282
-82
lines changed

3 files changed

+282
-82
lines changed

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ NPROC_POOL ?= 1
797797
export NPROC_POOL
798798

799799
run-% : $(OBJDIR)/%
800-
@$(PYTHON) tests/junit.py --mode tap --ceed-backends $(BACKENDS) --nproc $(NPROC_TEST) --pool-size $(NPROC_POOL) $(<:$(OBJDIR)/%=%)
800+
@$(PYTHON) tests/junit.py --mode tap --ceed-backends $(BACKENDS) --nproc $(NPROC_TEST) --pool-size $(NPROC_POOL) --search '$(subsearch)' $(<:$(OBJDIR)/%=%)
801801

802802
# The test and prove targets can be controlled via pattern searches. The
803803
# default is to run tests and those examples that have no external dependencies.
@@ -809,6 +809,7 @@ run-% : $(OBJDIR)/%
809809
search ?= t ex
810810
realsearch = $(search:%=%%)
811811
matched = $(foreach pattern,$(realsearch),$(filter $(OBJDIR)/$(pattern),$(tests) $(allexamples)))
812+
subsearch ?= .*
812813
JUNIT_BATCH ?= ''
813814

814815
# Test core libCEED
@@ -823,15 +824,15 @@ ctc-% : $(ctests);@$(foreach tst,$(ctests),$(tst) /cpu/$*;)
823824
# https://testanything.org/tap-specification.html
824825
prove : $(matched)
825826
$(info Testing backends: $(BACKENDS))
826-
$(PROVE) $(PROVE_OPTS) --exec '$(PYTHON) tests/junit.py --mode tap --ceed-backends $(BACKENDS) --nproc $(NPROC_TEST) --pool-size $(NPROC_POOL)' $(matched:$(OBJDIR)/%=%)
827+
$(PROVE) $(PROVE_OPTS) --exec '$(PYTHON) tests/junit.py' $(matched:$(OBJDIR)/%=%) :: --mode tap --ceed-backends $(BACKENDS) --nproc $(NPROC_TEST) --pool-size $(NPROC_POOL) --search '$(subsearch)'
827828
# Run prove target in parallel
828829
prv : ;@$(MAKE) $(MFLAGS) V=$(V) prove
829830

830831
prove-all :
831832
+$(MAKE) prove realsearch=%
832833

833834
junit-% : $(OBJDIR)/%
834-
@printf " %10s %s\n" TEST $(<:$(OBJDIR)/%=%); $(PYTHON) tests/junit.py --ceed-backends $(BACKENDS) --nproc $(NPROC_TEST) --pool-size $(NPROC_POOL) --junit-batch $(JUNIT_BATCH) $(<:$(OBJDIR)/%=%)
835+
@printf " %10s %s\n" TEST $(<:$(OBJDIR)/%=%); $(PYTHON) tests/junit.py --ceed-backends $(BACKENDS) --nproc $(NPROC_TEST) --pool-size $(NPROC_POOL) --search '$(subsearch)' --junit-batch $(JUNIT_BATCH) $(<:$(OBJDIR)/%=%)
835836

836837
junit : $(matched:$(OBJDIR)/%=junit-%)
837838

tests/junit.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ def create_argparser() -> argparse.ArgumentParser:
2727
parser.add_argument('-o', '--output', type=Optional[Path], default=None, help='Output file to write test')
2828
parser.add_argument('-b', '--junit-batch', type=str, default='', help='Name of JUnit batch for output file')
2929
parser.add_argument('-np', '--pool-size', type=int, default=1, help='Number of test cases to run in parallel')
30+
parser.add_argument('-s', '--search', type=str, default='.*',
31+
help='Search string to filter tests, using `re` package format')
32+
parser.add_argument('-v', '--verbose', action='store_true', default=False,
33+
help='print details for all runs, not just failures')
3034
parser.add_argument('test', help='Test executable', nargs='?')
3135

3236
return parser
@@ -201,7 +205,9 @@ def check_allowed_stdout(self, test: str) -> bool:
201205
args.mode,
202206
args.nproc,
203207
CeedSuiteSpec(),
204-
args.pool_size)
208+
args.pool_size,
209+
search=args.search,
210+
verbose=args.verbose)
205211

206212
# write output and check for failures
207213
if args.mode is RunMode.JUNIT:

0 commit comments

Comments
 (0)