>From 9676434e7cc5fc4d46a24e0fa1d2932583d86cae Mon Sep 17 00:00:00 2001 From: Ander Juaristi Date: Sat, 11 Apr 2015 17:06:23 +0200 Subject: [PATCH] Added support for GDB in Python tests. * base_test.py (gen_cmd_line): Check GDB_TESTS environment variable. --- testenv/test/base_test.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/testenv/test/base_test.py b/testenv/test/base_test.py index 34f0b14..3494319 100644 --- a/testenv/test/base_test.py +++ b/testenv/test/base_test.py @@ -101,12 +101,19 @@ class BaseTest: wget_options = '--debug --no-config %s' % self.wget_options valgrind = os.getenv("VALGRIND_TESTS", "") - if valgrind in ("", "0"): - cmd_line = '%s %s ' % (wget_path, wget_options) + gdb = os.getenv("GDB_TESTS", "") + + # GDB has precedence over Valgrind + # If both VALGRIND_TESTS and GDB_TESTS are defined, + # GDB will be executed. + if gdb == "1": + cmd_line = 'gdb --args %s %s ' % (wget_path, wget_options) elif valgrind == "1": cmd_line = 'valgrind --error-exitcode=301 --leak-check=yes --track-origins=yes %s %s ' % (wget_path, wget_options) - else: + elif valgrind not in ("", "0"): cmd_line = '%s %s %s ' % (os.getenv("VALGRIND_TESTS", ""), wget_path, wget_options) + else: + cmd_line = '%s %s ' % (wget_path, wget_options) for protocol, urls, domain in zip(self.protocols, self.urls, -- 1.9.1