Add support for multiprocessing for the tests.

This commit is contained in:
Tom Alexander 2023-04-19 16:35:26 -04:00
parent 2a04455955
commit 7c64be3f51
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 9 additions and 3 deletions

View File

@ -4,6 +4,12 @@ SHELL := bash
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
TESTJOBS := 4
OS:=$(shell uname -s)
ifeq ($(OS),Linux)
TESTJOBS:=$(shell nproc)
endif
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
@ -24,15 +30,15 @@ clean:
.PHONY: test
test:
> cargo test --lib --test test_loader
> cargo test --lib --test test_loader -- --test-threads $(TESTJOBS)
.PHONY: integrationtest
integrationtest:
> cargo test --no-fail-fast --test test_loader
> cargo test --no-fail-fast --test test_loader -- --test-threads $(TESTJOBS)
.PHONY: unittest
unittest:
> cargo test --lib
> cargo test --lib -- --test-threads $(TESTJOBS)
.PHONY: run
run: