summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xauto_update_tests.py2
-rwxr-xr-xcheck.py6
-rw-r--r--src/binaryen-shell.cpp36
3 files changed, 6 insertions, 38 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py
index 66557c0cf..86c4ebbeb 100755
--- a/auto_update_tests.py
+++ b/auto_update_tests.py
@@ -48,7 +48,7 @@ for t in sorted(os.listdir(os.path.join('test', 'passes'))):
if t.endswith('.wast'):
print '..', t
passname = os.path.basename(t).replace('.wast', '')
- cmd = [os.path.join('bin', 'binaryen-shell'), '--print-after', ('--' + passname if passname != 'O' else '-O'), os.path.join('test', 'passes', t)]
+ cmd = [os.path.join('bin', 'binaryen-shell'), ('--' + passname if passname != 'O' else '-O'), os.path.join('test', 'passes', t), '--print']
print ' ', ' '.join(cmd)
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
open(os.path.join('test', 'passes', passname + '.txt'), 'w').write(actual)
diff --git a/check.py b/check.py
index ba9d34871..7b1ec6835 100755
--- a/check.py
+++ b/check.py
@@ -259,7 +259,7 @@ for asm in tests:
# verify in wasm
if interpreter:
# remove imports, spec interpreter doesn't know what to do with them
- subprocess.check_call([os.path.join('bin', 'binaryen-shell'), '--remove-imports', '--print-after', os.path.join('test', wasm)], stdout=open('ztemp.wast', 'w'), stderr=subprocess.PIPE)
+ subprocess.check_call([os.path.join('bin', 'binaryen-shell'), '--remove-imports', '--print', os.path.join('test', wasm)], stdout=open('ztemp.wast', 'w'), stderr=subprocess.PIPE)
proc = subprocess.Popen([interpreter, 'ztemp.wast'], stderr=subprocess.PIPE)
out, err = proc.communicate()
if proc.returncode != 0:
@@ -286,7 +286,7 @@ for t in sorted(os.listdir(os.path.join('test', 'passes'))):
print '..', t
passname = os.path.basename(t).replace('.wast', '')
opt = '-O' if passname == 'O' else '--' + passname
- cmd = [os.path.join('bin', 'binaryen-shell'), '--print-after', opt, os.path.join('test', 'passes', t)]
+ cmd = [os.path.join('bin', 'binaryen-shell'), opt, os.path.join('test', 'passes', t), '--print']
print ' ', ' '.join(cmd)
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
fail_if_not_identical(actual, open(os.path.join('test', 'passes', passname + '.txt')).read())
@@ -297,7 +297,7 @@ for t in tests:
if t.endswith('.wast') and not t.startswith('spec'):
print '..', t
t = os.path.join('test', t)
- cmd = [os.path.join('bin', 'binaryen-shell'), t, '--print-before']
+ cmd = [os.path.join('bin', 'binaryen-shell'), t, '--print']
print ' ', ' '.join(cmd)
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
assert err.replace('printing before:', '').strip() == '', 'bad err:' + err
diff --git a/src/binaryen-shell.cpp b/src/binaryen-shell.cpp
index a9a9ea1da..6b27333cc 100644
--- a/src/binaryen-shell.cpp
+++ b/src/binaryen-shell.cpp
@@ -241,7 +241,6 @@ static void verify_result(Literal a, Literal b) {
static void run_asserts(size_t* i, bool* checked, AllocatingModule* wasm,
Element* root,
std::unique_ptr<SExpressionWasmBuilder>* builder,
- bool print_before, bool print_after,
Name entry) {
ShellExternalInterface* interface = nullptr;
ModuleInstance* instance = nullptr;
@@ -278,12 +277,6 @@ static void run_asserts(size_t* i, bool* checked, AllocatingModule* wasm,
if (id == ASSERT_INVALID) {
// a module invalidity test
AllocatingModule wasm;
- if (print_before || print_after) {
- Colors::bold(std::cout);
- std::cerr << "printing in module invalidity test:\n";
- Colors::normal(std::cout);
- printWasm(&wasm, std::cout);
- }
bool invalid = false;
std::unique_ptr<SExpressionWasmBuilder> builder;
try {
@@ -342,8 +335,6 @@ static void run_asserts(size_t* i, bool* checked, AllocatingModule* wasm,
//
int main(int argc, const char* argv[]) {
- bool print_before = false;
- bool print_after = false;
Name entry;
std::vector<std::string> passes;
@@ -368,14 +359,6 @@ int main(int argc, const char* argv[]) {
[&passes](Options*, const std::string&) {
for (const auto* p : default_passes) passes.push_back(p);
})
- .add("--print-before", "", "Print modules before processing them",
- Options::Arguments::Zero,
- [&print_before](Options*, const std::string&) {
- print_before = true;
- })
- .add("--print-after", "", "Print modules after processing them",
- Options::Arguments::Zero,
- [&print_after](Options*, const std::string&) { print_after = true; })
.add_positional("INFILE", Options::Arguments::One,
[](Options* o, const std::string& argument) {
o->extra["infile"] = argument;
@@ -408,13 +391,6 @@ int main(int argc, const char* argv[]) {
new SExpressionWasmBuilder(wasm, *root[i], [&]() { abort(); }, options.debug));
i++;
- if (print_before) {
- Colors::bold(std::cout);
- std::cerr << "printing before:\n";
- Colors::normal(std::cout);
- printWasm(&wasm, std::cout);
- }
-
MixedArena moreModuleAllocations;
if (passes.size() > 0) {
@@ -426,17 +402,9 @@ int main(int argc, const char* argv[]) {
passRunner.run(&wasm);
}
- if (print_after) {
- Colors::bold(std::cout);
- std::cerr << "printing after:\n";
- Colors::normal(std::cout);
- printWasm(&wasm, std::cout);
- }
- run_asserts(&i, &checked, &wasm, &root, &builder, print_before,
- print_after, entry);
+ run_asserts(&i, &checked, &wasm, &root, &builder, entry);
} else {
- run_asserts(&i, &checked, nullptr, &root, nullptr, print_before,
- print_after, entry);
+ run_asserts(&i, &checked, nullptr, &root, nullptr, entry);
}
}