Skip to content

Commit ca7c48f

Browse files
committed
tests: various distcheck work.
1 parent e8e09b6 commit ca7c48f

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

tests/Makefile.am

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ TEST_PROGS = test-libmongoc
1414

1515
TEST_CFLAGS = \
1616
-DMONGOC_COMPILATION \
17+
-DBINARY_DIR="\"$(srcdir)/tests/binary\"" \
1718
$(BSON_CFLAGS) \
1819
-I$(top_srcdir)/src/mongoc \
1920
-I$(top_builddir)/src/mongoc
@@ -102,20 +103,19 @@ test_sharded_cluster_SOURCES = \
102103
test_sharded_cluster_CFLAGS = $(TEST_CFLAGS)
103104
test_sharded_cluster_LDADD = $(TEST_LIBS)
104105

105-
test_certs: $(top_builddir)/tests/trust_dir/done
106+
test_certs: tests/trust_dir/done
106107

107108
tests/trust_dir/done: $(top_srcdir)/tests/make_ca.pl $(top_srcdir)/tests/trust_dir.cnf
108-
$< $(top_srcdir)/tests/trust_dir $(top_srcdir)/tests/trust_dir.cnf
109-
touch $(top_srcdir)/tests/trust_dir/done
109+
$< $(top_builddir)/tests/trust_dir $(top_srcdir)/tests/trust_dir.cnf
110+
touch $(top_builddir)/tests/trust_dir/done
110111

111-
if WITH_LIBBSON
112112
libbson_check:
113+
if WITH_LIBBSON
113114
@ $(MAKE) -C src/libbson check
114-
check: libbson_check test
115-
else
116-
check: test
117115
endif
118116

117+
check: libbson_check test abicheck
118+
119119
TEST_ARGS = -f -p
120120

121121
if ENABLE_SSL
@@ -126,8 +126,12 @@ endif
126126
@ for TEST_PROG in $(TEST_PROGS) ; do \
127127
./$$TEST_PROG $(TEST_ARGS) -F test.log; \
128128
done
129+
129130
if OS_LINUX
131+
abicheck:
130132
@ $(srcdir)/tests/abicheck.sh "$(srcdir)/src/libmongoc.symbols"
133+
else
134+
abicheck:
131135
endif
132136

133137
DISTCLEANFILES += test.log
@@ -146,7 +150,10 @@ EXTRA_DIST += \
146150
tests/binary/reply1.dat \
147151
tests/binary/reply2.dat \
148152
tests/binary/update1.dat \
153+
tests/certificates/ca.pem \
154+
tests/certificates/client.pem \
149155
tests/mock-server.c \
150156
tests/mock-server.h \
151157
tests/mongoc-tests.c \
152-
tests/mongoc-tests.h
158+
tests/mongoc-tests.h \
159+
tests/trust_dir.cnf

tests/test-mongoc-buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test_mongoc_buffer_basic (void)
1414
uint8_t *data = bson_malloc0(1024);
1515
ssize_t r;
1616

17-
stream = mongoc_stream_file_new_for_path ("tests/binary/reply1.dat", O_RDONLY, 0);
17+
stream = mongoc_stream_file_new_for_path (BINARY_DIR"/reply1.dat", O_RDONLY, 0);
1818
ASSERT(stream);
1919

2020
_mongoc_buffer_init(&buf, data, 1024, bson_realloc);

tests/test-mongoc-gridfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ test_create_from_stream (void)
154154

155155
mongoc_gridfs_drop (gridfs, &error);
156156

157-
stream = mongoc_stream_file_new_for_path ("tests/binary/gridfs.dat", O_RDONLY, 0);
157+
stream = mongoc_stream_file_new_for_path (BINARY_DIR"/gridfs.dat", O_RDONLY, 0);
158158
assert (stream);
159159

160160
file = mongoc_gridfs_create_file_from_stream (gridfs, stream, NULL);
@@ -196,7 +196,7 @@ test_read (void)
196196

197197
mongoc_gridfs_drop (gridfs, &error);
198198

199-
stream = mongoc_stream_file_new_for_path ("tests/binary/gridfs.dat", O_RDONLY, 0);
199+
stream = mongoc_stream_file_new_for_path (BINARY_DIR"/gridfs.dat", O_RDONLY, 0);
200200

201201
file = mongoc_gridfs_create_file_from_stream (gridfs, stream, NULL);
202202
assert (file);
@@ -301,7 +301,7 @@ test_stream (void)
301301

302302
mongoc_gridfs_drop (gridfs, &error);
303303

304-
in_stream = mongoc_stream_file_new_for_path ("tests/binary/gridfs.dat", O_RDONLY, 0);
304+
in_stream = mongoc_stream_file_new_for_path (BINARY_DIR"/gridfs.dat", O_RDONLY, 0);
305305

306306
file = mongoc_gridfs_create_file_from_stream (gridfs, in_stream, NULL);
307307
assert (file);

tests/test-mongoc-rpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ get_test_file (const char *filename,
1919
int fd;
2020

2121
bson_snprintf (real_filename, sizeof real_filename,
22-
"tests/binary/%s", filename);
22+
BINARY_DIR"/%s", filename);
2323

2424
#ifdef _WIN32
2525
fd = _open (real_filename, O_RDONLY | _O_BINARY);

tests/test-mongoc-stream.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test_buffered_basic (void)
1616
ssize_t r;
1717
char buf[16236];
1818

19-
stream = mongoc_stream_file_new_for_path ("tests/binary/reply2.dat", O_RDONLY, 0);
19+
stream = mongoc_stream_file_new_for_path (BINARY_DIR"/reply2.dat", O_RDONLY, 0);
2020
assert (stream);
2121

2222
/* buffered assumes ownership of stream */
@@ -42,7 +42,7 @@ test_buffered_oversized (void)
4242
ssize_t r;
4343
char buf[16236];
4444

45-
stream = mongoc_stream_file_new_for_path ("tests/binary/reply2.dat", O_RDONLY, 0);
45+
stream = mongoc_stream_file_new_for_path (BINARY_DIR"/reply2.dat", O_RDONLY, 0);
4646
assert (stream);
4747

4848
/* buffered assumes ownership of stream */

0 commit comments

Comments
 (0)