Skip to content

Commit 3a0f2c1

Browse files
authored
Merge pull request #8856 from tautschnig/parallel-test
2 parents d95adee + d9c842e commit 3a0f2c1

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

.github/workflows/pull-request-checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ jobs:
921921
make CXX=clcache BUILD_ENV=MSVC -C unit test TAGS="[z3]"
922922
make CXX=clcache BUILD_ENV=MSVC -C jbmc/unit test
923923
- name: Run CBMC regression tests
924-
run: make CXX=clcache BUILD_ENV=MSVC -C regression test
924+
run: make CXX=clcache BUILD_ENV=MSVC -j${{env.windows-vcpus}} -C regression test-parallel-jobs
925925

926926
# This job takes approximately 7 to 32 minutes
927927
windows-msi-package:

jbmc/regression/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ test-parallel:
4242
$(MAKE) "{}" \
4343
::: $(DIRS)
4444

45+
# Run all test directories in parallel when invoked with make -j<N>
46+
# (no GNU Parallel needed).
47+
# Example: make -j8 test-parallel-jobs
48+
# Without -j, the directories will run sequentially.
49+
PARALLEL_DIRS = $(addprefix parallel__,$(DIRS))
50+
.PHONY: mvn-package test-parallel-jobs $(PARALLEL_DIRS)
51+
mvn-package:
52+
mvn --quiet clean package -T1C
53+
test-parallel-jobs: $(PARALLEL_DIRS)
54+
$(PARALLEL_DIRS): parallel__%: mvn-package
55+
@echo "Running $*..."
56+
$(MAKE) -C "$*" test
57+
4558

4659
.PHONY: clean
4760
clean:

regression/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@ test-parallel:
112112
$(MAKE) "{}" \
113113
::: $(DIRS)
114114

115+
# Run all test directories in parallel when invoked with make -j<N>
116+
# (no GNU Parallel needed).
117+
# Example: make -j8 test-parallel-jobs
118+
# Without -j, the directories will run sequentially.
119+
PARALLEL_DIRS = $(addprefix parallel__,$(DIRS))
120+
.PHONY: test-parallel-jobs $(PARALLEL_DIRS)
121+
test-parallel-jobs: $(PARALLEL_DIRS)
122+
$(PARALLEL_DIRS): parallel__%:
123+
@echo "Running $*..."
124+
$(MAKE) -C "$*" test
125+
115126

116127
.PHONY: clean
117128
clean:

0 commit comments

Comments
 (0)