[monitoring-plugins] tests: get current directory the perl way

Sven Nierlein git at monitoring-plugins.org
Thu Jul 31 22:00:07 CEST 2014


 Module: monitoring-plugins
 Branch: master
 Commit: 559d11b1fbb4fee3b62b762fbbd3cfc6f138f37e
 Author: Sven Nierlein <Sven.Nierlein at consol.de>
   Date: Thu Jul 31 13:31:11 2014 +0200
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=559d11b

tests: get current directory the perl way

instead of hoping to have it in the environment. This at
least broke tests on solaris.

Signed-off-by: Sven Nierlein <Sven.Nierlein at consol.de>

---

 plugins/t/negate.t | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/plugins/t/negate.t b/plugins/t/negate.t
index f18acc3..9f0221a 100644
--- a/plugins/t/negate.t
+++ b/plugins/t/negate.t
@@ -6,6 +6,7 @@
 
 use strict;
 use Test::More;
+use Cwd;
 use NPTest;
 
 # 15 tests in the first part, 9 in timeout tests and 2 * 32 in the last loops
@@ -13,7 +14,7 @@ plan tests => 88;
 
 my $res;
 
-my $PWD = $ENV{PWD};
+my $PWD = getcwd();
 
 $res = NPTest->testCmd( "./negate" );
 is( $res->return_code, 3, "Not enough parameters");



More information about the Commits mailing list