Skip to content

Commit

Permalink
Merge branch 'chorny-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
techman83 committed Jul 23, 2017
2 parents e994a3b + af5005b commit 1ecc899
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
6 changes: 4 additions & 2 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ fist_version = 0.01

[MetaJSON]
[MetaResources]
repository.url = git://github.com/techman83/WebService-Strava3
repository.web = https://github.com/techman83/WebService-Strava3
repository.url = git://github.com/techman83/WebService-Freshservice
repository.web = https://github.com/techman83/WebService-Freshservice
repository.type = git

[@Basic]
Expand All @@ -27,6 +27,8 @@ stopwords = attr
[AutoPrereqs]
skip = ^Dancer2
skip = ^Storable
skip = ^Win32::Process
skip = ^Win32

[OurPkgVersion]
[PodWeaver]
Expand Down
26 changes: 22 additions & 4 deletions t/lib/WebService/Freshservice/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ method test_with_auth($test, $number_tests) {

method test_with_dancer($test, $number_tests) {
SKIP: {
if ($^O eq 'MSWin32') {
eval {
require Win32::Process;
require Win32;
};
skip 'These tests are for cached testing and require Win32::Process on Windows.', $number_tests if ($@);
}
eval {
require Dancer2;
require Storable;
Expand All @@ -51,10 +58,21 @@ method test_with_dancer($test, $number_tests) {
skip 'These tests are for cached testing and require Dancer2, Storable + Scalar::Util.', $number_tests if ($@);
skip 'Dancer2 >= 0.200000 required for these tests.', $number_tests unless $Dancer2::VERSION >= 0.200000;

my $pid = fork();

if (!$pid) {
exec($^X,"t/bin/cached_api.pl");
my ($win32_processobj, $pid);
if ($^O eq 'MSWin32') {
Win32::Process::Create($win32_processobj,
"$^X",
"$^X t/bin/cached_api.pl",
0,
32 + 134217728, #NORMAL_PRIORITY_CLASS + CREATE_NO_WINDOW
".") || die $^E;
$pid = $win32_processobj->GetProcessID();
} else {
$pid = fork();

if (!$pid) {
exec($^X,"t/bin/cached_api.pl");
}
}

# Allow some time for the instance to spawn. TODO: Make this smarter
Expand Down

0 comments on commit 1ecc899

Please sign in to comment.