Returning error for "make tests" when "--tests" wasn't configured.
@@ -116,6 +116,8 @@ done
$echo >> $NXT_MAKEFILE
+if [ $NXT_TESTS = YES ]; then
+
# Test object files list.
$echo "NXT_TEST_OBJS = \\" >> $NXT_MAKEFILE
@@ -126,11 +128,14 @@ do
$echo " $NXT_BUILD_DIR/$nxt_obj \\" >> $NXT_MAKEFILE
done
-
# Test executables.
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
\$(NXT_EXEC_LINK) -o $NXT_BUILD_DIR/tests \\
@@ -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
