summaryrefslogtreecommitdiff
path: root/recipes-extended/bash/bash-4.2/build-tests.patch
blob: 036088116d1f052063650e68f8b990c59ee14b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Add 'ptest' target to Makefile, to run tests without checking dependencies.

Signed-off-by: Anders Roxell <anders.roxell@enea.com>
Upstream-Status: Pending
---
diff -uNr a/Makefile.in b/Makefile.in
--- a/Makefile.in	2012-11-06 08:40:07.552403063 +0100
+++ b/Makefile.in	2012-11-06 11:13:36.958297555 +0100
@@ -827,20 +827,34 @@
 	fi
 
 recho$(EXEEXT):		$(SUPPORT_SRC)recho.c
-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
+	@$(CC) $(CCFLAGS) -o $@ $<
 
 zecho$(EXEEXT):		$(SUPPORT_SRC)zecho.c
-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
+	@$(CC) $(CCFLAGS) -o $@ $<
 
 printenv$(EXEEXT):	$(SUPPORT_SRC)printenv.c
-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
+	@$(CC) $(CCFLAGS) -o $@ $<
 
 xcase$(EXEEXT):	$(SUPPORT_SRC)xcase.c
-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD}
+	@$(CC) $(CCFLAGS) -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 && \
 		PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )