Skip to content

Commit 1bf6b96

Browse files
author
Christian Hergert
committed
tests: add hook to specify if a test has been skipped.
This is totally janky, but so is the entire testing system.
1 parent 994c447 commit 1bf6b96

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/mongoc-tests.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ BSON_BEGIN_DECLS
5050
} while (0)
5151

5252

53+
static char *TEST_RESULT;
54+
55+
5356
static void
5457
run_test (const char *name,
5558
void (*func) (void))
@@ -60,12 +63,14 @@ run_test (const char *name,
6063
bson_int64_t usec;
6164
double format;
6265

66+
TEST_RESULT = "PASS";
67+
6368
fprintf(stdout, "%-42s : ", name);
6469
fflush(stdout);
6570
gettimeofday(&begin, NULL);
6671
func();
6772
gettimeofday(&end, NULL);
68-
fprintf(stdout, "PASS");
73+
fprintf(stdout, TEST_RESULT);
6974

7075
diff.tv_sec = end.tv_sec - begin.tv_sec;
7176
diff.tv_usec = usec = end.tv_usec - begin.tv_usec;

tests/test-mongoc-client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ test_mongoc_client_authenticate (void)
8888
client = mongoc_client_new (gTestUri);
8989
if (version_check (client, 2, 5, 0)) {
9090
MONGOC_DEBUG ("Skipping test, 2.5.x not yet implemented.");
91+
TEST_RESULT = "SKIP";
9192
mongoc_client_destroy (client);
9293
return;
9394
}

0 commit comments

Comments
 (0)