From a9abb9fa5b9124174e9a7ddeec95c8323f4b16af Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 20 Aug 2023 23:37:08 +0200 Subject: Split build and run Both in the CI, and in the Makefile --- .github/workflows/coverage.yaml | 2 +- .github/workflows/testsuite.yaml | 10 ++++++++-- tests/Makefile | 10 ++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index eaf5a87..28a2cd6 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -39,7 +39,7 @@ jobs: - name: Installing lcov run: sudo apt install lcov - name: Running the testsuite - run: make -C tests clean coverage + run: make -C tests clean coverage run - name: Setup Pages uses: actions/configure-pages@v3 - name: Upload artifact diff --git a/.github/workflows/testsuite.yaml b/.github/workflows/testsuite.yaml index 9588cb8..c2ca309 100644 --- a/.github/workflows/testsuite.yaml +++ b/.github/workflows/testsuite.yaml @@ -30,9 +30,12 @@ jobs: run: | sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.version }} 100 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} 100 + - name: Build + shell: bash + run: make -C tests gcc - name: Running the testsuite shell: bash - run: make -C tests gcc | grep -zqv FAIL + run: make -C tests run | grep -zqv FAIL clang: runs-on: ubuntu-latest @@ -58,6 +61,9 @@ jobs: run: | sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{ matrix.version }} 100 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ matrix.version }} 100 + - name: Build + shell: bash + run: make -C tests clang - name: Running the testsuite shell: bash - run: make -C tests clang | grep -zqv FAIL + run: make -C tests run | grep -zqv FAIL diff --git a/tests/Makefile b/tests/Makefile index 8db2853..96dfe2d 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -96,8 +96,7 @@ TARGETS= \ .SILENT: gcc: CC=../x86_64-linux-musl-native/bin/gcc -gcc: GCOV=../x86_64-linux-musl-native/bin/gcov -gcc: clean all +gcc: $(TARGETS) clang: CC=clang clang: GCOV=gcov @@ -105,15 +104,14 @@ clang: CFLAGS+=-I/usr/include/x86_64-linux-musl clang: CFLAGS+=-I../x86_64-linux-musl-native/include/ clang: CFLAGS+=-Ix86_64-linux-musl-native/include/ clang: CFLAGS+=-nostdinc -clang: clean all +clang: $(TARGETS) - -all: $(TARGETS) run +all: gcc coverage: CFLAGS += -fprofile-arcs -ftest-coverage coverage: CC=../x86_64-linux-musl-native/bin/gcc coverage: GCOV=../x86_64-linux-musl-native/bin/gcov -coverage: all +coverage: $(TARGETS) run $(GCOV) *.c lcov --capture --directory . --output-file coverage.info genhtml coverage.info --output-directory coverage -- cgit v1.3