nano-regress 828 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/perl
use strict;

sub combinations {
  return [] unless @_;
  my $first = shift;
  my @rest = combinations(@_);
  return @rest, map { [$first, @$_] } @rest;
} 

11
my @allargs=("--enable-debug", "--disable-wrapping", "--disable-justify", "--disable-extra", "--enable-tiny", "--disable-utf8", "--disable-multibuffer", "--disable-nanorc", "--with-slang");
12
13
14
15
16
17
18
my @combos =  combinations(@allargs);

my $i = 0;
foreach my $name (@combos) {
    my @args = @$name;
    my $pct = $i / $#combos * 100;
    printf "Trying with options: @args, %d%% done...\n", $pct;
19
20
    my $cmd = "./configure @args && make clean all";
    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
25
26
27
28
29
	exit(1);
    }
    $i++;
}

print "All options completed successfully!\n";