Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Factor out proto comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
shaldengeki committed Jan 25, 2023
1 parent 6aa5521 commit 77e79f5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/parser_binary_test.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail

function compare_proto() {
# Takes one argument, the relative path to the proto to compare.
echo $1
./src/parser_binary $1 > "${1}_serialized.proto"
diff --side-by-side --ignore-all-space --ignore-blank-lines $1 "${1}_serialized.proto"
}

echo "Local protos:"
LOCAL_PROTOS=$(find ./test/resources -name "*.proto" | sort)
for f in $LOCAL_PROTOS; do
echo $f
./src/parser_binary $f > "${f}_serialized.proto"
diff --side-by-side --ignore-all-space $f "${f}_serialized.proto"
compare_proto $f
done

echo "Google protos:"
GOOGLE_PROTOS=$(find ./external/com_google_protobuf/src/google/protobuf -name "*.proto" | xargs grep --files-without-match "proto2" | sort)
for f in $GOOGLE_PROTOS; do
echo $f
./src/parser_binary $f > "${f}_serialized.proto"
diff --side-by-side --ignore-all-space $f "${f}_serialized.proto"
compare_proto $f
done

0 comments on commit 77e79f5

Please sign in to comment.