summaryrefslogtreecommitdiffstats
path: root/test/ext/Makefile
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2019-11-15 17:29:15 -0500
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2019-12-04 20:20:13 +0000
commitf0797d130f82f751c1657e40e203eeb26f7aa3da (patch)
tree9bdcb2d62a3516c2dbfcf45fc2806f63a4185696 /test/ext/Makefile
parentc9cb8f6d9c6e1f51dfdf3e9f4ba0c9f38d1ca6d6 (diff)
build: fix make test with distributed src
This patch addresses the functionality that is missing for distributed make test source files. In addition it extends the concept of colocating test source code with functional source code (eg. src/vcl/test). It also cleans up deficiencies in the make test makefiles. NOTE: Due to the way sphinx document tools work, all test, all of the make test python code is gathered using soft links into the directory: .../build-root/build-test/src Change summary: - Remove 'make test' help details from main makefile help output to reduce clutter and redundant help output - Move all generated build output to .../build-root/build-test - Move test_vcl.py as first usecase for distributed core feature make test code - Add test-wipe-all target and fix wipe targets to remove all generated files - Fix 'make test-doc' to generate module documentation for all source files - Remove unused targets in test/doc/Makefile - Fix 'make test-shell' - Fix test/ext Makefile to not generate bogus output Type: fix Fixes: a43c93f8554ad7418e31be3791b3fb71232f60ac Change-Id: Icc2ddb81d474081c3ede4548ecd7a0624651f62d Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'test/ext/Makefile')
-rw-r--r--test/ext/Makefile53
1 files changed, 28 insertions, 25 deletions
diff --git a/test/ext/Makefile b/test/ext/Makefile
index 6ec1213d532..cbb706528e2 100644
--- a/test/ext/Makefile
+++ b/test/ext/Makefile
@@ -1,16 +1,8 @@
-VAPI_BINDIR = $(TEST_DIR)/build/vapi_test/
-VAPI_CBIN = $(addprefix $(VAPI_BINDIR), vapi_c_test)
-VAPI_CPPBIN = $(addprefix $(VAPI_BINDIR), vapi_cpp_test)
-VOM_BINDIR = $(TEST_DIR)/build/vom_test/
-VOM_BIN = $(addprefix $(VOM_BINDIR), vom_test)
-
-ifeq ($(filter rhel centos,$(OS_ID)),$(OS_ID))
-VAPI_CPPBIN=
-endif
-
-ifeq ($(filter yes,$(EXTENDED_TESTS)),$(EXTENDED_TESTS))
-VOM_BIN=
-endif
+TEST_EXT_DIR=$(TEST_DIR)/ext
+VAPI_BINDIR = $(TEST_BR)/vapi_test
+VAPI_CBIN = $(addprefix $(VAPI_BINDIR), /vapi_c_test)
+VAPI_CPPBIN = $(addprefix $(VAPI_BINDIR), /vapi_cpp_test)
+VOM_BINDIR = $(TEST_BR)/vom_test
VAPI_LIBS = \
-L$(VPP_INSTALL_PATH)/vpp/lib \
@@ -24,12 +16,10 @@ FLAGS = -g -Wall -lstdc++ -pthread -I$(WS_ROOT)/src -I$(VPP_INSTALL_PATH)/vpp/in
CFLAGS = -std=gnu99 $(FLAGS)
CPPFLAGS = -std=c++11 $(FLAGS) -I$(WS_ROOT)/extras/vom
-all: $(VAPI_CBIN) $(VAPI_CPPBIN) $(VOM_BIN)
-
$(VAPI_BINDIR):
- mkdir -p $(VAPI_BINDIR)
+ @mkdir -p $(VAPI_BINDIR)
-CSRC = vapi_c_test.c
+CSRC = $(TEST_EXT_DIR)/vapi_c_test.c
$(VAPI_BINDIR)/fake.api.vapi.h: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi_c_gen.py | $(VAPI_BINDIR)
$(WS_ROOT)/src/vpp-api/vapi/vapi_c_gen.py --prefix $(VAPI_BINDIR) $<
@@ -37,25 +27,31 @@ $(VAPI_BINDIR)/fake.api.vapi.h: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi_c
$(VAPI_BINDIR)/fake.api.vapi.hpp: fake.api.json $(WS_ROOT)/src/vpp-api/vapi/vapi_cpp_gen.py | $(VAPI_BINDIR)
$(WS_ROOT)/src/vpp-api/vapi/vapi_cpp_gen.py --prefix $(VAPI_BINDIR) $<
-$(VAPI_CBIN): $(CSRC) $(VAPI_BINDIR)/fake.api.vapi.h
+$(VAPI_CBIN): $(VAPI_BINDIR) $(CSRC) $(VAPI_BINDIR)/fake.api.vapi.h
$(CC) -o $@ $(CFLAGS) $(CSRC) $(VAPI_LIBS)
$(VAPI_CBIN).d: $(CSRC) $(VAPI_BINDIR)/fake.api.vapi.h
$(CC) -o $@ $(CFLAGS) -MM -MT '$(VAPI_CBIN)' $(CSRC) > $@
-CPPSRC = vapi_cpp_test.cpp
+ifeq ($(filter rhel centos,$(OS_ID)),$(OS_ID))
+VAPI_CPPBIN=
+else
+CPPSRC = $(TEST_EXT_DIR)/vapi_cpp_test.cpp
-$(VAPI_CPPBIN): $(CPPSRC) $(VAPI_BINDIR)/fake.api.vapi.hpp
+$(VAPI_CPPBIN): $(VAPI_BINDIR) $(CPPSRC) $(VAPI_BINDIR)/fake.api.vapi.hpp
$(CXX) -o $@ $(CPPFLAGS) $(CPPSRC) $(VAPI_LIBS)
$(VAPI_CPPBIN).d: $(CPPSRC) $(VAPI_BINDIR)/fake.api.vapi.hpp
$(CXX) -o $@ $(CPPFLAGS) -MM -MT '$(VAPI_CPPBIN)' $(CPPSRC) > $@
+endif
-VOM_CPPSRC = vom_test.cpp
+ifeq ($(filter yes,$(EXTENDED_TESTS)),$(EXTENDED_TESTS))
+VOM_BIN = $(addprefix $(VOM_BINDIR), /vom_test)
+VOM_CPPSRC = $(TEST_EXT_DIR)/vom_test.cpp
$(VOM_BINDIR):
- mkdir -p $(VOM_BINDIR)
+ @mkdir -p $(VOM_BINDIR)
LIB_VOM = -lvom
VOM_LIBS = \
@@ -77,14 +73,21 @@ $(VOM_BIN): $(VOM_CPPSRC) $(VOM_BINDIR)
$(VOM_BIN).d: $(VOM_CPPSRC) $(VOM_BINDIR)
$(CXX) -o $@ $(VOM_CPPFLAGS) -MM -MT '$(VOM_BIN)' $(VOM_CPPSRC) > $@
+endif
+.PHONY: test-apps
+test-apps: $(VAPI_CBIN) $(VAPI_CPPBIN) $(VOM_BIN)
+.PHONY: clean
clean:
- rm -rf $(VAPI_BINDIR) $(VOM_BINDIR)
+ @rm -rf $(VAPI_BINDIR) $(VOM_BINDIR)
ifneq ($(MAKECMDGOALS),clean)
--include $(VAPI_CPPBIN).d
-include $(VAPI_CBIN).d
+ifneq ($(VAPI_CPPBIN),)
+-include $(VAPI_CPPBIN).d
+endif
+ifneq ($(VOM_BIN),)
-include $(VOM_BIN).d
endif
-
+endif