From: Andrew Bartlett Date: Mon, 5 Feb 2024 02:28:50 +0000 (+1300) Subject: ldb: Prepare ldb tests for subunit output X-Git-Tag: tdb-1.4.11~1618 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c16618ee3c4905df7554144f40a87edb89246db;p=thirdparty%2Fsamba.git ldb: Prepare ldb tests for subunit output These tests now print subunit rather than the default output as this is what the Samba selftest system needs. Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/lib/ldb/tests/ldb_filter_attrs_in_place_test.c b/lib/ldb/tests/ldb_filter_attrs_in_place_test.c index bf370164191..d3da29f4e9f 100644 --- a/lib/ldb/tests/ldb_filter_attrs_in_place_test.c +++ b/lib/ldb/tests/ldb_filter_attrs_in_place_test.c @@ -936,5 +936,7 @@ int main(int argc, const char **argv) teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/ldb_filter_attrs_test.c b/lib/ldb/tests/ldb_filter_attrs_test.c index 291350afa6e..da3acd3fb5e 100644 --- a/lib/ldb/tests/ldb_filter_attrs_test.c +++ b/lib/ldb/tests/ldb_filter_attrs_test.c @@ -985,5 +985,7 @@ int main(int argc, const char **argv) teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/ldb_key_value_sub_txn_test.c b/lib/ldb/tests/ldb_key_value_sub_txn_test.c index 1eafd2d79e9..0b7c0240ec9 100644 --- a/lib/ldb/tests/ldb_key_value_sub_txn_test.c +++ b/lib/ldb/tests/ldb_key_value_sub_txn_test.c @@ -840,5 +840,7 @@ int main(int argc, const char **argv) teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/ldb_key_value_test.c b/lib/ldb/tests/ldb_key_value_test.c index 97f717b5ee0..7bbfc7925bf 100644 --- a/lib/ldb/tests/ldb_key_value_test.c +++ b/lib/ldb/tests/ldb_key_value_test.c @@ -384,5 +384,7 @@ int main(int argc, const char **argv) teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/ldb_kv_ops_test.c b/lib/ldb/tests/ldb_kv_ops_test.c index b84ed0c146f..6badff98cfb 100644 --- a/lib/ldb/tests/ldb_kv_ops_test.c +++ b/lib/ldb/tests/ldb_kv_ops_test.c @@ -1815,5 +1815,7 @@ int main(int argc, const char **argv) teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/ldb_lmdb_free_list_test.c b/lib/ldb/tests/ldb_lmdb_free_list_test.c index 246fdc71e6b..99505ce7b55 100644 --- a/lib/ldb/tests/ldb_lmdb_free_list_test.c +++ b/lib/ldb/tests/ldb_lmdb_free_list_test.c @@ -657,5 +657,7 @@ int main(int argc, const char **argv) test_free_list_stale_reader, setup, teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/ldb_lmdb_test.c b/lib/ldb/tests/ldb_lmdb_test.c index 798a1916281..5fa4fbb5587 100644 --- a/lib/ldb/tests/ldb_lmdb_test.c +++ b/lib/ldb/tests/ldb_lmdb_test.c @@ -586,5 +586,7 @@ int main(int argc, const char **argv) ldbtest_teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/ldb_match_test.c b/lib/ldb/tests/ldb_match_test.c index 1bb56d072d9..ad00457aa65 100644 --- a/lib/ldb/tests/ldb_match_test.c +++ b/lib/ldb/tests/ldb_match_test.c @@ -309,5 +309,7 @@ int main(int argc, const char **argv) teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/ldb_mod_op_test.c b/lib/ldb/tests/ldb_mod_op_test.c index f620fc1357b..be4f458d27f 100644 --- a/lib/ldb/tests/ldb_mod_op_test.c +++ b/lib/ldb/tests/ldb_mod_op_test.c @@ -4720,5 +4720,7 @@ int main(int argc, const char **argv) cmocka_set_test_filter(argv[1]); } + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/ldb_msg.c b/lib/ldb/tests/ldb_msg.c index 31786a9a318..207c01a3051 100644 --- a/lib/ldb/tests/ldb_msg.c +++ b/lib/ldb/tests/ldb_msg.c @@ -376,5 +376,7 @@ int main(int argc, const char **argv) ldb_msg_teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/ldb_no_lmdb_test.c b/lib/ldb/tests/ldb_no_lmdb_test.c index be23d744004..4fca6634d59 100644 --- a/lib/ldb/tests/ldb_no_lmdb_test.c +++ b/lib/ldb/tests/ldb_no_lmdb_test.c @@ -155,5 +155,7 @@ int main(int argc, const char **argv) ldbtest_teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/ldb_tdb_test.c b/lib/ldb/tests/ldb_tdb_test.c index 64e5983e2be..c7968e50e2e 100644 --- a/lib/ldb/tests/ldb_tdb_test.c +++ b/lib/ldb/tests/ldb_tdb_test.c @@ -385,5 +385,7 @@ int main(int argc, const char **argv) ldbtest_teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/lldb_ldap.c b/lib/ldb/tests/lldb_ldap.c index eea9f22f6b9..c5404f189b3 100644 --- a/lib/ldb/tests/lldb_ldap.c +++ b/lib/ldb/tests/lldb_ldap.c @@ -101,5 +101,7 @@ int main(int argc, const char **argv) lldb_msg_teardown), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/test_ldb_dn.c b/lib/ldb/tests/test_ldb_dn.c index 6bf621a1d45..61c0e825390 100644 --- a/lib/ldb/tests/test_ldb_dn.c +++ b/lib/ldb/tests/test_ldb_dn.c @@ -208,7 +208,7 @@ static void test_ldb_dn_explode(void **state) /* comp nums are set by explode */ result = ldb_dn_validate(dn); - print_error("test %zu «%s»: res %i lin «%s» ext «%s»\n", + print_error("string under test (%zu) «%s»: res %i lin «%s» ext «%s»\n", i, tests[i].strdn, result, linear, ext_linear); assert_true(result == tests[i].explode_result); @@ -228,5 +228,7 @@ int main(void) { cmocka_unit_test(test_ldb_dn_explode), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); + return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/lib/ldb/tests/test_ldb_qsort.c b/lib/ldb/tests/test_ldb_qsort.c index 663cf0e7564..baaad7afe92 100644 --- a/lib/ldb/tests/test_ldb_qsort.c +++ b/lib/ldb/tests/test_ldb_qsort.c @@ -61,5 +61,6 @@ int main(void) { cmocka_unit_test(test_ldb_qsort), }; + cmocka_set_message_output(CM_OUTPUT_SUBUNIT); return cmocka_run_group_tests(tests, NULL, NULL); }