Skip to content

Commit

Permalink
Allow network tests to be enabled/disabled
Browse files Browse the repository at this point in the history
Use NETWORK_TESTING=0|1 to disable or enable tests that make
network connections. By default they are disabled, but are enabled
in the CI tests.

Resolves #30
  • Loading branch information
ugexe committed Sep 28, 2017
1 parent fad32eb commit 08b4516
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ perl6:
install:
- perl6 -v
script:
- prove -v -e 'perl6 -Ilib' t/
- NETWORK_TESTING=1 prove -v -e 'perl6 -I.' t/
sudo: false
2 changes: 1 addition & 1 deletion META6.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"perl" : "6.*",
"name" : "OpenSSL",
"version" : "0.1.14",
"version" : "0.1.15",
"author" : "github:sergot",
"description" : "OpenSSL bindings",
"depends" : [],
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ install:
build: off

test_script:
- prove -v -e "perl6 -Ilib" t/
- SET NETWORK_TESTING=1
- prove -v -e "perl6 -I." t/

shallow_clone: true
6 changes: 6 additions & 0 deletions t/02-socket.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ use Test;

plan 4;

unless %*ENV<NETWORK_TESTING> {
diag "NETWORK_TESTING was not set";
skip-rest("NETWORK_TESTING was not set");
exit;
}

check(fetch('google.com', '/'));

sub check($result) {
Expand Down
9 changes: 7 additions & 2 deletions t/15-issue-36.t
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/usr/bin/env perl6

use v6.c;

use OpenSSL;
use Test;
plan 4;

use OpenSSL;
unless %*ENV<NETWORK_TESTING> {
diag "NETWORK_TESTING was not set";
skip-rest("NETWORK_TESTING was not set");
exit;
}

my $ssl = OpenSSL.new(:client);

Expand Down

0 comments on commit 08b4516

Please sign in to comment.