Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more tests for components parsing (#602)
This commit uses coverage to find holes in where we weren't testing parser support for a feature in the component model. Additionally some AST changes were made along the way: * The `wasmprinter` output for canonical abi options were tweaked: * string-related options are prefixed with `string=` * the `into` option no longer prints `(instance ...)`, it only prints the instance index * The name of parameters in function types was changed to a `&str` from the id/name annotation combo. * A number of unused `Peek` implementations were removed. * Some dynamically dead code was replaced with `unreachable!` to emphasize it shouldn't be executed. * A subtraction-overflow issue was fixed in name resolution for outer aliases which try to reach too far. * Parsing `ComponentTypeUse` as a simple index like `$foo` was removed as it's expected to either be `(type $idx)` or an inline definition.
- Loading branch information
1 parent
f18c859
commit e359e1e
Showing
12 changed files
with
172 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
set -ex | ||
|
||
cargo test --test roundtrip | ||
|
||
rm -rf cov | ||
mkdir cov | ||
|
||
export LLVM_PROFILE_FILE="`pwd`/cov/coverage-%m.profraw" | ||
export RUSTFLAGS="-C instrument-coverage" | ||
export CARGO_TARGET_DIR=`pwd`/target/coverage | ||
|
||
cargo test --test roundtrip | ||
|
||
llvm-profdata merge -sparse cov/coverage-*.profraw -o cov/coverage.profdata | ||
llvm-cov show -Xdemangler=rustfilt \ | ||
./target/coverage/debug/deps/roundtrip-92d636af98ebdc72 \ | ||
--format=html \ | ||
--ignore-filename-regex='/.cargo/registry' \ | ||
--ignore-filename-regex='/rustc/' \ | ||
--instr-profile=cov/coverage.profdata \ | ||
--show-line-counts-or-regions \ | ||
--show-instantiations \ | ||
--show-regions \ | ||
--output-dir=cov | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.