Skip to content

Commit

Permalink
Putting together rewritten test.py script
Browse files Browse the repository at this point in the history
  • Loading branch information
geky committed Jun 6, 2022
1 parent 92a600a commit 6443693
Show file tree
Hide file tree
Showing 4 changed files with 412 additions and 15 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,15 @@ override DATAFLAGS += -v
override STACKFLAGS += -v
override STRUCTSFLAGS += -v
override COVERAGEFLAGS += -v
override TESTFLAGS_ += -v
override TESTCFLAGS_ += -v
endif
ifdef EXEC
override TESTFLAGS += --exec="$(EXEC)"
override TESTFLAGS_ += --exec="$(EXEC)"
endif
ifdef COVERAGE
override TESTFLAGS += --coverage
override TESTFLAGS_ += --coverage
endif
ifdef BUILDDIR
override TESTFLAGS += --build-dir="$(BUILDDIR:/=)"
Expand All @@ -85,6 +88,8 @@ endif
ifneq ($(OBJDUMP),objdump)
override STRUCTSFLAGS += --objdump-tool="$(OBJDUMP)"
endif
# forward -j flag
override TESTFLAGS_ += $(filter -j%,$(MAKEFLAGS))


# commands
Expand Down Expand Up @@ -115,6 +120,7 @@ test%: tests/test$$(firstword $$(subst \#, ,%)).toml

.PHONY: test_
test_: $(BUILDDIR)runners/test_runner
./scripts/test_.py --runner=$< $(TESTFLAGS_)

.PHONY: code
code: $(OBJ)
Expand Down Expand Up @@ -185,10 +191,10 @@ $(BUILDDIR)%.a.c: $(BUILDDIR)%.c
./scripts/explode_asserts.py $< -o $@

$(BUILDDIR)%.t.c: %.toml
./scripts/test_.py -c $< -o $@
./scripts/test_.py -c $< $(TESTCFLAGS_) -o $@

$(BUILDDIR)%.t.c: %.c $(TESTS)
./scripts/test_.py -c $(TESTS) -s $< -o $@
./scripts/test_.py -c $(TESTS) -s $< $(TESTCFLAGS_) -o $@

# clean everything
.PHONY: clean
Expand Down
6 changes: 2 additions & 4 deletions runners/test_runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ struct test_geometry {

const struct test_geometry test_geometries[] = {
// Made up geometry that works well for testing
TEST_GEOMETRY("small", 16, 16, 512, (1024*1024)/512),
TEST_GEOMETRY("medium", 16, 16, 4096, (1024*1024)/4096),
TEST_GEOMETRY("big", 16, 16, 32*1024, (1024*1024)/(32*1024)),
TEST_GEOMETRY("test", 16, 16, 512, (1024*1024)/512),
// EEPROM/NVRAM
TEST_GEOMETRY("eeprom", 1, 1, 512, (1024*1024)/512),
// SD/eMMC
Expand Down Expand Up @@ -585,7 +583,7 @@ const char *const help_text[] = {
"Filter by geometry.",
"Filter for normal tests. Can be combined.",
"Filter for reentrant tests. Can be combined.",
"Filter for valgrind tests. Can be combined.",
"Filter for Valgrind tests. Can be combined.",
"Skip the first n tests.",
"Stop after n tests.",
"Only run every n tests, calculated after --skip and --stop.",
Expand Down

0 comments on commit 6443693

Please sign in to comment.