From b58910a05f4669b5e83607ae8079aad72aecacba Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sat, 22 Apr 2017 20:15:47 +0000 Subject: [PATCH] gctl_test.t: use make to compile gctl_test_helper instead of calling cc directly MFC after: 5 weeks Sponsored by: Dell EMC Isilon --- tools/regression/geom_gpt/Makefile | 8 ++++++++ tools/regression/geom_gpt/gctl_test.t | 10 ++++------ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 tools/regression/geom_gpt/Makefile diff --git a/tools/regression/geom_gpt/Makefile b/tools/regression/geom_gpt/Makefile new file mode 100644 index 000000000000..eb5a9659ff4f --- /dev/null +++ b/tools/regression/geom_gpt/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= gctl_test_helper +MAN= + +LIBADD+= geom + +.include diff --git a/tools/regression/geom_gpt/gctl_test.t b/tools/regression/geom_gpt/gctl_test.t index 3c019108a7ad..1e526fc227af 100644 --- a/tools/regression/geom_gpt/gctl_test.t +++ b/tools/regression/geom_gpt/gctl_test.t @@ -26,11 +26,6 @@ # # $FreeBSD$ -my $srcdir = `dirname $0`; -chomp $srcdir; - -my $cmd = "/tmp/gctl-$$"; -my $out = "$cmd.out"; my $disk = "/tmp/disk-$$"; my $mntpt = "/tmp/mount-$$"; @@ -132,11 +127,14 @@ if (exists $ENV{'TEST_VERBOSE'}) { } # Compile the driver... -my $st = system("cc -o $cmd -g $srcdir/gctl_test_helper.c -lgeom"); +my $st = system("make obj && make all"); if ($st != 0) { print "1..0 # SKIP error compiling test.c\n"; exit 0; } +chomp(my $cmd = `make '-V\${.OBJDIR}/\${PROG}'`); + +my $out = "/tmp/$cmd.out"; # Make sure we have permission to use gctl... if (`$cmd` =~ "^FAIL Permission denied") {