From 88b11b50e5f26432917579a8b2ec0749bbf0c2fa Mon Sep 17 00:00:00 2001 From: Chris Angelico Date: Fri, 6 Jun 2014 07:41:30 +1000 Subject: [PATCH 1/2] Figure out the test_name before using it (significant only to Travis skips) --- tests/run-tests | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/run-tests b/tests/run-tests index 1e6dd50538..15c2cbbf5c 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -33,6 +33,9 @@ def run_tests(pyb, tests): skip_travis_tests = set(['basics/memoryerror.py']) for test_file in tests: + test_basename = os.path.basename(test_file) + test_name = os.path.splitext(test_basename)[0] + if running_under_travis and test_file in skip_travis_tests: print("skip ", test_file) skipped_tests.append(test_name) @@ -68,9 +71,6 @@ def run_tests(pyb, tests): except pyboard.PyboardError: output_mupy = b'CRASH' - test_basename = os.path.basename(test_file) - test_name = os.path.splitext(test_basename)[0] - if output_mupy == b'SKIP\n': print("skip ", test_file) skipped_tests.append(test_name) From 047db2299cf8249a745ab3ff192498ce3657721a Mon Sep 17 00:00:00 2001 From: Chris Angelico Date: Fri, 6 Jun 2014 07:45:55 +1000 Subject: [PATCH 2/2] Turn the Travis CI test skipping mechanism into something more generic --- tests/run-tests | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/run-tests b/tests/run-tests index 15c2cbbf5c..866e5a14cc 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -27,16 +27,17 @@ def run_tests(pyb, tests): failed_tests = [] skipped_tests = [] - running_under_travis = os.getenv('TRAVIS') == 'true' + skip_tests = set() - # Set of tests that we shouldn't run under Travis CI - skip_travis_tests = set(['basics/memoryerror.py']) + # Some tests shouldn't be run under Travis CI + if os.getenv('TRAVIS') == 'true': + skip_tests.add('basics/memoryerror.py') for test_file in tests: test_basename = os.path.basename(test_file) test_name = os.path.splitext(test_basename)[0] - if running_under_travis and test_file in skip_travis_tests: + if test_file in skip_tests: print("skip ", test_file) skipped_tests.append(test_name) continue