Test multiple C++ standards; move tests to top level
This commit is contained in:
1 parent
403db54664
commit
011460254d
4 files changed
+23
-21
No files matched your search
@@ -1,7 +1,23 @@
|
||||
.PHONY: test
|
||||
test:
|
||||
$(MAKE) -C test
|
||||
# This Makefile is entirely for running unit tests for rcp.h
|
||||
|
||||
INCLUDE := include
|
||||
STANDARDS := 11 14 17 20 23
|
||||
BINARIES := $(addprefix build/tests-, $(STANDARDS))
|
||||
|
||||
.PHONY: all
|
||||
all: $(BINARIES)
|
||||
@for std in $(STANDARDS); do \
|
||||
echo "=== Test C++$$std ==="; \
|
||||
build/tests-$$std; \
|
||||
valgrind --leak-check=full --error-exitcode=1 \
|
||||
--log-file=build/valgrind-$$std.log build/tests-$$std \
|
||||
|| { echo "valgrind failed for C++$$std (see build/valgrind-$$std.log)"; exit 1; }; \
|
||||
done
|
||||
|
||||
build/tests-%: tests.cpp $(INCLUDE)/rcp.h
|
||||
@mkdir -p $(dir $@)
|
||||
$(CXX) -std=c++$* -g -Wall -I$(INCLUDE) -o $@ $<
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(MAKE) -C test clean
|
||||
rm -rf build
|
||||
Reference in new issue
Block a user