aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-09-28 17:19:02 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-09-28 17:19:02 +0000
commit27e1501cb290523d3b1879c0b8275baf1d7ab0ab (patch)
treec786c2a6cceaea9cff06c3b1b63a24efe26b7c40
parent651d49a2ce5733672b676a02c5960b296cb4fb2d (diff)
downloadbusybox-w32-27e1501cb290523d3b1879c0b8275baf1d7ab0ab.tar.gz
busybox-w32-27e1501cb290523d3b1879c0b8275baf1d7ab0ab.tar.bz2
busybox-w32-27e1501cb290523d3b1879c0b8275baf1d7ab0ab.zip
scripts/randomtest[.loop]: add scripts for randomconfig testing
-rwxr-xr-xscripts/randomtest99
-rwxr-xr-xscripts/randomtest.loop10
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
4libc="glibc" # assumed native
5# static cross-compiled (i486-linux-uclibc-XXX)
6libc="uclibc"
7
8test -d tree || exit 1
9
10dir=test.$$
11while test -e "$dir" -o -e failed."$dir"; do
12 dir=test."$RANDOM"
13done
14
15cp -dpr tree "$dir" || exit 1
16cd "$dir" || exit 1
17
18echo "Running randconfig test in $dir..." >&2
19
20make randconfig >/dev/null || exit 1
21
22cat .config \
23| grep -v ^CONFIG_DEBUG_PESSIMIZE= \
24| grep -v CONFIG_WERROR \
25| cat >.config.new
26mv .config.new .config
27echo CONFIG_WERROR=y >>.config
28
29test "$libc" = glibc && {
30cat .config \
31| grep -v ^CONFIG_SELINUX= \
32| grep -v ^CONFIG_EFENCE= \
33| grep -v ^CONFIG_DMALLOC= \
34| cat >.config.new
35mv .config.new .config
36}
37
38test "$libc" = uclibc && {
39cat .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
51mv .config.new .config
52echo 'CONFIG_CROSS_COMPILER_PREFIX="i486-linux-uclibc-"' >>.config
53echo 'CONFIG_STATIC=y' >>.config
54}
55
56# If NOMMU, remove some things
57grep -q ^CONFIG_NOMMU= .config && {
58cat .config \
59| grep -v ^CONFIG_ASH= \
60| grep -v ^CONFIG_FEATURE_SH_IS_ASH= \
61| cat >.config.new
62mv .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)
68grep -q ^CONFIG_STATIC= .config && {
69cat .config \
70| grep -v ^CONFIG_PAM= \
71| cat >.config.new
72mv .config.new .config
73}
74
75# CONFIG_NOMMU + CONFIG_HUSH + CONFIG_WERROR don't mix
76# (produces warning)
77grep -q ^CONFIG_NOMMU= .config && \
78grep -q ^CONFIG_HUSH= .config && \
79{
80cat .config \
81| grep -v ^CONFIG_WERROR= \
82| cat >.config.new
83mv .config.new .config
84}
85
86# Regenerate .config with default answers for yanked-off options
87{ yes "" | make oldconfig >/dev/null; } || exit 1
88
89nice -n 10 make
90
91test -x busybox && {
92 cd ..
93 rm -rf "$dir"
94 exit 0
95}
96
97cd ..
98mv "$dir" failed."$dir"
99exit 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
3cnt=0
4fail=0
5
6while sleep 1; do
7 echo "Passes: $cnt Failures: $fail"
8 ./randomtest >/dev/null || exit #let fail++
9 let cnt++
10done