summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark Whitley2001-01-04 01:05:55 +0000
committerMark Whitley2001-01-04 01:05:55 +0000
commit1171c2fcb48026066d96793a852c06e5125b1fc9 (patch)
tree9f5fa3bc5c0e3eecd08323b75706465a78f0c37e /tests
parentbe7499c83c45a5953580f24189fb3473e5ec01e4 (diff)
downloadbusybox-1171c2fcb48026066d96793a852c06e5125b1fc9.zip
busybox-1171c2fcb48026066d96793a852c06e5125b1fc9.tar.gz
Added new script from Larry Doolittle that builds each applet individually.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/multibuild.pl51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/multibuild.pl b/tests/multibuild.pl
new file mode 100755
index 0000000..92b1abd
--- /dev/null
+++ b/tests/multibuild.pl
@@ -0,0 +1,51 @@
+#!/usr/bin/perl
+
+# multibuild.pl
+# Tests BusyBox-0.48 (at least) to see if each applet builds
+# properly on its own. The most likely problems this will
+# flush out are those involving preprocessor instructions in
+# utility.c.
+
+$logfile = "multibuild.log";
+
+# Support building from pristine source
+$make_opt = "-f $ARGV[0]/Makefile BB_SRC_DIR=$ARGV[0]" if ($ARGV[0] ne "");
+
+# Move the config file to a safe place
+-e "Config.h.orig" || 0==system("mv -f Config.h Config.h.orig") || die;
+
+# Clear previous log file, if any
+unlink($logfile);
+
+# Parse the config file
+open(C,"<Config.h.orig") || die;
+while (<C>) {
+ if ($in_trailer) {
+ $trailer .= $_;
+ } else {
+ $in_trailer=1 if /End of Applications List/;
+ if (/^\/*#define BB_([A-Z_]*)/) {
+ push @apps, $1;
+ }
+ }
+}
+close C;
+
+# Do the real work ...
+for $a (@apps) {
+ # print "Testing build of applet $a ...\n";
+ open (O, ">Config.h") || die;
+ print O "#define BB_$a\n", $trailer;
+ close O;
+ system("echo -e '\n***\n$a\n***' >>$logfile");
+ # todo: figure out why the "rm -f *.o" is needed
+ $result{$a} = system("rm -f *.o; make $make_opt busybox >>$logfile 2>&1");
+ $flag = $result{$a} ? "FAIL" : "OK";
+ print "Applet $a: $flag\n";
+}
+
+# Clean up our mess
+system("mv -f Config.h.orig Config.h");
+
+print "See $logfile for details.\n";
+