From 941616f893683a573d681187bdee3dca72eaf119 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Wed, 8 Aug 2018 18:43:46 +0300 Subject: Returning error for "make tests" when "--tests" wasn't configured. --- auto/make | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) (limited to 'auto') diff --git a/auto/make b/auto/make index 121d575b..296caf13 100644 --- a/auto/make +++ b/auto/make @@ -116,20 +116,25 @@ done $echo >> $NXT_MAKEFILE -# Test object files list. +if [ $NXT_TESTS = YES ]; then -$echo "NXT_TEST_OBJS = \\" >> $NXT_MAKEFILE + # Test object files list. -for nxt_src in $NXT_TEST_SRCS -do - nxt_obj=${nxt_src%.c}.o - $echo " $NXT_BUILD_DIR/$nxt_obj \\" >> $NXT_MAKEFILE -done + $echo "NXT_TEST_OBJS = \\" >> $NXT_MAKEFILE + for nxt_src in $NXT_TEST_SRCS + do + nxt_obj=${nxt_src%.c}.o + $echo " $NXT_BUILD_DIR/$nxt_obj \\" >> $NXT_MAKEFILE + done -# Test executables. + # Test executables. -cat << END >> $NXT_MAKEFILE + cat << END >> $NXT_MAKEFILE + +.PHONY: tests +tests: $NXT_BUILD_DIR/tests $NXT_BUILD_DIR/utf8_file_name_test \\ + $NXT_BUILD_DIR/unit_app_test $NXT_BUILD_DIR/tests: \$(NXT_TEST_OBJS) \\ $NXT_BUILD_DIR/$NXT_LIB_STATIC @@ -155,6 +160,21 @@ $NXT_BUILD_DIR/unit_app_test: $NXT_BUILD_DIR/src/test/nxt_unit_app_test.o \\ END +else + + cat << END >> $NXT_MAKEFILE + +.PHONY: tests +tests: + @(echo; \\ + echo "error: to make tests you need to configure --tests option."; \\ + echo; \\ + exit 1) + +END + +fi + NXT_MAKE_INCS="src $NXT_BUILD_DIR" NXT_MAKE_SRCS="$NXT_SRCS" @@ -264,10 +284,6 @@ cat << END > Makefile include $NXT_MAKEFILE -.PHONY: tests -tests: $NXT_BUILD_DIR/tests $NXT_BUILD_DIR/utf8_file_name_test \\ - $NXT_BUILD_DIR/unit_app_test - .PHONY: clean clean: rm -rf $NXT_BUILD_DIR *.dSYM Makefile -- cgit