1 | # $Id: Makefile.kmk 2284 2009-02-25 03:58:14Z bird $
|
---|
2 | ## @file
|
---|
3 | # Sub-makefile for kash tests.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (c) 2005-2009 knut st. osmundsen <[email protected]>
|
---|
8 | #
|
---|
9 | # This file is part of kBuild.
|
---|
10 | #
|
---|
11 | # kBuild is free software; you can redistribute it and/or modify
|
---|
12 | # it under the terms of the GNU General Public License as published by
|
---|
13 | # the Free Software Foundation; either version 3 of the License, or
|
---|
14 | # (at your option) any later version.
|
---|
15 | #
|
---|
16 | # kBuild is distributed in the hope that it will be useful,
|
---|
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | # GNU General Public License for more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License
|
---|
22 | # along with kBuild. If not, see <http://www.gnu.org/licenses/>
|
---|
23 | #
|
---|
24 | #
|
---|
25 |
|
---|
26 | SUB_DEPTH = ../..
|
---|
27 | include $(KBUILD_PATH)/subheader.kmk
|
---|
28 |
|
---|
29 | #
|
---|
30 | # The program.
|
---|
31 | #
|
---|
32 |
|
---|
33 | TESTING += kash_tests
|
---|
34 |
|
---|
35 | KASH_TEST_BIN = $(if $(kash_1_TARGET),$(kash_1_TARGET),$(PATH_INS)/$(TEMPLATE_BIN_INST)kash$(SUFF_EXE))
|
---|
36 | KASH_TEST_DIR := $(PATH_SUB_CURRENT)
|
---|
37 | KASH_TESTCASES := $(addprefix $(KASH_TEST_DIR)/,\
|
---|
38 | trap-exit-1 \
|
---|
39 | trap-int-1 \
|
---|
40 | trap-term-1 \
|
---|
41 | tick-1 \
|
---|
42 | redirect-1 \
|
---|
43 | redirect-2 \
|
---|
44 | redirect-3 \
|
---|
45 | )
|
---|
46 |
|
---|
47 |
|
---|
48 | kash_tests::
|
---|
49 | $(ECHO) "kash tests..."
|
---|
50 | @export KASH_TEST_DIR=$(KASH_TEST_DIR); \
|
---|
51 | KASH_FAILURE=0; \
|
---|
52 | $(foreach test,$(KASH_TESTCASES)\
|
---|
53 | ,echo " * $(KASH_TEST_BIN) $(test)"; \
|
---|
54 | if ! $(KASH_TEST_BIN) $(test); then \
|
---|
55 | echo " => FAILURE!"; \
|
---|
56 | KASH_FAILURE=`$(EXPR_EXT) $${KASH_FAILURE} + 1`; \
|
---|
57 | fi; \
|
---|
58 | ) \
|
---|
59 | if test $$KASH_FAILURE -eq 0; then \
|
---|
60 | echo 'kash tests: All tests succeeded.'; \
|
---|
61 | else \
|
---|
62 | echo "kash tests: $$KASH_FAILURE kash test failed"'!!'; \
|
---|
63 | exit 1; \
|
---|
64 | fi
|
---|
65 |
|
---|
66 |
|
---|
67 |
|
---|
68 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
69 |
|
---|
70 |
|
---|