mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-31 13:00:49 +00:00
Renamed test_all_build_flags.pl to all_build_flags.pl
This commit is contained in:
1 parent
afd413c3ad
commit
d4eecd5070
1 file changed
-28
@@ -1,28 +0,0 @@
|
|||||||
#!/usr/bin/env perl
|
|
||||||
|
|
||||||
@flags = ("NO_POPEN", "NO_SSL", "NDEBUG", "DEBUG", "NO_CGI");
|
|
||||||
my $num_flags = @flags;
|
|
||||||
|
|
||||||
sub fail {
|
|
||||||
print "FAILED: @_\n";
|
|
||||||
exit 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $platform = $ARGV[0] || "linux";
|
|
||||||
|
|
||||||
for (my $i = 0; $i < 2 ** $num_flags; $i++) {
|
|
||||||
my $bitmask = sprintf("%*.*b", $num_flags, $num_flags, $i);
|
|
||||||
my @combination = ();
|
|
||||||
for (my $j = 0; $j < $num_flags; $j++) {
|
|
||||||
push @combination, $flags[$j] if substr($bitmask, $j, 1);
|
|
||||||
}
|
|
||||||
my $defines = join(" ", map { "-D$_" } @combination);
|
|
||||||
my $cmd = "CFLAGS=\"$defines\" make clean $platform >/dev/null";
|
|
||||||
system($cmd) == 0 or fail "build failed: $_";
|
|
||||||
print "Build succeeded, flags: [$defines]\n";
|
|
||||||
system("perl test/test.pl basic_tests >/dev/null") == 0
|
|
||||||
or fail "basic tests";
|
|
||||||
print "Basic tests: OK\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "PASS: All builds passed!\n";
|
|
||||||
Reference in new issue
Block a user