swc/ecmascript/minifier/scripts/postpone.sh
강동윤 33a43f85b1
feat(es/minifier): Implement more rules (#1766)
swc_ecma_minifier:
 - Implement more rules.

swc_ecma_transforms_base:
 - `resolver`: Fix syntax context of catch block.

swc_ecma_transforms_optimization:
 - `expr_simplifier`: Fix a bug related to `this` of call expressions.
 - `dead_branch_remover`: Don't reduce switch cases if test is now known.
 - `dead_branch_remover`: Don't break `&&`.
2021-06-29 16:11:22 +09:00

28 lines
841 B
Bash
Executable File

#!/usr/bin/env bash
#
# Used to publish MVP.
#
# Use this script with test name if the minifier of swc does not break code.
#
set -eu
find tests/compress/exec -name output.js | xargs -L 1 rm
find tests/compress/exec -name expected.stdout | xargs -L 1 rm
find tests/compress/exec -name output.terser.js | xargs -L 1 rm
find tests/compress/exec -name mangle.json | xargs -L 1 rm
find tests/compress/exec -empty -type d -delete
cargo test --test compress --all-features ${1-''} \
| grep 'terser__compress' \
| grep 'js .\.\. FAILED$' \
| sed -e 's!test fixture_terser__compress__!!' \
| sed -e 's! ... FAILED!!' \
| sed -e 's!__!/!g' \
| sed -e 's!_js!.js!' \
>> tests/postponed_candidates.txt
comm -23 tests/postponed_candidates.txt tests/golden.txt >> tests/postponed.txt
rm tests/postponed_candidates.txt
./scripts/sort.sh