This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
SYN SYN
[perl5.git] / t / lib / hostname.t
index 30dcf0f..85a04cd 100755 (executable)
@@ -2,7 +2,12 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    unshift @INC, '../lib';
+    @INC = '../lib';
+    require Config; import Config;
+    if ($Config{'extensions'} !~ /\bSys\/Hostname\b/) {
+      print "1..0 # Skip: Sys::Hostname was not built\n";
+      exit 0;
+    }
 }
 
 use Sys::Hostname;
@@ -15,5 +20,6 @@ if ($@) {
     print "1..0\n" if $@ =~ /Cannot get host name/;
 } else {
     print "1..1\n";
+    print "# \$host = `$host'\n";
     print "ok 1\n";
 }