azmeuk
azmeuk

Reputation: 4516

GLib testing framework detects only one test when it should detect several

I have a small test program that run several test, however the test report tells me that there is only one test passed.

The code

static void test_foo(void) {
  g_assert(TRUE);
}
static void test_bar(void) {
  g_assert(TRUE);
}
int main (int argc, char *argv[]) {
  g_test_init (&argc, &argv, NULL);

  g_test_add_func ("/foo/foo", test_foo);
  g_test_add_func ("/foo/bar", test_bar);

  return g_test_run ();
}

The result

============================================================================
Testsuite summary for foobar x.x.x
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================

Does it skip some test ? How to fix it ? Thank you

Upvotes: 1

Views: 73

Answers (1)

ptomato
ptomato

Reputation: 57910

Your Automake testing framework is detecting one test program, which contains two GLib tests. To see the results of the two tests, look at the .log file corresponding to your test executable.

If you write a custom test driver to get Automake to recognize each test separately, let me know -- I'm interested!

Upvotes: 2

Related Questions