Author: bugman Date: Thu May 22 19:39:54 2014 New Revision: 23361 URL: http://svn.gna.org/viewcvs/relax?rev=23361&view=rev Log: Merged revisions 23360 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r23360 | bugman | 2014-05-22 19:39:22 +0200 (Thu, 22 May 2014) | 6 lines Improvement for the unit test printouts when run with the --time command line option. The full unit test name is now printed out, reverting to the old behaviour (prior to r21965). However the shortened test names are preserved for the other test suite categories. ........ Modified: branches/frame_order_cleanup/ (props changed) branches/frame_order_cleanup/test_suite/relax_test_runner.py branches/frame_order_cleanup/test_suite/test_suite_runner.py Propchange: branches/frame_order_cleanup/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu May 22 19:39:54 2014 @@ -1 +1 @@ -/trunk:1-23352 +/trunk:1-23360 Modified: branches/frame_order_cleanup/test_suite/relax_test_runner.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/relax_test_runner.py?rev=23361&r1=23360&r2=23361&view=diff ============================================================================== --- branches/frame_order_cleanup/test_suite/relax_test_runner.py (original) +++ branches/frame_order_cleanup/test_suite/relax_test_runner.py Thu May 22 19:39:54 2014 @@ -40,18 +40,21 @@ prepend the output to the failure and error reports normally generated by TextTestRunner. """ - def __init__(self, stream, descriptions, verbosity, timing=False): + def __init__(self, stream, descriptions, verbosity, timing=False, category=None): """Initialise the RelaxTestResult object with relax specific variables. @keyword timing: A flag which if True will enable timing of individual tests. @type timing: bool + @keyword category: The type of test being performed, to allow the printouts to be changed. This can be one of 'system', 'unit', 'gui', or 'verification'. the printout. + @type category: str """ # Normal setup. super(RelaxTestResult, self).__init__(stream, descriptions, verbosity) - # Store the timing flag. + # Store the timing flag and category. self.timing_flag = timing + self.category = category def addError(self, test, err): @@ -164,8 +167,9 @@ self.time -= time() # Change the test name. - test_name = test_name.split('.') - test_name = "%s.%s" % (test_name[-2], test_name[-1]) + if self.category != 'unit': + test_name = test_name.split('.') + test_name = "%s.%s" % (test_name[-2], test_name[-1]) # The printout. self.stream.write(' %7.2f s for %s\n' % (-self.time, test_name)) @@ -195,6 +199,9 @@ This runner is designed to catch STDOUT during the execution of each test and to prepend the output to the failure and error reports normally generated by TextTestRunner. """ + + # Variable for specifying the type of test being performed, to change the printout. + category = None def __init__(self, stream=sys.stderr, descriptions=True, verbosity=1, failfast=False, buffer=False, resultclass=None, timing=False): """Initialise the class, storing the timing flag. @@ -216,7 +223,7 @@ def _makeResult(self): """Override of the TextTestRunner._makeResult() method.""" - return RelaxTestResult(self.stream, self.descriptions, self.verbosity, timing=self.timing_flag) + return RelaxTestResult(self.stream, self.descriptions, self.verbosity, timing=self.timing_flag, category=self.category) Modified: branches/frame_order_cleanup/test_suite/test_suite_runner.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/test_suite_runner.py?rev=23361&r1=23360&r2=23361&view=diff ============================================================================== --- branches/frame_order_cleanup/test_suite/test_suite_runner.py (original) +++ branches/frame_order_cleanup/test_suite/test_suite_runner.py Thu May 22 19:39:54 2014 @@ -134,6 +134,7 @@ # Execute the GUI tests. gui_runner = GUI_test_runner() + self.runner.category = 'gui' self.gui_result = gui_runner.run(self.tests, runner=self.runner) # Clean up for the GUI, if not in GUI mode. @@ -167,6 +168,7 @@ # Run the tests. system_runner = System_test_runner() + self.runner.category = 'system' self.system_result = system_runner.run(self.tests, runner=self.runner) # Print out a summary of the test suite. @@ -186,6 +188,7 @@ # Run the tests. unit_runner = Unit_test_runner(root_path=status.install_path+os.sep+'test_suite'+os.sep+'unit_tests') + self.runner.category = 'unit' self.unit_result = unit_runner.run(runner=self.runner) # Print out a summary of the test suite. @@ -205,6 +208,7 @@ # Run the tests. verification_runner = Verification_test_runner() + self.runner.category = 'verification' self.verification_result = verification_runner.run(self.tests, runner=self.runner) # Print out a summary of the test suite.