$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";
is($warnings, $exp);
}
-
sub test_errors($$)
{
my ($exp, $code) = @_;
} bla;
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct bla r;
uint8_t expected[] = { 0x0D, 0x00, 0xef, 0xbe };
DATA_BLOB expected_blob = { expected, 4 };
} bla;
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct bla r;
uint8_t expected[] = { 0x0D, 0x00, 0x00, 0x00, 0xef, 0xbe, 0xef, 0xbe };
DATA_BLOB expected_blob = { expected, 8 };
} bla;
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct bla r;
uint8_t expected[] = { 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xef, 0xbe, 0xef, 0xbe, 0xef, 0xbe, 0xef, 0xbe };
} bla;
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct bla r;
uint8_t expected[] = { 0x0D, 0xef, 0xbe };
DATA_BLOB expected_blob = { expected, 3 };
} blie;
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct blie r;
uint8_t data[] = { 0x01, 0x02 };
uint8_t expected[] = { 0x0D, 0x00, 0x0E };
[public] uint16 echo_TestRef([in] xstruct foo);
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
uint16_t v = 13;
struct echo_TestRef r;
r.in.foo.x = v;
',
'
uint16_t v = 13;
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
r.in.foo.x = &v;
[public] uint16 echo_TestRef([in] xstruct foo);
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
r.in.foo.x = NULL;
',
'
uint16_t v = 13;
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
r.in.foo.x = &v;
[public] uint16 echo_TestRef([in] xstruct foo);
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
r.in.foo.x = NULL;
[public] uint16 echo_TestRef([in] xstruct *foo);
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
struct xstruct s;
s.x = 13;
[public] uint16 echo_TestRef([in] xstruct *foo);
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
r.in.foo = NULL;
[public] uint16 echo_TestRef([in,ref] xstruct *foo);
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
struct xstruct s;
s.x = 13;
[public] uint16 echo_TestRef([in,ref] xstruct *foo);
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
r.in.foo = NULL;
[public] uint16 echo_TestRef([in,unique] xstruct *foo);
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
struct xstruct s;
s.x = 13;
[public] uint16 echo_TestRef([in,unique] xstruct *foo);
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
r.in.foo = NULL;
'
[public] void echo_TestRef([in] uint16 **foo);
',
-' struct ndr_push *ndr = ndr_push_init();
+' struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
uint16_t v = 13;
uint16_t *pv = &v;
'
[public] void echo_TestRef([in] uint16 **foo);
',
-' struct ndr_push *ndr = ndr_push_init();
+' struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
uint16_t *pv = NULL;
r.in.foo = &pv;
'
[public] void echo_TestRef([in] uint16 **foo);
',
-' struct ndr_push *ndr = ndr_push_init();
+' struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
r.in.foo = NULL;
'
[public] void echo_TestRef([in,ref] uint16 **foo);
',
-' struct ndr_push *ndr = ndr_push_init();
+' struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
uint16_t v = 13;
uint16_t *pv = &v;
'
[public] void echo_TestRef([in,ref] uint16 **foo);
',
-' struct ndr_push *ndr = ndr_push_init();
+' struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
uint16_t *pv = NULL;
r.in.foo = &pv;
'
[public] void echo_TestRef([in,ref] uint16 **foo);
',
-' struct ndr_push *ndr = ndr_push_init();
+' struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
r.in.foo = NULL;
'
[public] void echo_TestRef([in,ignore] uint16 *foo, [in] uint16 *bar);
',
-' struct ndr_push *ndr = ndr_push_init();
+' struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct echo_TestRef r;
uint16_t v = 10;
r.in.foo = &v;
};
',
'
- struct ndr_push *ndr = ndr_push_init();
+ struct ndr_push *ndr = ndr_push_init_ctx(NULL);
struct bla r;
uint8_t expected[] = { 0x0D };
DATA_BLOB expected_blob = { expected, 1 };
#!/bin/sh
+ $SRCDIR/script/tests/test_pidl.sh
$SRCDIR/script/tests/test_ejs.sh $DOMAIN $USERNAME $PASSWORD
$SRCDIR/script/tests/test_ldap.sh $SERVER $USERNAME $PASSWORD
$SRCDIR/script/tests/test_nbt.sh $SERVER
$SRCDIR/script/tests/test_posix.sh //$SERVER/tmp $USERNAME $PASSWORD ""
$SRCDIR/script/tests/test_local.sh
$SRCDIR/script/tests/test_blackbox.sh $SERVER $USERNAME $PASSWORD $DOMAIN $PREFIX
- $SRCDIR/script/tests/test_pidl.sh
$SRCDIR/script/tests/test_simple.sh //$SERVER/simple $USERNAME $PASSWORD ""
@$(MAKE) test \
HOSTCC_CFLAGS="$(HOSTCC_CFLAGS) $(GCOV_FLAGS)" \
CFLAGS="$(CFLAGS) $(GCOV_FLAGS)" \
- LDFLAGS="$(LDFLAGS) $(GCOV_FLAGS) $(GCOV_LIBS)"
+ LDFLAGS="$(LDFLAGS) $(GCOV_FLAGS) $(GCOV_LIBS)" \
+ SHLD_FLAGS="$(SHLD_FLAGS) $(GCOV_FLAGS) $(GCOV_LIBS)"
gcov: test_cov
for I in $(sort $(dir $(ALL_OBJS))); \