gctl_test.t: use make to compile gctl_test_helper instead of calling cc directly

MFC after:	5 weeks
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Enji Cooper 2017-04-22 20:15:47 +00:00
parent e02a067a1a
commit b58910a05f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=317292
2 changed files with 12 additions and 6 deletions

View File

@ -0,0 +1,8 @@
# $FreeBSD$
PROG= gctl_test_helper
MAN=
LIBADD+= geom
.include <bsd.prog.mk>

View File

@ -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") {