-
Notifications
You must be signed in to change notification settings - Fork 854
Expand file tree
/
Copy pathtest_warnings.py
More file actions
22 lines (16 loc) · 1.07 KB
/
test_warnings.py
File metadata and controls
22 lines (16 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import subprocess
from scripts.test import shared
from . import utils
class WarningsText(utils.BinaryenTestCase):
def test_warn_on_no_passes(self):
err = shared.run_process(shared.WASM_OPT + [self.input_path('asyncify-pure.wat'), '-o', 'a.wasm'], stderr=subprocess.PIPE).stderr
self.assertIn('warning: no passes specified, not doing any work', err)
def test_warn_on_no_output(self):
err = shared.run_process(shared.WASM_OPT + [self.input_path('asyncify-pure.wat'), '-O1'], stderr=subprocess.PIPE).stderr
self.assertIn('warning: no output file specified, not emitting output', err)
def test_quiet_suppresses_warnings(self):
err = shared.run_process(shared.WASM_OPT + [self.input_path('asyncify-pure.wat'), '-q'], stderr=subprocess.PIPE).stderr
self.assertNotIn('warning', err)
def test_no_warn_on_print(self):
err = shared.run_process(shared.WASM_OPT + [self.input_path('asyncify-pure.wat'), '--print'], stderr=subprocess.PIPE).stderr
self.assertNotIn('warning: no output file specified, not emitting output', err)