diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-09-28 17:19:02 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-09-28 17:19:02 +0000 |
commit | 27e1501cb290523d3b1879c0b8275baf1d7ab0ab (patch) | |
tree | c786c2a6cceaea9cff06c3b1b63a24efe26b7c40 | |
parent | 651d49a2ce5733672b676a02c5960b296cb4fb2d (diff) | |
download | busybox-w32-27e1501cb290523d3b1879c0b8275baf1d7ab0ab.tar.gz busybox-w32-27e1501cb290523d3b1879c0b8275baf1d7ab0ab.tar.bz2 busybox-w32-27e1501cb290523d3b1879c0b8275baf1d7ab0ab.zip |
scripts/randomtest[.loop]: add scripts for randomconfig testing
-rwxr-xr-x | scripts/randomtest | 99 | ||||
-rwxr-xr-x | scripts/randomtest.loop | 10 |
2 files changed, 109 insertions, 0 deletions
diff --git a/scripts/randomtest b/scripts/randomtest new file mode 100755 index 000000000..0450f76f0 --- /dev/null +++ b/scripts/randomtest | |||
@@ -0,0 +1,99 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Select which libc to build against | ||
4 | libc="glibc" # assumed native | ||
5 | # static cross-compiled (i486-linux-uclibc-XXX) | ||
6 | libc="uclibc" | ||
7 | |||
8 | test -d tree || exit 1 | ||
9 | |||
10 | dir=test.$$ | ||
11 | while test -e "$dir" -o -e failed."$dir"; do | ||
12 | dir=test."$RANDOM" | ||
13 | done | ||
14 | |||
15 | cp -dpr tree "$dir" || exit 1 | ||
16 | cd "$dir" || exit 1 | ||
17 | |||
18 | echo "Running randconfig test in $dir..." >&2 | ||
19 | |||
20 | make randconfig >/dev/null || exit 1 | ||
21 | |||
22 | cat .config \ | ||
23 | | grep -v ^CONFIG_DEBUG_PESSIMIZE= \ | ||
24 | | grep -v CONFIG_WERROR \ | ||
25 | | cat >.config.new | ||
26 | mv .config.new .config | ||
27 | echo CONFIG_WERROR=y >>.config | ||
28 | |||
29 | test "$libc" = glibc && { | ||
30 | cat .config \ | ||
31 | | grep -v ^CONFIG_SELINUX= \ | ||
32 | | grep -v ^CONFIG_EFENCE= \ | ||
33 | | grep -v ^CONFIG_DMALLOC= \ | ||
34 | | cat >.config.new | ||
35 | mv .config.new .config | ||
36 | } | ||
37 | |||
38 | test "$libc" = uclibc && { | ||
39 | cat .config \ | ||
40 | | grep -v ^CONFIG_SELINUX= \ | ||
41 | | grep -v ^CONFIG_EFENCE= \ | ||
42 | | grep -v ^CONFIG_DMALLOC= \ | ||
43 | | grep -v ^CONFIG_BUILD_LIBBUSYBOX= \ | ||
44 | | grep -v ^CONFIG_PAM= \ | ||
45 | | grep -v ^CONFIG_TASKSET= \ | ||
46 | | grep -v ^CONFIG_FEATURE_ASSUME_UNICODE= \ | ||
47 | | grep -v ^CONFIG_PIE= \ | ||
48 | | grep -v CONFIG_STATIC \ | ||
49 | | grep -v CONFIG_CROSS_COMPILER_PREFIX \ | ||
50 | | cat >.config.new | ||
51 | mv .config.new .config | ||
52 | echo 'CONFIG_CROSS_COMPILER_PREFIX="i486-linux-uclibc-"' >>.config | ||
53 | echo 'CONFIG_STATIC=y' >>.config | ||
54 | } | ||
55 | |||
56 | # If NOMMU, remove some things | ||
57 | grep -q ^CONFIG_NOMMU= .config && { | ||
58 | cat .config \ | ||
59 | | grep -v ^CONFIG_ASH= \ | ||
60 | | grep -v ^CONFIG_FEATURE_SH_IS_ASH= \ | ||
61 | | cat >.config.new | ||
62 | mv .config.new .config | ||
63 | } | ||
64 | |||
65 | # If STATIC, remove some things | ||
66 | # PAM with static linking is probably pointless | ||
67 | # (but I need to try - now I don't have libpam.a on my system, only libpam.so) | ||
68 | grep -q ^CONFIG_STATIC= .config && { | ||
69 | cat .config \ | ||
70 | | grep -v ^CONFIG_PAM= \ | ||
71 | | cat >.config.new | ||
72 | mv .config.new .config | ||
73 | } | ||
74 | |||
75 | # CONFIG_NOMMU + CONFIG_HUSH + CONFIG_WERROR don't mix | ||
76 | # (produces warning) | ||
77 | grep -q ^CONFIG_NOMMU= .config && \ | ||
78 | grep -q ^CONFIG_HUSH= .config && \ | ||
79 | { | ||
80 | cat .config \ | ||
81 | | grep -v ^CONFIG_WERROR= \ | ||
82 | | cat >.config.new | ||
83 | mv .config.new .config | ||
84 | } | ||
85 | |||
86 | # Regenerate .config with default answers for yanked-off options | ||
87 | { yes "" | make oldconfig >/dev/null; } || exit 1 | ||
88 | |||
89 | nice -n 10 make | ||
90 | |||
91 | test -x busybox && { | ||
92 | cd .. | ||
93 | rm -rf "$dir" | ||
94 | exit 0 | ||
95 | } | ||
96 | |||
97 | cd .. | ||
98 | mv "$dir" failed."$dir" | ||
99 | exit 1 | ||
diff --git a/scripts/randomtest.loop b/scripts/randomtest.loop new file mode 100755 index 000000000..28edb6732 --- /dev/null +++ b/scripts/randomtest.loop | |||
@@ -0,0 +1,10 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | cnt=0 | ||
4 | fail=0 | ||
5 | |||
6 | while sleep 1; do | ||
7 | echo "Passes: $cnt Failures: $fail" | ||
8 | ./randomtest >/dev/null || exit #let fail++ | ||
9 | let cnt++ | ||
10 | done | ||