Skip to content

Commit

Permalink
Merge pull request #70 from ngzhian/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
ngzhian authored Mar 28, 2022
2 parents 1f29e46 + 9369de7 commit 1a303a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions document/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
This directory contains the source code for the WebAssembly spec documents, as served from the [webassembly.github.io/spec](https://webassembly.github.io/spec) pages.
It uses [Sphinx](http://www.sphinx-doc.org/) and [Bikeshed](https://github.com/tabatkins/bikeshed).

To install Sphinx:
To install Sphinx (and required library six):
```
pip install sphinx
pip install sphinx six
```

To install Bikeshed, see the instructions [here](https://tabatkins.github.io/bikeshed/#installing).
Expand Down Expand Up @@ -42,7 +42,7 @@ pipenv shell
Install Python dependencies:

```
pipenv install Sphinx==4.0.0
pipenv install Sphinx==4.0.0 six
```

### Checking out the repository
Expand Down
13 changes: 10 additions & 3 deletions test/core/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
parser = argparse.ArgumentParser()
parser.add_argument("--wasm", metavar="<wasm-command>", default=os.path.join(os.getcwd(), "wasm"))
parser.add_argument("--js", metavar="<js-command>")
parser.add_argument("--generate-js-only", action='store_true')
parser.add_argument("--out", metavar="<out-dir>", default=outputDir)
parser.add_argument("file", nargs='*')
arguments = parser.parse_args()
Expand All @@ -28,6 +29,7 @@

wasmCommand = arguments.wasm
jsCommand = arguments.js
generateJsOnly = arguments.generate_js_only
outputDir = arguments.out
inputFiles = arguments.file if arguments.file else main_test_files + simd_test_files

Expand Down Expand Up @@ -64,6 +66,14 @@ def _runTestFile(self, inputPath):
dir, inputFile = os.path.split(inputPath)
outputPath = os.path.join(outputDir, inputFile)

# Generate JS first, then return early if we are only generating JS.
jsPath = self._auxFile(outputPath.replace(".wast", ".js"))
logPath = self._auxFile(jsPath + ".log")
self._runCommand(('%s -d "%s" -o "%s"') % (wasmCommand, inputPath, jsPath), logPath)

if generateJsOnly:
return

# Run original file
expectedExitCode = 1 if ".fail." in inputFile else 0
logPath = self._auxFile(outputPath + ".log")
Expand Down Expand Up @@ -96,9 +106,6 @@ def _runTestFile(self, inputPath):
self._runCommand(('%s -d "%s" -o "%s"') % (wasmCommand, wasm2Path, wast2Path), logPath)
self._compareFile(wastPath, wast2Path)

jsPath = self._auxFile(outputPath.replace(".wast", ".js"))
logPath = self._auxFile(jsPath + ".log")
self._runCommand(('%s -d "%s" -o "%s"') % (wasmCommand, inputPath, jsPath), logPath)
if jsCommand != None:
self._runCommand(('%s "%s"') % (jsCommand, jsPath), logPath)

Expand Down

0 comments on commit 1a303a5

Please sign in to comment.