citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit d40ac836e4c5fefa790dcc00a00ebaabb0823b9a
parent 44759110011221426b7e8a1e9e637904189b737f
Author: kyle <kyle@getaddrinfo.net>
Date:   Wed, 16 Mar 2016 19:59:22 -0600

wrap: add new test specific wrapper

Diffstat:
MSCV/Project.pm | 4++--
Awrap/scv_wrap_test | 23+++++++++++++++++++++++
2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/SCV/Project.pm b/SCV/Project.pm @@ -51,7 +51,7 @@ EOF my $cwd = getcwd; # Use the wrapper to make sure it works - my $ret = system( "wrap/scv_wrap make -C $tmp_dir" ); + my $ret = system( "wrap/scv_wrap_test make -C $tmp_dir" ); die "make failed: $ret\n" if ($ret); } @@ -71,7 +71,7 @@ sub run { my ($self, @args) = @_; my $tmp_dir = $self->{tmp_dir}; - $self->{pid} = open3(undef, undef, \*CHLD_ERR, "wrap/scv_wrap", "$tmp_dir/program", @args); + $self->{pid} = open3(undef, undef, \*CHLD_ERR, "wrap/scv_wrap_test", "$tmp_dir/program", @args); } sub kill { diff --git a/wrap/scv_wrap_test b/wrap/scv_wrap_test @@ -0,0 +1,23 @@ +#!/bin/sh + +# When running tests we always want to use the in-tree version of libraries, +# header files, instrument +CWD=`pwd` + +if ! test -d $CWD/instrument/compilers; then + echo error: compilers/ directory does not exist + exit 1 +fi + +export SCV_PATH="$CWD/instrument/compilers" +export PATH="$SCV_PATH:$PATH" + +export CFLAGS="-I$CWD/lib" +export LDFLAGS="-L$CWD/lib" + +export LDADD="-lscv" + +# Used for running programs +export LD_LIBRARY_PATH="$CWD/lib" + +exec $@