diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-01-23 10:08:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:44:04 -0500 |
commit | fe938ca91f6ead7371390ec01a232dde0565c42e (patch) | |
tree | 8549b24bdf4c94854909b5ef454cfc1223c1c070 /source4/pidl/tests/Util.pm | |
parent | d2bfa6611924a6f6c2bc0571f71414818d8968fd (diff) | |
download | samba-fe938ca91f6ead7371390ec01a232dde0565c42e.tar.gz samba-fe938ca91f6ead7371390ec01a232dde0565c42e.tar.bz2 samba-fe938ca91f6ead7371390ec01a232dde0565c42e.zip |
r20967: Allow pidl tests to work with gcov
(This used to be commit 9da63e362c9d590388c77d882f9dbf54b0aa78cc)
Diffstat (limited to 'source4/pidl/tests/Util.pm')
-rw-r--r-- | source4/pidl/tests/Util.pm | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/source4/pidl/tests/Util.pm b/source4/pidl/tests/Util.pm index cfa1422674..a406b868e1 100644 --- a/source4/pidl/tests/Util.pm +++ b/source4/pidl/tests/Util.pm @@ -72,9 +72,27 @@ SKIP: { $outfile = "./test-$name"; } + my $cflags = $ENV{CFLAGS}; + unless (defined($cflags)) { + $cflags = ""; + } + + my $ldflags = $ENV{LDFLAGS}; + unless (defined($ldflags)) { + $ldflags = ""; + } + + my $cc = $ENV{CC}; + unless (defined($cc)) { + $cc = "cc"; + } + my $flags = `pkg-config --libs --cflags ndr samba-config`; - open CC, "|cc -x c - -o $outfile $flags"; + my $cmd = "$cc $cflags -x c - -o $outfile $flags $ldflags"; + $cmd =~ s/\n//g; + print "$cmd\n"; + open CC, "|$cmd"; print CC "#define uint_t unsigned int\n"; print CC "#define _GNU_SOURCE\n"; print CC "#include <stdint.h>\n"; @@ -121,7 +139,6 @@ sub test_warnings($$) is($warnings, $exp); } - sub test_errors($$) { my ($exp, $code) = @_; |