Skip to content

Commit

Permalink
Fixing a case where tests fail when the module is installed. Thanks t…
Browse files Browse the repository at this point in the history
…o ppisar for GH#9
  • Loading branch information
david-dick committed Jan 3, 2025
1 parent 30e4ce7 commit 0f7c6f3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,25 @@ jobs:
cpanm --installdeps .
cpanm Test::CheckManifest
# RELEASE_TESTING is not enabled as some of the tests take way too long (more than 30 minutes)
- name: Run tests under gmake (on windows)
if: ${{ startsWith(matrix.runner, 'windows-') }}
env:
RELEASE_TESTING: 1
run: |
perl Makefile.PL
gmake
gmake test
gmake install
gmake test
- name: Run tests under make (not windows)
if: ${{ ! startsWith(matrix.runner, 'windows-') }}
env:
RELEASE_TESTING: 1
run: |
perl Makefile.PL
make
make test
make install
make test
- name: Run release tests
env:
RELEASE_TESTING: 1
run: |
prove t/manifest.t
5 changes: 3 additions & 2 deletions t/core_partial_read.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use Carp();
use English qw( -no_match_vars );
use Exporter();
use XSLoader();
use constant;

SKIP: {
if ($^O eq 'MSWin32') {
Expand All @@ -17,9 +18,9 @@ SKIP: {
*CORE::GLOBAL::read = sub { return 0 };
*CORE::GLOBAL::sysread = sub { return 0 };
use warnings;
require POSIX;
my $required_error_message = quotemeta "Only read 0 bytes from";
@INC = grep !/blib\/arch/, @INC; # making sure we're testing pure perl version
require FileHandle;
@INC = qw(blib/lib); # making sure we're testing pure perl version
require Crypt::URandom;
my $generated = 0;
eval {
Expand Down
4 changes: 3 additions & 1 deletion t/core_read.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use Carp();
use English qw( -no_match_vars );
use Exporter();
use XSLoader();
use constant;
BEGIN {
if ($^O eq 'MSWin32') {
require Win32;
Expand Down Expand Up @@ -37,7 +38,8 @@ SKIP: {
use warnings;
require POSIX;
my $required_error_message = q[(?:] . (quotemeta POSIX::strerror(POSIX::EACCES())) . q[|Permission[ ]denied)];
@INC = grep !/blib\/arch/, @INC; # making sure we're testing pure perl version
require FileHandle;
@INC = qw(blib/lib); # making sure we're testing pure perl version
require Crypt::URandom;
my $generated = 0;
eval {
Expand Down
4 changes: 3 additions & 1 deletion t/core_sysopen.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use Carp();
use English qw( -no_match_vars );
use Exporter();
use XSLoader();
use constant;

SKIP: {
if ($^O eq 'MSWin32') {
Expand All @@ -18,7 +19,8 @@ SKIP: {
use warnings;
require POSIX;
my $required_error_message = q[(?:] . (quotemeta POSIX::strerror(POSIX::EACCES())) . q[|Permission[ ]denied)];
@INC = grep !/blib\/arch/, @INC; # making sure we're testing pure perl version
require FileHandle;
@INC = qw(blib/lib); # making sure we're testing pure perl version
require Crypt::URandom;
my $generated = 0;
eval {
Expand Down
12 changes: 11 additions & 1 deletion t/pp.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ use Carp();
use English qw( -no_match_vars );
use Exporter();
use XSLoader();
@INC = grep !/blib\/arch/, @INC; # making sure we're testing pure perl version
use constant;
BEGIN {
if ($^O eq 'MSWin32') {
require Win32;
require Win32::API;
require Win32::API::Type;
} else {
require FileHandle;
}
}
@INC = qw(blib/lib); # making sure we're testing pure perl version
require Crypt::URandom;

foreach my $correct (qw(500000 500 50)) {
Expand Down

0 comments on commit 0f7c6f3

Please sign in to comment.