source: branches/3.2/mindi-busybox/testsuite/test.tests @ 3232

Last change on this file since 3232 was 2725, checked in by bruno, 8 years ago
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/sh
2
3# Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com>
4# Licensed under GPLv2, see file LICENSE in this source tree.
5
6. ./testing.sh
7
8# testing "test name" "command" "expected result" "file input" "stdin"
9#   file input will be file called "input"
10#   test can create a file "actual" instead of writing to stdout
11
12# Need to call 'busybox test', otherwise shell builtin is used
13
14testing "test: should be false (1)" \
15    "busybox test; echo \$?" \
16    "1\n" \
17    "" ""
18
19testing "test '': should be false (1)" \
20    "busybox test ''; echo \$?" \
21    "1\n" \
22    "" ""
23
24testing "test !: should be true (0)" \
25    "busybox test !; echo \$?" \
26    "0\n" \
27    "" ""
28
29testing "test a: should be true (0)" \
30    "busybox test a; echo \$?" \
31    "0\n" \
32    "" ""
33
34testing "test --help: should be true (0)" \
35    "busybox test --help; echo \$?" \
36    "0\n" \
37    "" ""
38
39testing "test -f: should be true (0)" \
40    "busybox test -f; echo \$?" \
41    "0\n" \
42    "" ""
43
44testing "test ! -f: should be false (1)" \
45    "busybox test ! -f; echo \$?" \
46    "1\n" \
47    "" ""
48
49testing "test a = a: should be true (0)" \
50    "busybox test a = a; echo \$?" \
51    "0\n" \
52    "" ""
53
54testing "test -lt = -gt: should be false (1)" \
55    "busybox test -lt = -gt; echo \$?" \
56    "1\n" \
57    "" ""
58
59testing "test a -a !: should be true (0)" \
60    "busybox test a -a !; echo \$?" \
61    "0\n" \
62    "" ""
63
64testing "test -f = a -o b: should be true (0)" \
65    "busybox test -f = a -o b; echo \$?" \
66    "0\n" \
67    "" ""
68
69testing "test ! a = b -a ! c = c: should be false (1)" \
70    "busybox test ! a = b -a ! c = c; echo \$?" \
71    "1\n" \
72    "" ""
73
74testing "test ! a = b -a ! c = d: should be true (0)" \
75    "busybox test ! a = b -a ! c = d; echo \$?" \
76    "0\n" \
77    "" ""
78
79exit $FAILCOUNT
Note: See TracBrowser for help on using the repository browser.