mirror of
https://github.com/openresty/openresty.git
synced 2024-10-13 00:29:41 +00:00
a lot of work on the util/configure script.
This commit is contained in:
40
t/sanity.t
Normal file
40
t/sanity.t
Normal file
@ -0,0 +1,40 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
use Test::Differences;
|
||||
|
||||
sub shell (@);
|
||||
sub cd ($);
|
||||
|
||||
my $ver = `bash util/ver`;
|
||||
chomp $ver;
|
||||
|
||||
shell "make";
|
||||
|
||||
cd "ngx_openresty-$ver";
|
||||
shell "./configure --help > help.txt";
|
||||
|
||||
open my $in, "help.txt" or
|
||||
die "Cannot open help.txt for reading: $!\n";
|
||||
my $got = do { local $/; <$in> };
|
||||
close $in;
|
||||
|
||||
open $in, "../t/help.txt" or
|
||||
die "Cannot open ../t/help.txt for reading: $!\n";
|
||||
my $expected = do { local $/; <$in> };
|
||||
close $in;
|
||||
|
||||
eq_or_diff $got, $expected, "--help ok";
|
||||
|
||||
sub shell (@) {
|
||||
print "@_\n";
|
||||
system(@_) == 0 or die "failed to run command @_\n";
|
||||
}
|
||||
|
||||
sub cd ($) {
|
||||
my $dir = shift;
|
||||
print("cd $dir\n");
|
||||
chdir $dir or die "failed to cd $dir: $!\n";
|
||||
}
|
||||
|
Reference in New Issue
Block a user