commit 0e249a135d018d1cc6d4d9b49bfbd29350e5657c
parent bfe82376981307d7cc2eb21242705ee620965178
Author: Kyle Milz <kyle@0x30.net>
Date: Wed, 31 Aug 2016 20:52:35 -0600
test: move program one dir deeper
Diffstat:
10 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/t/rt_exectotals.t b/t/rt_exectotals.t
@@ -6,12 +6,13 @@ use warnings;
use POSIX;
use Test::More tests => 100;
use Time::HiRes qw( usleep );
+use test::program;
use test::shm;
my $child_pid = fork();
if ($child_pid == 0) {
# Child.
- exec ("test/program", "45") or die $!;
+ exec ("test/program/program", "45") or die $!;
}
# Give the runtime time to set up.
diff --git a/t/rt_header.t b/t/rt_header.t
@@ -5,9 +5,10 @@ use strict;
use warnings;
use Test::Cmd;
use Test::More tests => 14;
+use test::program;
use test::shm;
-my $test_prog = Test::Cmd->new( prog => 'test/program', workdir => '');
+my $test_prog = Test::Cmd->new( prog => 'test/program/program', workdir => '');
$test_prog->run( args => "1" );
is $? >> 8, 0, 'did test program exit 0';
diff --git a/t/rt_size.t b/t/rt_size.t
@@ -1,12 +1,13 @@
use strict;
use warnings;
use Test::More tests => 1;
+use test::program;
use test::shm;
#
# Test that the runtime shared file size is what we expect.
#
-system("test/program 1");
+system("test/program/program 1");
my $procfile = test::shm->new();
is($procfile->{size}, 16384, "size of memory file");
diff --git a/t/rt_translunit.t b/t/rt_translunit.t
@@ -6,9 +6,10 @@ use warnings;
use POSIX;
use Test::Cmd;
use Test::More tests => 7;
+use test::program;
use test::shm;
-my $test_prog = Test::Cmd->new( prog => 'test/program', workdir => '');
+my $test_prog = Test::Cmd->new( prog => 'test/program/program', workdir => '');
$test_prog->run( args => "10" );
is $? >> 8, 0, 'is test program exit code 0';
diff --git a/test/Jamfile b/test/Jamfile
@@ -1,6 +0,0 @@
-PROG_SRCS = one.c two.c three.c ;
-
-Depends one.o two.o three.o : ../src/citrun-inst ;
-Depends program : ../src/libcitrun.a ;
-
-Main program : one.c two.c three.c ;
diff --git a/test/program.pm b/test/program.pm
@@ -0,0 +1,8 @@
+package test::program;
+use strict;
+use warnings;
+
+# This module builds the test program when it's used.
+system("cd test/program && ../../src/citrun-wrap jam");
+
+1;
diff --git a/test/program/Jamfile b/test/program/Jamfile
@@ -0,0 +1,6 @@
+PROG_SRCS = one.c two.c three.c ;
+
+Depends one.o two.o three.o : ../../src/citrun-inst ;
+Depends program : ../../src/libcitrun.a ;
+
+Main program : one.c two.c three.c ;
diff --git a/test/one.c b/test/program/one.c
diff --git a/test/three.c b/test/program/three.c
diff --git a/test/two.c b/test/program/two.c