diff options
author | Mark Whitley <markw@lineo.com> | 2001-01-04 01:05:55 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2001-01-04 01:05:55 +0000 |
commit | 1171c2fcb48026066d96793a852c06e5125b1fc9 (patch) | |
tree | 9f5fa3bc5c0e3eecd08323b75706465a78f0c37e | |
parent | be7499c83c45a5953580f24189fb3473e5ec01e4 (diff) | |
download | busybox-w32-1171c2fcb48026066d96793a852c06e5125b1fc9.tar.gz busybox-w32-1171c2fcb48026066d96793a852c06e5125b1fc9.tar.bz2 busybox-w32-1171c2fcb48026066d96793a852c06e5125b1fc9.zip |
Added new script from Larry Doolittle that builds each applet individually.
-rwxr-xr-x | tests/multibuild.pl | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/multibuild.pl b/tests/multibuild.pl new file mode 100755 index 000000000..92b1abde9 --- /dev/null +++ b/tests/multibuild.pl | |||
@@ -0,0 +1,51 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | # multibuild.pl | ||
4 | # Tests BusyBox-0.48 (at least) to see if each applet builds | ||
5 | # properly on its own. The most likely problems this will | ||
6 | # flush out are those involving preprocessor instructions in | ||
7 | # utility.c. | ||
8 | |||
9 | $logfile = "multibuild.log"; | ||
10 | |||
11 | # Support building from pristine source | ||
12 | $make_opt = "-f $ARGV[0]/Makefile BB_SRC_DIR=$ARGV[0]" if ($ARGV[0] ne ""); | ||
13 | |||
14 | # Move the config file to a safe place | ||
15 | -e "Config.h.orig" || 0==system("mv -f Config.h Config.h.orig") || die; | ||
16 | |||
17 | # Clear previous log file, if any | ||
18 | unlink($logfile); | ||
19 | |||
20 | # Parse the config file | ||
21 | open(C,"<Config.h.orig") || die; | ||
22 | while (<C>) { | ||
23 | if ($in_trailer) { | ||
24 | $trailer .= $_; | ||
25 | } else { | ||
26 | $in_trailer=1 if /End of Applications List/; | ||
27 | if (/^\/*#define BB_([A-Z_]*)/) { | ||
28 | push @apps, $1; | ||
29 | } | ||
30 | } | ||
31 | } | ||
32 | close C; | ||
33 | |||
34 | # Do the real work ... | ||
35 | for $a (@apps) { | ||
36 | # print "Testing build of applet $a ...\n"; | ||
37 | open (O, ">Config.h") || die; | ||
38 | print O "#define BB_$a\n", $trailer; | ||
39 | close O; | ||
40 | system("echo -e '\n***\n$a\n***' >>$logfile"); | ||
41 | # todo: figure out why the "rm -f *.o" is needed | ||
42 | $result{$a} = system("rm -f *.o; make $make_opt busybox >>$logfile 2>&1"); | ||
43 | $flag = $result{$a} ? "FAIL" : "OK"; | ||
44 | print "Applet $a: $flag\n"; | ||
45 | } | ||
46 | |||
47 | # Clean up our mess | ||
48 | system("mv -f Config.h.orig Config.h"); | ||
49 | |||
50 | print "See $logfile for details.\n"; | ||
51 | |||