swc/scripts/coverage.sh
강동윤 8a01e2b7b6
Fix spack (#1016)
swc_ecma_transforms:
 - Add tests for #898 
 - dce preserves `export * from 'foo';`

swc_bundler:
 - Fix some concurrency bugs
 - Run dce only once
 - Handle `export * from 'foo'`
 - Handle namespace imports with computed key
 - Add some unit tests for `plan`
 - Handle export default decl
 - Handle simple coomon dependencies properly
2020-09-03 22:45:42 +09:00

20 lines
870 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
export RUST_MIN_STACK=16777216
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests"
export RUSTDOCFLAGS="-Cpanic=abort"
export CARGO_TARGET_DIR=".COVERAGE_DIR"
git clone https://github.com/swc-project/ts-parser-test-ref.git ecmascript/parser/tests/typescript/tsc || true
(cd ecmascript/parser/tests/typescript/tsc && git pull)
cargo test --all --all-features --exclude node-swc --exclude wasm
zip -0 ccov.zip `find $CARGO_TARGET_DIR \( -name "swc*.gc*" -o -name 'spack*.gc*' -o -name 'ast_node*.gc*' -o -name 'enum_kind*.gc*' -o -name 'string-enum*.gc*' -o -name 'from_variant*.gc*' \) -print`;
grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" -o lcov.info;
bash <(curl -s https://codecov.io/bash) -f lcov.info