Allow comparison
This commit is contained in:
parent
b18201169f
commit
0bed19e5ed
13 changed files with 106 additions and 37 deletions
1
debug/diff/.gitignore
vendored
Normal file
1
debug/diff/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/outputs/
|
||||
|
|
@ -1 +1 @@
|
|||
[compare.sh](./compare.sh) is a useful script for viewing a character-by-character diff between the minified outputs of minify-html and html-minifier for a specific test. Pass the test's file name as the first argument.
|
||||
[compare](./compare) is a useful script for viewing a character-by-character diff between the minified outputs of minify-html and html-minifier for a specific input. Pass the input's file name as the first argument.
|
||||
|
|
|
|||
9
debug/diff/compare
Executable file
9
debug/diff/compare
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -Eeuxo pipefail
|
||||
|
||||
pushd "$(dirname "$0")" >/dev/null
|
||||
|
||||
git --no-pager diff --no-index --word-diff=color --word-diff-regex=. "outputs/html-minifier/$1" "outputs/minify-html/$1" | less
|
||||
|
||||
popd >/dev/null
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
git --no-pager diff --no-index --word-diff=color --word-diff-regex=. "min/html-minifier/$1.html" "min/@minify-html/js/$1.html" | less
|
||||
30
debug/diff/run
Executable file
30
debug/diff/run
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -Eeuo pipefail
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
pushd "$(dirname "$0")" >/dev/null
|
||||
|
||||
input_dir="$PWD/../../bench/inputs"
|
||||
output_dir="$PWD/outputs"
|
||||
|
||||
rm -rf "$output_dir"
|
||||
mkdir -p "$output_dir"
|
||||
|
||||
pushd "../../bench/runners" >/dev/null
|
||||
for r in *; do
|
||||
if [ ! -d "$r" ]; then
|
||||
continue
|
||||
fi
|
||||
mkdir -p "$output_dir/$r"
|
||||
echo "Running $r..."
|
||||
pushd "$r" >/dev/null
|
||||
MHB_ITERATIONS=1 MHB_INPUT_DIR="$input_dir" MHB_OUTPUT_DIR="$output_dir/$r" RUST_BACKTRACE=1 ./run >/dev/null
|
||||
popd >/dev/null
|
||||
done
|
||||
popd >/dev/null
|
||||
|
||||
echo "All done!"
|
||||
|
||||
popd >/dev/null
|
||||
Reference in a new issue