summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2021-02-22 14:43:59 +0100
committerNora Widdecke <nora@sequoia-pgp.org>2021-04-13 12:38:16 +0200
commita167dac4fb390a82001d670f1b0a886df7b7fa51 (patch)
tree99d554454eaef483cd13b72fa45e479b6f13021b
parent5b31c8bbf2dd0e0971fc22a8c21a6578a0c47fbf (diff)
bench, ci: Run benchmark functions as tests.
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 3989d4f4..d8b22848 100644
--- a/Makefile
+++ b/Makefile
@@ -69,6 +69,12 @@ build:
.PHONY: test check
test check:
CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) $(CARGO) test $(CARGO_FLAGS) $(CARGO_PACKAGES) $(CARGO_TEST_ARGS)
+ if echo "$(CARGO_TEST_ARGS)" | grep -q -e '--benches'; \
+ then \
+ echo 'Already tested the benchmarks.'; \
+ else \
+ CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) $(CARGO) test $(CARGO_FLAGS) $(CARGO_PACKAGES) --benches; \
+ fi
if echo "$(CARGO_PACKAGES)" | grep -q -E -e '(^| )[-]p +.'; \
then \
echo 'WARNING: Not running other tests, because $$CARGO_PACKAGES specifies a package.'; \