Skip to content

Commit bb836ec

Browse files
committed
CDRIVER-497 tests can use RS connection string
Use MONGOC_TEST_HOST to find a host, then call ismaster to discover whether it's an RS or not.
1 parent e0290b9 commit bb836ec

File tree

5 files changed

+351
-87
lines changed

5 files changed

+351
-87
lines changed

tests/TestSuite.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
#include <bson.h>
18+
#include <mongoc.h>
1819

1920
#include <assert.h>
2021
#include <fcntl.h>
@@ -46,6 +47,7 @@
4647
# include <sys/time.h>
4748
#endif
4849

50+
#include "test-libmongoc.h"
4951
#include "TestSuite.h"
5052

5153

@@ -521,6 +523,7 @@ TestSuite_PrintJsonHeader (TestSuite *suite, /* IN */
521523

522524
fprintf (stream,
523525
"{\n"
526+
" \"uri\": \"%s\",\n"
524527
" \"host\": {\n"
525528
" \"sysname\": \"Windows\",\n"
526529
" \"release\": \"%ld.%ld (%ld)\",\n"
@@ -535,6 +538,7 @@ TestSuite_PrintJsonHeader (TestSuite *suite, /* IN */
535538
" \"fork\": \"%s\"\n"
536539
" },\n"
537540
" \"tests\": [\n",
541+
test_framework_get_uri_str (),
538542
major_version, minor_version, build,
539543
si.dwProcessorType,
540544
si.dwPageSize,
@@ -561,6 +565,7 @@ TestSuite_PrintJsonHeader (TestSuite *suite, /* IN */
561565

562566
fprintf (stream,
563567
"{\n"
568+
" \"uri\": \"%s\",\n"
564569
" \"host\": {\n"
565570
" \"sysname\": \"%s\",\n"
566571
" \"release\": \"%s\",\n"
@@ -575,6 +580,7 @@ TestSuite_PrintJsonHeader (TestSuite *suite, /* IN */
575580
" \"fork\": \"%s\"\n"
576581
" },\n"
577582
" \"tests\": [\n",
583+
test_framework_get_uri_str (),
578584
u.sysname,
579585
u.release,
580586
u.machine,

0 commit comments

Comments
 (0)