sbsv2/raptor/test/common/run_tests.py
branchwip
changeset 9 b211d87c390a
parent 3 e1eecf4d390d
child 135 0092642f198e
equal deleted inserted replaced
8:34d87ffcc373 9:b211d87c390a
   275 		for test in self.test_set:
   275 		for test in self.test_set:
   276 			test_number += 1
   276 			test_number += 1
   277 			# Save start/end times and save in dictionary for TMS
   277 			# Save start/end times and save in dictionary for TMS
   278 			start_time = datetime.datetime.now()
   278 			start_time = datetime.datetime.now()
   279 			try:
   279 			try:
   280 				print "\n\nTEST " + str(test_number) + "/" + \
   280 				test_number_text = "\n\nTEST " + str(test_number) + "/" + \
   281 						str(test_total) + ":\n",
   281 						str(test_total) + ":"
       
   282 				
       
   283 				if self.fail_total > 0:
       
   284 					test_number_text += "    So far " + str(self.fail_total) + \
       
   285 							" FAILED"
       
   286 				if self.exception_total > 0:
       
   287 					test_number_text += "    So far " + str(self.exception_total) + \
       
   288 							" ERRONEOUS"
       
   289 				
       
   290 				print test_number_text
       
   291 				
   282 				test_object = test.run()
   292 				test_object = test.run()
   283 				
   293 				
   284 				end_time = datetime.datetime.now()
   294 				end_time = datetime.datetime.now()
   285 				
   295 				
   286 				# Add leading 0s
   296 				# Add leading 0s
   328 				print (sys.exc_type.__name__ + ":"), \
   338 				print (sys.exc_type.__name__ + ":"), \
   329 						sys.exc_value, "\n", \
   339 						sys.exc_value, "\n", \
   330 						traceback.print_tb(sys.exc_traceback)
   340 						traceback.print_tb(sys.exc_traceback)
   331 				self.exception_total += 1
   341 				self.exception_total += 1
   332 				self.error_tests.append(str(self.test_set[test_number - 1]))
   342 				self.error_tests.append(str(self.test_set[test_number - 1]))
       
   343 								
   333 				
   344 				
   334 		if self.upload_location != None:
   345 		if self.upload_location != None:
   335 			self.create_csv()
   346 			self.create_csv()
   336 
   347 
   337 		end_time_stamp = datetime.datetime.now()
   348 		end_time_stamp = datetime.datetime.now()
   485 		else:
   496 		else:
   486 			options_dir = "'" + options.test_home + "' options file)"
   497 			options_dir = "'" + options.test_home + "' options file)"
   487 		print "\n(Tests run using %s" %options_dir
   498 		print "\n(Tests run using %s" %options_dir
   488 
   499 
   489 		# Summarise the entire test run
   500 		# Summarise the entire test run
   490 		if self.suitepattern and (self.test_total < 1):
   501 		if self.suitepattern and (len(suites) < 1):
   491 			print "\nNo suites matched specification '" + self.suitepattern + \
   502 			print "\nNo suites matched specification '" + self.suitepattern + \
   492 					"'\n"
   503 					"'\n"
   493 		else:
   504 		else:
   494 			print "Overall summary (%d suites, %d tests):" \
   505 			print "Overall summary (%d suites, %d tests):" \
   495 					%(len(suites), self.test_total)
   506 					%(len(suites), self.test_total)