5 # Turns on all applets, then tests turning on one feature at a time through
6 # iterative compilations. Tests if any features depend on each other in any
7 # weird ways or such-like problems.
9 # Hacked by Mark Whitley, but based *heavily* on multibuild.pl which was
10 # written by Larry Doolittle.
12 $logfile = "multifeat.log";
14 # How to handle all the CONFIG_APPLET lines
15 # (most thorough testing occurs when you call it with the -all switch)
16 if ($ARGV[0] eq "-all" ) { shift(@ARGV); $choice="all"; }
17 if ($ARGV[0] eq "-none") { shift(@ARGV); $choice="none"; }
18 # neither means, leave that part of Config.h alone
20 # Support building from pristine source
21 $make_opt = "-f $ARGV[0]/Makefile CONFIG_SRC_DIR=$ARGV[0]" if ($ARGV[0] ne "");
23 # Move the config file to a safe place
24 -e "Config.h.orig" || 0==system("mv -f Config.h Config.h.orig") || die;
26 # Clear previous log file, if any
29 # Parse the config file
30 open(C,"<Config.h.orig") || die;
36 s/^\/\/#/#/ if ($choice eq "all");
37 s/^#/\/\/#/ if ($choice eq "none");
39 if (/End of Applications List/) {
44 elsif ($in_features) {
45 if (/^\/*#define CONFIG_FEATURE_([A-Z0-9_]*)/) {
48 if (/End of Features List/) {
52 } elsif ($in_olympus) {
58 # Do the real work ...
61 # print "Testing build with feature $f ...\n";
62 open (O, ">Config.h") || die;
63 print O $header, "#define CONFIG_FEATURE_$f\n", $trailer;
65 system("echo -e '\n***\n$f\n***' >>$logfile");
66 # With a fast computer and 1-second resolution on file timestamps, this
67 # process pushes beyond the limits of what unix make can understand.
68 # That's why need to weed out obsolete files before restarting make.
69 $result{$f} = system("rm -f *.o applet_source_list; make $make_opt busybox >>$logfile 2>&1");
70 $flag = $result{$f} ? "FAILED!!!" : "ok";
71 printf("Feature %-20s: %s\n", $f, $flag);
73 $failed_tests++ if $flag eq "FAILED!!!";
74 # pause long enough to let user stop us with a ^C
75 select(undef, undef, undef, 0.03);
79 system("mv -f Config.h.orig Config.h");
81 print "$total_tests applets tested, $failed_tests failures\n";
82 print "See $logfile for details.\n";