diff options
author | chriseth <chris@ethereum.org> | 2018-09-17 20:05:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-17 20:05:41 +0800 |
commit | f4ed315197c94580daa4e28dab16cb4a6c6dc11a (patch) | |
tree | 0b6d3181b45368d42fff5749d00a19a901f683e4 | |
parent | 5f4a2d2cad56dee3f7f350d65d24b98d1f4b2b07 (diff) | |
parent | 69673f5a4b9ceb7eb71fc338078ce17145b58685 (diff) | |
download | dexon-solidity-f4ed315197c94580daa4e28dab16cb4a6c6dc11a.tar.gz dexon-solidity-f4ed315197c94580daa4e28dab16cb4a6c6dc11a.tar.zst dexon-solidity-f4ed315197c94580daa4e28dab16cb4a6c6dc11a.zip |
Merge pull request #4916 from ethereum/isolate_tests_filenames
Include origin filename in the filenames generated by isolate_tests.py
-rwxr-xr-x | scripts/isolate_tests.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/isolate_tests.py b/scripts/isolate_tests.py index 06e9f9ea..8a9aa0a7 100755 --- a/scripts/isolate_tests.py +++ b/scripts/isolate_tests.py @@ -56,9 +56,10 @@ def extract_docs_cases(path): if re.search(r'^ [ ]*(pragma solidity|contract |library |interface )', test, re.MULTILINE) ] -def write_cases(tests): +def write_cases(f, tests): + cleaned_filename = f.replace(".","_").replace("-","_").replace(" ","_").lower() for test in tests: - open('test_%s.sol' % hashlib.sha256(test).hexdigest(), 'wb').write(test) + open('test_%s_%s.sol' % (hashlib.sha256(test).hexdigest(), cleaned_filename), 'wb').write(test) def extract_and_write(f, path): @@ -69,7 +70,7 @@ def extract_and_write(f, path): cases = [open(path, 'r').read()] else: cases = extract_test_cases(path) - write_cases(cases) + write_cases(f, cases) if __name__ == '__main__': path = sys.argv[1] |