diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-01-27 22:47:08 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-01-27 22:47:08 +0000 |
commit | 1ca74185c497710e2949c3b5ea97897d9b96c758 (patch) | |
tree | 1f3b1acd21f0f7d6002e3f5fcef9d8f4c68d0efd | |
parent | a626a99ca55cddc2d28619fb673505135a9f1dec (diff) | |
download | busybox-w32-1ca74185c497710e2949c3b5ea97897d9b96c758.tar.gz busybox-w32-1ca74185c497710e2949c3b5ea97897d9b96c758.tar.bz2 busybox-w32-1ca74185c497710e2949c3b5ea97897d9b96c758.zip |
- pull r17554 and r17555 from trunk:
- fix testsuite and add test for sum
-rw-r--r-- | Makefile.custom | 4 | ||||
-rwxr-xr-x | testsuite/sum.tests | 24 |
2 files changed, 26 insertions, 2 deletions
diff --git a/Makefile.custom b/Makefile.custom index e976e739e..0cc40a667 100644 --- a/Makefile.custom +++ b/Makefile.custom | |||
@@ -38,9 +38,9 @@ ifneq ($(strip $(DO_INSTALL_LIBS)),n) | |||
38 | done | 38 | done |
39 | endif | 39 | endif |
40 | 40 | ||
41 | check test: busybox | 41 | check test: busybox busybox.links |
42 | bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \ | 42 | bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \ |
43 | $(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:1=),-v) | 43 | $(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v) |
44 | 44 | ||
45 | .PHONY: release | 45 | .PHONY: release |
46 | release: distclean | 46 | release: distclean |
diff --git a/testsuite/sum.tests b/testsuite/sum.tests new file mode 100755 index 000000000..0993f03b1 --- /dev/null +++ b/testsuite/sum.tests | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # unit test for sum. | ||
4 | # Copyright 2007 by Bernhard Fischer | ||
5 | # Licensed under GPL v2 or later, see file LICENSE for details. | ||
6 | |||
7 | # AUDIT: Unit tests for sum | ||
8 | |||
9 | . testing.sh | ||
10 | |||
11 | # testing "test name" "options" "expected result" "file input" "stdin" | ||
12 | # file input will be file called "input" | ||
13 | # test can create a file "actual" instead of writing to stdout | ||
14 | |||
15 | testing "sum -r file doesn't print file's name" \ | ||
16 | "sum -r $0 | grep -c $0 && echo wrongly_printed_filename || echo yes" \ | ||
17 | "0\nyes\n" "" "" | ||
18 | testing "sum -r file file does print both names" \ | ||
19 | "sum -r $0 $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \ | ||
20 | "2\nyes\n" "" "" | ||
21 | testing "sum -s file does print file's name" \ | ||
22 | "sum -s $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \ | ||
23 | "1\nyes\n" "" "" | ||
24 | exit $FAILCOUNT | ||