summaryrefslogtreecommitdiff
path: root/test/lit/help/wasm-reduce.test
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2021-07-07 15:46:17 +0000
committerGitHub <noreply@github.com>2021-07-07 08:46:17 -0700
commit11050145e91bdcac580a5cc7e651133f5089e84f (patch)
tree27644c3b529de2970c0a6883c7a511e5d2affc38 /test/lit/help/wasm-reduce.test
parentcdf9ee0fdff72384d2192fb32c20bf05287dba97 (diff)
downloadbinaryen-11050145e91bdcac580a5cc7e651133f5089e84f.tar.gz
binaryen-11050145e91bdcac580a5cc7e651133f5089e84f.tar.bz2
binaryen-11050145e91bdcac580a5cc7e651133f5089e84f.zip
Lit tests for tool help messages (#3965)
Add list tests for the help messages of all tools, factoring out common options into shared tests. This is slightly brittle because the text wrapping depends on the length of the longest option, but that brittleness should be worth the benefit of being able to see the actual help text in the tests.
Diffstat (limited to 'test/lit/help/wasm-reduce.test')
-rw-r--r--test/lit/help/wasm-reduce.test47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/lit/help/wasm-reduce.test b/test/lit/help/wasm-reduce.test
new file mode 100644
index 000000000..b3f3ac710
--- /dev/null
+++ b/test/lit/help/wasm-reduce.test
@@ -0,0 +1,47 @@
+;; RUN: wasm-reduce --help | filecheck %s
+
+;; CHECK: wasm-reduce INFILE
+;; CHECK-NEXT:
+;; CHECK-NEXT: Reduce a wasm file to a smaller one that has the same behavior on a given
+;; CHECK-NEXT: command
+;; CHECK-NEXT:
+;; CHECK-NEXT: Options:
+;; CHECK-NEXT:
+;; CHECK-NEXT: --version Output version information and exit
+;; CHECK-NEXT:
+;; CHECK-NEXT: --help,-h Show this help message and exit
+;; CHECK-NEXT:
+;; CHECK-NEXT: --debug,-d Print debug information to stderr
+;; CHECK-NEXT:
+;; CHECK-NEXT: --command,-cmd The command to run on the test, that we want to reduce while
+;; CHECK-NEXT: keeping the command's output identical. We look at the
+;; CHECK-NEXT: command's return code and stdout here (TODO: stderr), and we
+;; CHECK-NEXT: reduce while keeping those unchanged.
+;; CHECK-NEXT:
+;; CHECK-NEXT: --test,-t Test file (this will be written to to test, the given
+;; CHECK-NEXT: command should read it when we call it)
+;; CHECK-NEXT:
+;; CHECK-NEXT: --working,-w Working file (this will contain the current good state while
+;; CHECK-NEXT: doing temporary computations, and will contain the final
+;; CHECK-NEXT: best result at the end)
+;; CHECK-NEXT:
+;; CHECK-NEXT: --binaries,-b binaryen binaries location (bin/ directory)
+;; CHECK-NEXT:
+;; CHECK-NEXT: --text,-S Emit intermediate files as text, instead of binary (also
+;; CHECK-NEXT: make sure the test and working files have a .wat or .wast
+;; CHECK-NEXT: suffix)
+;; CHECK-NEXT:
+;; CHECK-NEXT: --denan Avoid nans when reducing
+;; CHECK-NEXT:
+;; CHECK-NEXT: --verbose,-v Verbose output mode
+;; CHECK-NEXT:
+;; CHECK-NEXT: --debugInfo,-g Keep debug info in binaries
+;; CHECK-NEXT:
+;; CHECK-NEXT: --force,-f Force the reduction attempt, ignoring problems that imply it
+;; CHECK-NEXT: is unlikely to succeed
+;; CHECK-NEXT:
+;; CHECK-NEXT: --timeout,-to A timeout to apply to each execution of the command, in
+;; CHECK-NEXT: seconds (default: 2)
+;; CHECK-NEXT:
+;; CHECK-NEXT: --extra-flags,-ef Extra commandline flags to pass to wasm-opt while reducing.
+;; CHECK-NEXT: (default: --enable-all)