mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 15:16:47 +02:00
simple py3 changes
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
from __future__ import print_function
|
||||
from glob import glob
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
import subprocess
|
||||
from glob import glob
|
||||
import optparse
|
||||
|
||||
VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes'
|
||||
@@ -28,29 +29,29 @@ def runAllTests( exe_path, use_valgrind=False ):
|
||||
test_proxy = TestProxy( exe_path, use_valgrind=use_valgrind )
|
||||
status, test_names = test_proxy.run( ['--list-tests'] )
|
||||
if not status:
|
||||
print >> sys.stderr, "Failed to obtain unit tests list:\n" + test_names
|
||||
print("Failed to obtain unit tests list:\n" + test_names, file=sys.stderr)
|
||||
return 1
|
||||
test_names = [name.strip() for name in test_names.strip().split('\n')]
|
||||
failures = []
|
||||
for name in test_names:
|
||||
print 'TESTING %s:' % name,
|
||||
print('TESTING %s:' % name, end=' ')
|
||||
succeed, result = test_proxy.run( ['--test', name] )
|
||||
if succeed:
|
||||
print 'OK'
|
||||
print('OK')
|
||||
else:
|
||||
failures.append( (name, result) )
|
||||
print 'FAILED'
|
||||
print('FAILED')
|
||||
failed_count = len(failures)
|
||||
pass_count = len(test_names) - failed_count
|
||||
if failed_count:
|
||||
print
|
||||
print()
|
||||
for name, result in failures:
|
||||
print result
|
||||
print '%d/%d tests passed (%d failure(s))' % (
|
||||
pass_count, len(test_names), failed_count)
|
||||
print(result)
|
||||
print('%d/%d tests passed (%d failure(s))' % (
|
||||
pass_count, len(test_names), failed_count))
|
||||
return 1
|
||||
else:
|
||||
print 'All %d tests passed' % len(test_names)
|
||||
print('All %d tests passed' % len(test_names))
|
||||
return 0
|
||||
|
||||
def main():
|
||||
|
Reference in New Issue
Block a user