Skip to content
Snippets Groups Projects
Commit 792a4370 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Added not testable status code (refs #20453).

parent d644fafd
No related branches found
No related tags found
No related merge requests found
......@@ -157,27 +157,30 @@ class Tester():
for name, description, command in tests:
log('\033[1;95m-- Test "%s" --\033[0;0m' % name)
# Run test
try:
p = subprocess.Popen(command, stdin=sys.stdin, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if out:
log(out.decode('utf-8').strip())
if err:
log(err.decode('utf-8').strip())
if p.returncode != 0:
raise Exception('Command exited with code %s.' % p.returncode)
except Exception as e:
exit_code = 1
log(e)
results.append((name, description, command, False))
p = subprocess.Popen(command, stdin=sys.stdin, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if out:
log(out.decode('utf-8').strip())
if err:
log(err.decode('utf-8').strip())
if p.returncode == 0:
success = True
elif p.returncode == 2:
success = None
else:
results.append((name, description, command, True))
success = False
exit_code = 1
log('Command exited with code %s.' % p.returncode)
results.append((name, description, command, success))
# Display results
log('\nTests results:')
html_report = '<table border="1">'
html_report += '\n<tr><th>Test</th><th>Result</th><th>Description</th></tr>'
for name, description, command, success in results:
if success:
if success is None:
html_result = '<span style="color: blue;">not testable</span>'
term_result = '\033[94mnot testable\033[0m'
elif success:
html_result = '<span style="color: green;">success</span>'
term_result = '\033[92msuccess\033[0m'
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment