From c3f58f8b4f7a359b9d9dd97a45bcaab50a89d224 Mon Sep 17 00:00:00 2001 From: Anders Roxell Date: Wed, 19 Dec 2012 17:18:31 +0100 Subject: [PATCH] Add 'ptest' target to Makefile, to run tests without checking dependencies. Upstream-Status: Inappropriate [ptest specific] Signed-off-by: Anders Roxell Rebase to 5.0 Signed-off-by: Hongxu Jia --- Makefile.in | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index 0b4df73..7e2a34e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -958,20 +958,34 @@ maybe-clean: fi recho$(EXEEXT): $(SUPPORT_SRC)recho.c - @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD} + @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $< zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c - @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD} + @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $< printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c - @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD} + @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $< xcase$(EXEEXT): $(SUPPORT_SRC)xcase.c - @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD} + @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $< -test tests check: force $(Program) $(TESTS_SUPPORT) +test tests check: + @$(MAKE) install-test + @$(MAKE) runtest + +install-test: buildtest +ifeq ($(origin INSTALL_TEST_DIR), undefined) @-test -d tests || mkdir tests @cp $(TESTS_SUPPORT) tests +else + @-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR) + @cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/ + @cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR) +endif + +buildtest: force $(Program) $(TESTS_SUPPORT) + +runtest: @( cd $(srcdir)/tests && \ BUILD_DIR=$(BUILD_DIR) PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )