nano-regress (828B)
1 #!/usr/bin/perl 2 use strict; 3 4 sub combinations { 5 return [] unless @_; 6 my $first = shift; 7 my @rest = combinations(@_); 8 return @rest, map { [$first, @$_] } @rest; 9 } 10 11 my @allargs=("--enable-debug", "--disable-wrapping", "--disable-justify", "--disable-extra", "--enable-tiny", "--disable-utf8", "--disable-multibuffer", "--disable-nanorc", "--with-slang"); 12 my @combos = combinations(@allargs); 13 14 my $i = 0; 15 foreach my $name (@combos) { 16 my @args = @$name; 17 my $pct = $i / $#combos * 100; 18 printf "Trying with options: @args, %d%% done...\n", $pct; 19 my $cmd = "./configure @args && make clean all"; 20 system("($cmd) >/dev/null 2>&1"); 21 if ($? != 0) { 22 print "Build failed for args: @args\n"; 23 print "To reproduce, run:\n $cmd\n"; 24 exit(1); 25 } 26 $i++; 27 } 28 29 print "All options completed successfully!\n";