commit b564619421cc2082b642b7b527dd05600c3fe108
parent 20caf79a22b2fe4711c5ca70c0bf4de6961cccc6
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Sun, 13 Mar 2016 12:49:03 -0600
test: use cwd instead of hardcoded path
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/SCV/Project.pm b/SCV/Project.pm
@@ -1,6 +1,7 @@
package SCV::Project;
use strict;
+use Cwd;
use File::Temp qw( tempdir );
use Test;
use IPC::Open3;
@@ -49,13 +50,15 @@ EOF
open( my $makefile_fh, ">", "$tmp_dir/Makefile" );
syswrite( $makefile_fh, $makefile );
+ my $cwd = getcwd;
+
# Hook $PATH so we run our "compiler" first
- $ENV{SCV_PATH} = "$ENV{HOME}/src/scv/instrument/compilers";
+ $ENV{SCV_PATH} = "$cwd/instrument/compilers";
$ENV{PATH} = "$ENV{SCV_PATH}:$ENV{PATH}";
# Link in the runtime
- $ENV{CFLAGS} = "-pthread -I/home/kyle/src/scv";
- $ENV{LDLIBS} = "-L/home/kyle/src/scv/lib -lscv -pthread";
+ $ENV{CFLAGS} = "-pthread -I$cwd";
+ $ENV{LDLIBS} = "-L$cwd/lib -lscv -pthread";
$ENV{LD_LIBRARY_PATH} = "lib";
my $ret = system( "make -C $tmp_dir" );