diff options
author | Ron Yorston <rmy@pobox.com> | 2016-11-29 11:26:45 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2016-11-29 11:26:45 +0000 |
commit | bb8d79eadbba1942dbdb9f9cee5c47833afe269f (patch) | |
tree | b8c517e9ca895d60d7227aef7177b6291df5e2cd /coreutils/test.c | |
parent | 9fa1e4990e655a85025c9d270a1606983e375e47 (diff) | |
parent | 7d877fc9312a742b06125927bb1d34bd35398c6c (diff) | |
download | busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.tar.gz busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.tar.bz2 busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils/test.c')
-rw-r--r-- | coreutils/test.c | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/coreutils/test.c b/coreutils/test.c index b8a5d798c..df42590e4 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
@@ -19,11 +19,6 @@ | |||
19 | * Original copyright notice states: | 19 | * Original copyright notice states: |
20 | * "This program is in the Public Domain." | 20 | * "This program is in the Public Domain." |
21 | */ | 21 | */ |
22 | |||
23 | //kbuild:lib-$(CONFIG_TEST) += test.o test_ptr_hack.o | ||
24 | //kbuild:lib-$(CONFIG_ASH) += test.o test_ptr_hack.o | ||
25 | //kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o | ||
26 | |||
27 | //config:config TEST | 22 | //config:config TEST |
28 | //config: bool "test" | 23 | //config: bool "test" |
29 | //config: default y | 24 | //config: default y |
@@ -32,13 +27,35 @@ | |||
32 | //config: returning an appropriate exit code. The bash shell | 27 | //config: returning an appropriate exit code. The bash shell |
33 | //config: has test built in, ash can build it in optionally. | 28 | //config: has test built in, ash can build it in optionally. |
34 | //config: | 29 | //config: |
30 | //config:config TEST1 | ||
31 | //config: bool "test as [" | ||
32 | //config: default y | ||
33 | //config: help | ||
34 | //config: Provide test command in the "[ EXPR ]" form | ||
35 | //config: | ||
36 | //config:config TEST2 | ||
37 | //config: bool "test as [[" | ||
38 | //config: default y | ||
39 | //config: help | ||
40 | //config: Provide test command in the "[[ EXPR ]]" form | ||
41 | //config: | ||
35 | //config:config FEATURE_TEST_64 | 42 | //config:config FEATURE_TEST_64 |
36 | //config: bool "Extend test to 64 bit" | 43 | //config: bool "Extend test to 64 bit" |
37 | //config: default y | 44 | //config: default y |
38 | //config: depends on TEST || ASH_BUILTIN_TEST || HUSH | 45 | //config: depends on TEST || TEST1 || TEST2 || ASH_BUILTIN_TEST || HUSH |
39 | //config: help | 46 | //config: help |
40 | //config: Enable 64-bit support in test. | 47 | //config: Enable 64-bit support in test. |
41 | 48 | ||
49 | //applet:IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | ||
50 | //applet:IF_TEST1(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | ||
51 | //applet:IF_TEST2(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | ||
52 | |||
53 | //kbuild:lib-$(CONFIG_TEST) += test.o test_ptr_hack.o | ||
54 | //kbuild:lib-$(CONFIG_TEST1) += test.o test_ptr_hack.o | ||
55 | //kbuild:lib-$(CONFIG_TEST2) += test.o test_ptr_hack.o | ||
56 | //kbuild:lib-$(CONFIG_ASH_BUILTIN_TEST) += test.o test_ptr_hack.o | ||
57 | //kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o | ||
58 | |||
42 | /* "test --help" is special-cased to ignore --help */ | 59 | /* "test --help" is special-cased to ignore --help */ |
43 | //usage:#define test_trivial_usage NOUSAGE_STR | 60 | //usage:#define test_trivial_usage NOUSAGE_STR |
44 | //usage:#define test_full_usage "" | 61 | //usage:#define test_full_usage "" |
@@ -839,7 +856,9 @@ int test_main(int argc, char **argv) | |||
839 | const char *arg0; | 856 | const char *arg0; |
840 | 857 | ||
841 | arg0 = bb_basename(argv[0]); | 858 | arg0 = bb_basename(argv[0]); |
842 | if (arg0[0] == '[') { | 859 | if ((ENABLE_TEST1 || ENABLE_TEST2 || ENABLE_ASH_BUILTIN_TEST || ENABLE_HUSH) |
860 | && (arg0[0] == '[') | ||
861 | ) { | ||
843 | --argc; | 862 | --argc; |
844 | if (!arg0[1]) { /* "[" ? */ | 863 | if (!arg0[1]) { /* "[" ? */ |
845 | if (NOT_LONE_CHAR(argv[argc], ']')) { | 864 | if (NOT_LONE_CHAR(argv[argc], ']')) { |