#
# Only redirect STDOUT, which should contain details of why the test failed.
# Don't molest STDERR as this may be used to receive output from a debugger.
-$(BUILD_DIR)/tests/radiusd-c: raddb/test.conf ${BUILD_DIR}/bin/radiusd $(GENERATED_CERTIFICATE_FILES) | build.raddb
+$(BUILD_DIR)/tests/radiusd-c: raddb/test.conf ${BUILD_DIR}/bin/radiusd $(GENERATED_CERT_FILES) | build.raddb
@printf "radiusd -C... "
@if ! FR_LIBRARY_PATH=./build/lib/local/.libs/ ./build/make/jlibtool --mode=execute ./build/bin/local/radiusd -XCMd ./raddb -n debug -D ./share -n test > $(BUILD_DIR)/tests/radiusd.config.log; then \
rm -f raddb/test.conf; \
@echo "ok"
@touch $@
-test: ${BUILD_DIR}/bin/radiusd ${BUILD_DIR}/bin/radclient tests.unit tests.xlat tests.keywords tests.auth tests.modules $(BUILD_DIR)/tests/radiusd-c tests.eap $(GENERATED_CERTIFICATE_FILES) | build.raddb
+test: ${BUILD_DIR}/bin/radiusd ${BUILD_DIR}/bin/radclient tests.unit tests.xlat tests.keywords tests.auth tests.modules $(BUILD_DIR)/tests/radiusd-c tests.eap | build.raddb
@$(MAKE) -C src/tests tests
# Tests specifically for Travis. We do a LOT more than just
INSTALL_CERT_FILES := Makefile README xpextensions \
ca.cnf server.cnf ocsp.cnf client.cnf bootstrap
-LOCAL_CERT_FILES := ca.key ca.pem client.key client.pem ocsp.key ocsp.pem \
+LOCAL_CERT_FILES := ca.key ca.pem client.key client.pem dh ocsp.key ocsp.pem \
server.key server.pem
GENERATED_CERT_FILES := $(addprefix ${top_srcdir}/raddb/certs/,$(LOCAL_CERT_FILES))
${Q}[ -e $@ ] || ln -s $(patsubst $(R)$(raddbdir)/%,./%,$<) $@
ifeq ("$(PACKAGE)","")
-ifeq ("$(TEST_CERTS)","")
-#
-# Generate local certificate products when doing a normal developer
-# build. This takes a LONG time!
-#
-$(INSTALL_CERT_PRODUCTS):
- ${Q}echo BOOTSTRAP raddb/certs/
- ${Q}$(MAKE) -C $(R)$(raddbdir)/certs/
-else
+ifeq ("$(TEST_CERTS)","yes")
#
# Using test certs: just copy them over.
# See src/tests/certs/README.md for further information.
#
-build.raddb: $(addprefix ${top_srcdir}/raddb/certs/,$(LOCAL_CERT_FILES))
+build.raddb: $(GENERATED_CERT_FILES)
define CP_FILE
${top_srcdir}/raddb/certs/${1}: ${top_srcdir}/src/tests/certs/${1}
endef
$(foreach x,$(LOCAL_CERT_FILES),$(eval $(call CP_FILE,${x})))
-endif
else
#
-# We're not packaging, but we do need to create the test certificates
+# Generate local certificate products when doing a non-package
+# (i.e. developer) build. This takes a LONG time!
+#
+$(GENERATED_CERT_FILES):
+ ${Q}echo BOOTSTRAP raddb/certs/
+ ${Q}$(MAKE) -C ${top_srcdir}/raddb/certs/
+endif
+#
+# If we are packaging, don't generate any certs,
+# and don't copy the testing certs over.
#
-$(GENERATED_CERTIFICATE_FILES):
- @$(MAKE) -C raddb/certs
endif
#