citrun

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

commit fe8255440d34354949d6fa88001a86eeec2bfbe9
parent 80abfcd3ed6e9abfc1c4f2084187867934022c63
Author: Kyle Milz <kyle@0x30.net>
Date:   Wed, 28 Dec 2016 13:27:23 -0700

src: don't use CITRUN_SHARE in citrun_wrap anymore

Diffstat:
Msrc/Jamfile | 9---------
Msrc/inst_main.cc | 6++++++
Msrc/wrap.sh | 2+-
Mt/utils.pm | 5++++-
4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/Jamfile b/src/Jamfile @@ -1,12 +1,5 @@ SubDir TOP src ; -# Do a string replacement on the first argument. -actions ReplaceTokens -{ - sed -e s,%CITRUN_SHARE%,$(CITRUN_SHARE), -i.bak $(<) ; - rm $(<).bak -} - # # libcitrun.a # @@ -20,8 +13,6 @@ MakeLocate citrun_check citrun_wrap : $(LOCATE_SOURCE) ; Shell citrun_check : check.sh ; Shell citrun_wrap : wrap.sh ; -ReplaceTokens citrun_wrap ; - # # citrun_term # diff --git a/src/inst_main.cc b/src/inst_main.cc @@ -13,6 +13,7 @@ // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // +#include <cstring> // strcmp #include "inst_frontend.h" // InstFrontend @@ -21,6 +22,11 @@ main(int argc, char *argv[]) { int ret; + if (argc == 2 && (std::strcmp(argv[1], "--print-share") == 0)) { + std::cout << CITRUN_SHARE; + return 0; + } + InstFrontend main(argc, argv); main.process_cmdline(); diff --git a/src/wrap.sh b/src/wrap.sh @@ -4,5 +4,5 @@ if [[ ${1} = -* ]]; then exit 1 fi -export PATH="%CITRUN_SHARE%:$PATH" +export PATH="`citrun_inst --print-share`:$PATH" exec $@ diff --git a/t/utils.pm b/t/utils.pm @@ -2,15 +2,18 @@ use strict; use warnings; package t::tmpdir; +use Cwd; use File::Copy; use File::Temp qw( tempdir ); sub new { my $tmp_dir = tempdir( CLEANUP => 1 ); + $ENV{CITRUN_PROCDIR} = "$tmp_dir/procdir/"; + $ENV{PATH} = getcwd . "/src:" . $ENV{PATH}; copy($_, $tmp_dir) while (<t/program/*>); - system("src/citrun_wrap make -C $tmp_dir"); + system("make -C $tmp_dir"); return $tmp_dir; }