diff --git a/Makefile b/Makefile index b20be8ca..dfad1d3d 100644 --- a/Makefile +++ b/Makefile @@ -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: