[Pkg-voip-commits] [bctoolbox] 22/57: Do not list 'Skip' tests unless --all is specified

daniel at gnoutcheff.name daniel at gnoutcheff.name
Thu Mar 30 04:31:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

gnoutchd-guest pushed a commit to branch debian/sid
in repository bctoolbox.

commit 1bc2e2206ba2504eead0266e2f0770be747cfff7
Author: Sylvain Berfini <sylvain.berfini at belledonne-communications.com>
Date:   Mon Jan 2 12:42:47 2017 +0100

    Do not list 'Skip' tests unless --all is specified
---
 src/tester.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/tester.c b/src/tester.c
index 6d51d07..1b5d92e 100644
--- a/src/tester.c
+++ b/src/tester.c
@@ -193,10 +193,23 @@ int bc_tester_nb_suites(void) {
 }
 
 const char * bc_tester_test_name(const char *suite_name, int test_index) {
+	test_suite_t *suite = NULL;
+	size_t j = 0;
+	bool_t skip = FALSE;
+	
 	int suite_index = bc_tester_suite_index(suite_name);
 	if ((suite_index < 0) || (suite_index >= nb_test_suites)) return NULL;
-	if (test_index >= test_suite[suite_index]->nb_tests) return NULL;
-	return test_suite[suite_index]->tests[test_index].name;
+	suite = test_suite[suite_index];
+	if (test_index >= suite->nb_tests) return NULL;
+	
+	for (j = 0; j < (sizeof(suite->tests[test_index].tags) / sizeof(suite->tests[test_index].tags[0])); j++) {
+		if ((suite->tests[test_index].tags[j] != NULL) && (strcasecmp("Skip", suite->tests[test_index].tags[j]) == 0) && (run_skipped_tests == 0)) {
+			skip = TRUE;
+		}
+	}
+	if (skip) return NULL;
+	
+	return suite[test_index].name;
 }
 
 int bc_tester_nb_tests(const char *suite_name) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/bctoolbox.git



More information about the Pkg-voip-commits mailing list