| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 import hashlib | 3 import hashlib |
| 4 import operator | 4 import operator |
| 5 import os | 5 import os |
| 6 import shutil | 6 import shutil |
| 7 import stat | 7 import stat |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 import tempfile | 10 import tempfile |
| 11 | 11 |
| 12 | 12 |
| 13 def rel_to_abs(rel_path): | 13 def rel_to_abs(rel_path): |
| 14 return os.path.join(script_path, rel_path) | 14 return os.path.join(script_path, rel_path) |
| 15 | 15 |
| 16 java_exec = 'java -Xms1024m -server -XX:+TieredCompilation' | 16 java_exec = 'java -Xms1024m -server -XX:+TieredCompilation' |
| 17 tests_dir = 'tests' | 17 tests_dir = 'tests' |
| 18 jar_name = 'jsdoc-validator.jar' | 18 jar_name = 'jsdoc_validator.jar' |
| 19 script_path = os.path.dirname(os.path.abspath(__file__)) | 19 script_path = os.path.dirname(os.path.abspath(__file__)) |
| 20 tests_path = rel_to_abs(tests_dir) | 20 tests_path = rel_to_abs(tests_dir) |
| 21 validator_jar_file = rel_to_abs(jar_name) | 21 validator_jar_file = rel_to_abs(jar_name) |
| 22 golden_file = os.path.join(tests_path, 'golden.dat') | 22 golden_file = os.path.join(tests_path, 'golden.dat') |
| 23 | 23 |
| 24 test_files = [os.path.join(tests_path, f) for f in os.listdir(tests_path) if f.e
ndswith('.js') and os.path.isfile(os.path.join(tests_path, f))] | 24 test_files = [os.path.join(tests_path, f) for f in os.listdir(tests_path) if f.e
ndswith('.js') and os.path.isfile(os.path.join(tests_path, f))] |
| 25 | 25 |
| 26 validator_command = "%s -jar %s %s" % (java_exec, validator_jar_file, " ".join(s
orted(test_files))) | 26 validator_command = "%s -jar %s %s" % (java_exec, validator_jar_file, " ".join(s
orted(test_files))) |
| 27 | 27 |
| 28 | 28 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 else: | 66 else: |
| 67 with open(golden_file, 'rt') as golden: | 67 with open(golden_file, 'rt') as golden: |
| 68 golden_text = golden.read() | 68 golden_text = golden.read() |
| 69 if golden_text == result: | 69 if golden_text == result: |
| 70 print 'OK' | 70 print 'OK' |
| 71 else: | 71 else: |
| 72 print 'ERROR: Golden output mismatch' | 72 print 'ERROR: Golden output mismatch' |
| 73 | 73 |
| 74 if __name__ == '__main__': | 74 if __name__ == '__main__': |
| 75 main() | 75 main() |
| OLD | NEW |