Skip to content

Commit

Permalink
.github/workflows/build.yml: run 'make tests'
Browse files Browse the repository at this point in the history
This enables SHA tests to check if different compilers produce the same
results.

Signed-off-by: Krystian Hebel <[email protected]>
  • Loading branch information
krystian-hebel committed Apr 15, 2024
1 parent 4304942 commit 5163cdc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ jobs:
run: |
make CC=${{matrix.compiler}} BITS=${{matrix.bits}} ${{matrix.lto}}
./extend_skl_only.sh
- name: make tests
run: |
make CC=${{matrix.compiler}} BITS=64 ${{matrix.lto}} tests
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ CFLAGS_TPMLIB := -include boot.h -include errno-base.h -include byteswap.h -DEBA
# Derive AFLAGS from CFLAGS
AFLAGS := -D__ASSEMBLY__ $(filter-out -std=%,$(CFLAGS))

TEST_CFLAGS := $(filter-out -ffreestanding -march% -Werror,$(CFLAGS))
TEST_CFLAGS += -Wno-implicit-function-declaration
TEST_CFLAGS += $(if $(COV),-fprofile-arcs -ftest-coverage)

ALL_SRC := $(wildcard *.c) $(wildcard tpmlib/*.c)
TESTS := $(filter test-%,$(ALL_SRC:.c=))

Expand Down Expand Up @@ -75,9 +79,9 @@ tpmlib/%.o: tpmlib/%.c Makefile
%.S: %.c Makefile
$(CC) $(CFLAGS) -S $< -o $@

# Helpers for building and running tests on the current host
# Helpers for building and running tests on the current host.
test-%: test-%.c Makefile
$(CC) $(filter-out -ffreestanding -march%,$(CFLAGS)) $(if $(COV),-fprofile-arcs -ftest-coverage) $< -o $@
$(CC) $(TEST_CFLAGS) $< -o $@

.PHONY: run-test-%
.SECONDARY:
Expand Down

0 comments on commit 5163cdc

Please sign in to comment.