diff options
author | Valentin Bartenev <vbart@nginx.com> | 2018-08-08 18:43:46 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2018-08-08 18:43:46 +0300 |
commit | 941616f893683a573d681187bdee3dca72eaf119 (patch) | |
tree | e60bbab318aaeb410d870617d20de12fcd40b3ac | |
parent | 6c0c3dcaa7b085aef3f1ed56cb1c73d34f54e6f1 (diff) | |
download | unit-941616f893683a573d681187bdee3dca72eaf119.tar.gz unit-941616f893683a573d681187bdee3dca72eaf119.tar.bz2 |
Returning error for "make tests" when "--tests" wasn't configured.
-rw-r--r-- | auto/make | 42 |
1 files changed, 29 insertions, 13 deletions
@@ -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 |