2021-05-23 05:19:11 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
2022-02-28 16:49:10 +03:00
|
|
|
# This script updates golden.txt and TODO.txt
|
2021-05-23 05:19:11 +03:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# Note that even if a test is ignored, this script will invoke it.
|
|
|
|
#
|
|
|
|
set -eu
|
|
|
|
|
2022-04-24 15:11:02 +03:00
|
|
|
function sortFile() {
|
|
|
|
cat $1 | awk NF | sort | uniq | awk '{$1=$1};1' | uniq | sort > tests/sorted.txt
|
|
|
|
mv tests/sorted.txt $1
|
|
|
|
}
|
2021-05-23 05:19:11 +03:00
|
|
|
|
|
|
|
# Clean the ignore list
|
2022-02-28 16:49:10 +03:00
|
|
|
echo '' > tests/TODO.txt
|
2022-04-24 15:11:02 +03:00
|
|
|
echo '' > tests/golden.txt
|
|
|
|
mv tests/postponed.txt tests/postponed.tmp.txt
|
|
|
|
echo '' > tests/postponed.txt
|
2021-05-23 05:19:11 +03:00
|
|
|
|
2022-04-28 08:19:08 +03:00
|
|
|
export SWC_RUN=0
|
2022-04-28 11:32:03 +03:00
|
|
|
export SWC_CHECK=0
|
2022-04-23 16:40:28 +03:00
|
|
|
|
|
|
|
# Update golden.txt
|
|
|
|
cargo test --test compress fixture_tests__terser__compress__ \
|
|
|
|
| grep 'fixture_tests__terser__compress__' \
|
|
|
|
| grep 'js .\.\. ok$' \
|
|
|
|
| sed -e 's!test fixture_tests__terser__compress__!!' \
|
|
|
|
| sed -e 's! ... ok!!' \
|
|
|
|
| sed -e 's!__!/!g' \
|
|
|
|
| sed -e 's!_js!.js!' \
|
|
|
|
>> tests/golden.txt
|
|
|
|
|
2022-04-24 15:11:02 +03:00
|
|
|
sortFile tests/golden.txt
|
|
|
|
|
|
|
|
# Don't mark passing tests as postponed
|
|
|
|
comm -23 tests/postponed.tmp.txt tests/golden.txt > tests/nodup.txt
|
|
|
|
mv tests/nodup.txt tests/postponed.txt
|
|
|
|
rm tests/postponed.tmp.txt
|
|
|
|
|
|
|
|
sortFile tests/postponed.txt
|
|
|
|
|
2022-04-23 16:40:28 +03:00
|
|
|
# Update TODO.txt
|
|
|
|
cargo test --test compress 'fixture_tests__terser__compress__' \
|
|
|
|
| grep 'fixture_tests__terser__compress__' \
|
|
|
|
| grep 'js .\.\. FAILED$' \
|
|
|
|
| sed -e 's!test fixture_tests__terser__compress__!!' \
|
|
|
|
| sed -e 's! ... FAILED!!' \
|
|
|
|
| sed -e 's!__!/!g' \
|
|
|
|
| sed -e 's!_js!.js!' \
|
|
|
|
>> tests/TODO.txt
|
|
|
|
|
2022-04-24 15:11:02 +03:00
|
|
|
sortFile tests/TODO.txt
|
|
|
|
|
|
|
|
# Don't mark postponed test as todo
|
|
|
|
comm -23 tests/TODO.txt tests/postponed.txt > tests/nodup.txt
|
|
|
|
mv tests/nodup.txt tests/TODO.txt
|
|
|
|
|