summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2020-09-17 10:55:02 -0700
committerGitHub <noreply@github.com>2020-09-17 10:55:02 -0700
commit6116553a91b5da4fd877480bb27fc88b264b737f (patch)
tree0f96e01ec6e618fd012fa97a7b9bbcf4b3fb33d1 /scripts
parent9f7a053bf0ca3185336eb4616f88d85df573adbf (diff)
downloadbinaryen-6116553a91b5da4fd877480bb27fc88b264b737f.tar.gz
binaryen-6116553a91b5da4fd877480bb27fc88b264b737f.tar.bz2
binaryen-6116553a91b5da4fd877480bb27fc88b264b737f.zip
Improve testing on Windows (#3142)
This PR contains: - Changes that enable/disable tests on Windows to allow for better local testing. - Also changes many abort() into Fatal() when it is really just exiting on error. This is because abort() generates a dialog window on Windows which is not great in automated scripts. - Improvements to CMake to better work with the project in IDEs (VS).
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/fuzz_opt.py7
-rw-r--r--scripts/test/wasm_opt.py6
2 files changed, 12 insertions, 1 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py
index 3f79ec565..eddb33b21 100755
--- a/scripts/fuzz_opt.py
+++ b/scripts/fuzz_opt.py
@@ -916,7 +916,12 @@ if __name__ == '__main__':
mean = float(total_input_size) / counter
mean_of_squares = float(total_input_size_squares) / counter
stddev = math.sqrt(mean_of_squares - (mean ** 2))
- print('ITERATION:', counter, 'seed:', seed, 'size:', input_size, '(mean:', str(mean) + ', stddev:', str(stddev) + ')', 'speed:', counter / (time.time() - start_time), 'iters/sec, ', total_wasm_size / (time.time() - start_time), 'wasm_bytes/sec\n')
+ elapsed = max(0.000001, time.time() - start_time)
+ print('ITERATION:', counter, 'seed:', seed, 'size:', input_size,
+ '(mean:', str(mean) + ', stddev:', str(stddev) + ')',
+ 'speed:', counter / elapsed,
+ 'iters/sec, ', total_wasm_size / elapsed,
+ 'wasm_bytes/sec\n')
with open(raw_input_data, 'wb') as f:
f.write(bytes([random.randint(0, 255) for x in range(input_size)]))
assert os.path.getsize(raw_input_data) == input_size
diff --git a/scripts/test/wasm_opt.py b/scripts/test/wasm_opt.py
index 2c7d49eb7..d6441bd8d 100644
--- a/scripts/test/wasm_opt.py
+++ b/scripts/test/wasm_opt.py
@@ -159,6 +159,12 @@ def update_wasm_opt_tests():
print('\n[ checking wasm-opt passes... ]\n')
for t in shared.get_tests(shared.get_test_dir('passes'), ['.wast', '.wasm']):
print('..', os.path.basename(t))
+ # windows has some failures that need to be investigated:
+ # * ttf tests have different outputs - order of execution of params?
+ # * dwarf tests print windows slashes instead of unix
+ if ('translate-to-fuzz' in t or 'dwarf' in t) and \
+ shared.skip_if_on_windows('fuzz translation tests'):
+ continue
binary = t.endswith('.wasm')
base = os.path.basename(t).replace('.wast', '').replace('.wasm', '')
passname = base