Try saving the test binary hash to not have to wade through those in the diffs

There are a few output files that have more than one test binaries; make
their hashes be the same because I'm too tired to figure out how to
capture and replace multiple different hashes.
This commit is contained in:
Carol (Nichols || Goulding)
2020-12-05 14:18:29 -05:00
parent 6e98805629
commit 17618d8b8f
5 changed files with 13 additions and 5 deletions
@@ -8,7 +8,7 @@ test tests::internal ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/integration_test-82e7799c1bc62298
Running target/debug/deps/integration_test-92948b65e88960b4
running 1 test
test it_adds_two ... ok
@@ -8,13 +8,13 @@ test tests::internal ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/common-7064e1b6d2e271be
Running target/debug/deps/common-92948b65e88960b4
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/integration_test-82e7799c1bc62298
Running target/debug/deps/integration_test-92948b65e88960b4
running 1 test
test it_adds_two ... ok
@@ -8,7 +8,7 @@ test tests::one_result ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/minigrep-caf9dbee196c78b9
Running target/debug/deps/minigrep-4672b652f7794785
running 0 tests
@@ -9,7 +9,7 @@ test tests::case_sensitive ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/minigrep-caf9dbee196c78b9
Running target/debug/deps/minigrep-4672b652f7794785
running 0 tests
+8
View File
@@ -39,6 +39,9 @@ find -s listings -name output.txt -print0 | while IFS= read -r -d '' f; do
# Save the previous compile time; we're going to keep it to minimize diff churn
compile_time=$(sed -E -ne "s/.*Finished (dev|test) \[unoptimized \+ debuginfo] target\(s\) in ([0-9.]*).*/\2/p" ${full_output_path})
# Save the hash from the first test binary; we're going to keep it to minimize diff churn
test_binary_hash=$(sed -E -ne "s/.*Running target\/debug\/deps\/[^-]*-([^\s]*)/\1/p" ${full_output_path} | head -n 1)
# Act like this is the first time this listing has been built
cargo clean
@@ -62,6 +65,11 @@ find -s listings -name output.txt -print0 | while IFS= read -r -d '' f; do
sed -i '' -E -e "s/Finished (dev|test) \[unoptimized \+ debuginfo] target\(s\) in [0-9.]*/Finished \1 [unoptimized + debuginfo] target(s) in ${compile_time}/" ${full_output_path}
fi
# Restore the previous test binary hash, if there is one
if [ -n "${test_binary_hash}" ]; then
sed -i '' -E -e "s/Running target\/debug\/deps\/([^-]*)-([^\s]*)$/Running target\/debug\/deps\/\1-${test_binary_hash}/g" ${full_output_path}
fi
cd - > /dev/null
done