Skip to content

Commit

Permalink
tests/run-tests: Make diff tool user configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
stinos authored and dpgeorge committed Apr 13, 2020
1 parent e880c8d commit f66c989
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/run-tests
Expand Up @@ -21,6 +21,9 @@ else:
# mpy-cross is only needed if --via-mpy command-line arg is passed
MPYCROSS = os.getenv('MICROPY_MPYCROSS', '../mpy-cross/mpy-cross')

# For diff'ing test output
DIFF = os.getenv('MICROPY_DIFF', 'diff -u')

# Set PYTHONIOENCODING so that CPython will use utf-8 on systems which set another encoding in the locale
os.environ['PYTHONIOENCODING'] = 'utf-8'

Expand Down Expand Up @@ -595,7 +598,7 @@ the last matching regex is used:
testbase = os.path.basename(exp)[:-4]
print()
print("FAILURE {0}".format(testbase))
os.system("diff -u {0}.exp {0}.out".format(testbase))
os.system("{0} {1}.exp {1}.out".format(DIFF, testbase))

sys.exit(0)

Expand Down

0 comments on commit f66c989

Please sign in to comment.