Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Individual test directories for programs (#166)
* Give existing program tests their own directory * Templates for tests * Don't load optional modules in BEGIN because it interferes with -c * pod fix * Use Test::Warnings instead because of done_testing sorcery * Use done_testing because Test::Warnings handles it all * Don't skip commands if the dir already exists We'll skip test files if they already exist * Use done_testing because Test::Warnings hooks into that already * Don't load runtime stuff at compile time because it messes with -c * Individual tests for commands * Fix pod error * Quotes around arguments in case they have whitespace * Use proper argument * Output when we add a test file * show PERL5LIB when we debug * Compile stuff moves to individual files, now check other things * Rename test now that it isn't checking every file * Add meta tests * Add metadata * Allow for the possibility of empty values * Update MANIFEST
- Loading branch information
Showing
393 changed files
with
6,101 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use Test::More 1; | ||
|
||
use File::Basename; | ||
use File::Spec::Functions; | ||
|
||
my @programs = | ||
map { basename($_) } | ||
grep { ! /\.bat\z/ } | ||
glob( 'blib/script/*' ); | ||
|
||
my @expected_test_files = | ||
map { basename($_) } | ||
glob( catfile( qw(util test_templates *.t) ) ); | ||
|
||
foreach my $program ( @programs ) { | ||
test_dir($program); | ||
} | ||
|
||
done_testing(); | ||
|
||
sub test_dir { | ||
my( $program ) = @_; | ||
ok -d catfile( 't', $program ), "t/$program is a directory"; | ||
|
||
foreach my $t_file ( @expected_test_files ) { | ||
ok -e catfile( 't', $program, $t_file ), "Found test file $t_file"; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
sanity_test(); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
|
||
use JSON qw(decode_json); | ||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
my $program = program_name(); | ||
ok -e $program, "$program exists"; | ||
|
||
my $output = `"$^X" util/extract_metadata $program`; | ||
my $json = decode_json( $output ); | ||
|
||
subtest "required keys" => sub { | ||
my $this = $json->{$program}; | ||
my @keys = qw(Name Description Author License); | ||
|
||
ok( exists $this->{$_}, "has $_ key" ) for @keys; | ||
}; | ||
|
||
done_testing(); | ||
|
||
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/perl | ||
|
||
use Test::Pod; | ||
|
||
require './t/lib/common.pl'; | ||
my $program = program_name(__FILE__); | ||
|
||
pod_file_ok( $program, "Valid POD in <$program>" ); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
sanity_test(); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
|
||
use JSON qw(decode_json); | ||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
my $program = program_name(); | ||
ok -e $program, "$program exists"; | ||
|
||
my $output = `"$^X" util/extract_metadata $program`; | ||
my $json = decode_json( $output ); | ||
|
||
subtest "required keys" => sub { | ||
my $this = $json->{$program}; | ||
my @keys = qw(Name Description Author License); | ||
|
||
ok( exists $this->{$_}, "has $_ key" ) for @keys; | ||
}; | ||
|
||
done_testing(); | ||
|
||
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/perl | ||
|
||
use Test::Pod; | ||
|
||
require './t/lib/common.pl'; | ||
my $program = program_name(__FILE__); | ||
|
||
pod_file_ok( $program, "Valid POD in <$program>" ); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
sanity_test(); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
|
||
use JSON qw(decode_json); | ||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
my $program = program_name(); | ||
ok -e $program, "$program exists"; | ||
|
||
my $output = `"$^X" util/extract_metadata $program`; | ||
my $json = decode_json( $output ); | ||
|
||
subtest "required keys" => sub { | ||
my $this = $json->{$program}; | ||
my @keys = qw(Name Description Author License); | ||
|
||
ok( exists $this->{$_}, "has $_ key" ) for @keys; | ||
}; | ||
|
||
done_testing(); | ||
|
||
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/perl | ||
|
||
use Test::Pod; | ||
|
||
require './t/lib/common.pl'; | ||
my $program = program_name(__FILE__); | ||
|
||
pod_file_ok( $program, "Valid POD in <$program>" ); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
sanity_test(); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
|
||
use JSON qw(decode_json); | ||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
my $program = program_name(); | ||
ok -e $program, "$program exists"; | ||
|
||
my $output = `"$^X" util/extract_metadata $program`; | ||
my $json = decode_json( $output ); | ||
|
||
subtest "required keys" => sub { | ||
my $this = $json->{$program}; | ||
my @keys = qw(Name Description Author License); | ||
|
||
ok( exists $this->{$_}, "has $_ key" ) for @keys; | ||
}; | ||
|
||
done_testing(); | ||
|
||
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/perl | ||
|
||
use Test::Pod; | ||
|
||
require './t/lib/common.pl'; | ||
my $program = program_name(__FILE__); | ||
|
||
pod_file_ok( $program, "Valid POD in <$program>" ); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
sanity_test(); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
|
||
use JSON qw(decode_json); | ||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
my $program = program_name(); | ||
ok -e $program, "$program exists"; | ||
|
||
my $output = `"$^X" util/extract_metadata $program`; | ||
my $json = decode_json( $output ); | ||
|
||
subtest "required keys" => sub { | ||
my $this = $json->{$program}; | ||
my @keys = qw(Name Description Author License); | ||
|
||
ok( exists $this->{$_}, "has $_ key" ) for @keys; | ||
}; | ||
|
||
done_testing(); | ||
|
||
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/perl | ||
|
||
use Test::Pod; | ||
|
||
require './t/lib/common.pl'; | ||
my $program = program_name(__FILE__); | ||
|
||
pod_file_ok( $program, "Valid POD in <$program>" ); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
sanity_test(); | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
|
||
use JSON qw(decode_json); | ||
use Test::More; | ||
|
||
require './t/lib/common.pl'; | ||
|
||
my $program = program_name(); | ||
ok -e $program, "$program exists"; | ||
|
||
my $output = `"$^X" util/extract_metadata $program`; | ||
my $json = decode_json( $output ); | ||
|
||
subtest "required keys" => sub { | ||
my $this = $json->{$program}; | ||
my @keys = qw(Name Description Author License); | ||
|
||
ok( exists $this->{$_}, "has $_ key" ) for @keys; | ||
}; | ||
|
||
done_testing(); | ||
|
||
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/perl | ||
|
||
use Test::Pod; | ||
|
||
require './t/lib/common.pl'; | ||
my $program = program_name(__FILE__); | ||
|
||
pod_file_ok( $program, "Valid POD in <$program>" ); | ||
|
||
done_testing(); |
Oops, something went wrong.