mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Include origin filename in the filenames generated by isolate_tests.py.
This commit is contained in:
parent
c57a60833d
commit
69673f5a4b
@ -56,9 +56,10 @@ def extract_docs_cases(path):
|
|||||||
if re.search(r'^ [ ]*(pragma solidity|contract |library |interface )', test, re.MULTILINE)
|
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:
|
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):
|
def extract_and_write(f, path):
|
||||||
@ -69,7 +70,7 @@ def extract_and_write(f, path):
|
|||||||
cases = [open(path, 'r').read()]
|
cases = [open(path, 'r').read()]
|
||||||
else:
|
else:
|
||||||
cases = extract_test_cases(path)
|
cases = extract_test_cases(path)
|
||||||
write_cases(cases)
|
write_cases(f, cases)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
path = sys.argv[1]
|
path = sys.argv[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user