diff options
author | Christopher Haster <chaster@utexas.edu> | 2020-01-27 06:37:49 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2020-01-27 19:16:29 +0300 |
commit | aab6aa0ed939303d7788e21bb547eb0a386636fb (patch) | |
tree | 2b4051471559e604b9f2db956a33ab361c3f8f46 /Makefile | |
parent | 52ef0c1c9efac025b71f2bf3d33e8785538e88c7 (diff) |
Cleaned up test script and directory naming
- Removed old tests and test scripts
- Reorganize the block devices to live under one directory
- Plugged new test framework into Makefile
renamed:
- scripts/test_.py -> scripts/test.py
- tests_ -> tests
- {file,ram,test}bd/* -> bd/*
It took a surprising amount of effort to make the Makefile behave since
it turns out the "test_%" rule could override "tests/test_%.toml.test"
which is generated as part of test.py.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 46 |
1 files changed, 11 insertions, 35 deletions
@@ -7,15 +7,11 @@ CC ?= gcc AR ?= ar SIZE ?= size -SRC += $(wildcard *.c rambd/*.c filebd/*.c testbd/*.c) +SRC += $(wildcard *.c bd/*.c) OBJ := $(SRC:.c=.o) DEP := $(SRC:.c=.d) ASM := $(SRC:.c=.s) -TEST := $(patsubst tests/%.sh,%,$(wildcard tests/test_*)) - -SHELL = /bin/bash -o pipefail - ifdef DEBUG override CFLAGS += -O0 -g3 else @@ -33,6 +29,10 @@ override CFLAGS += -Wextra -Wshadow -Wjump-misses-init -Wundef # Remove missing-field-initializers because of GCC bug override CFLAGS += -Wno-missing-field-initializers +ifdef VERBOSE +override TFLAGS += -v +endif + all: $(TARGET) @@ -41,38 +41,14 @@ asm: $(ASM) size: $(OBJ) $(SIZE) -t $^ -.SUFFIXES: -test: \ - test_format \ - test_dirs \ - test_files \ - test_seek \ - test_truncate \ - test_entries \ - test_interspersed \ - test_alloc \ - test_paths \ - test_attrs \ - test_move \ - test_orphan \ - test_relocations \ - test_corrupt - @rm test.c -test_%: tests/test_%.sh -ifdef QUIET - @./$< | sed -nu '/^[-=]/p' -else - ./$< -endif - -test_: - ./scripts/test_.py $(TFLAGS) +test: + ./scripts/test.py $(TFLAGS) +.SECONDEXPANSION: +test%: tests/test$$(firstword $$(subst \#, ,%)).toml + ./scripts/test.py $(TFLAGS) $@ -include $(DEP) -%?: - @echo '$($*)' - lfs: $(OBJ) $(CC) $(CFLAGS) $^ $(LFLAGS) -o $@ @@ -90,4 +66,4 @@ clean: rm -f $(OBJ) rm -f $(DEP) rm -f $(ASM) - rm -f tests_/test_*.toml.* + rm -f tests/*.toml.* |