citrun

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

commit 1813388f4e203b5a62687049864ed9be271366ab
parent 3a6dd109b2c5f31052412786aa7926ac97dfd9c1
Author: Kyle Milz <kyle@0x30.net>
Date:   Tue, 30 Aug 2016 18:38:43 -0600

test: unlink shm file on destroy

Diffstat:
Mt/rt_exectotals.t | 3++-
Mtest/shm.pm | 8++++++--
2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/t/rt_exectotals.t b/t/rt_exectotals.t @@ -11,9 +11,10 @@ use test::shm; my $child_pid = fork(); if ($child_pid == 0) { # Child. - exec ("test/program", "45"); + exec ("test/program", "45") or die $!; } +# Give the runtime time to set up. sleep 1; my $shm = test::shm->new(); diff --git a/test/shm.pm b/test/shm.pm @@ -1,10 +1,10 @@ package test::shm; use strict; use warnings; -use Cwd; use POSIX; -$ENV{CITRUN_TOOLS} = cwd . '/src'; +# Triggers runtime to use alternate shm path. +$ENV{CITRUN_TOOLS} = 1; sub new { my ($class) = @_; @@ -84,4 +84,8 @@ sub xread { return $data; } +sub DESTROY { + unlink "procfile.shm"; +} + 1;