goprotoctest
Tests for github.com/jhump/goprotoc and github.com/jhump/protoreflect.
Setup
Install direnv. Make sure to add eval "$(direnv hook bash)"
to your
.bash_aliases
equivalent. See the instructions for more details.
The following programs must also be installed:
After all necessary programs are installed, run the following to set up the repository for the
first time:
git clone https://github.com/pedgeio/goprotoctest
cd goprotoctest
direnv allow
cd ..
cd goprotoctest
Running tests
To run the whole test and lint suite:
make
To just run the tests:
make test
Note that right now this is failing due to differences in intermediate SourceCodeInfo_Location
messages.
Some of the variables in internal/goprotoctest/goprotoctest_test.go are made to
be changed for various one-off tests:
testDiffWithJSON
- if true, output diffs as JSON diffs, not as deep equals diffs
testSingleGoogleapisPackage
- if set, this will test only this package in googleapis, as opposed
to all packages
testIgnoreGoogleapisPackages
- the keys in this map will be ignored, useful for when there is a
specific failure
The testGoogleapis
function's last bool
argument says to write to .tmp/goprotoc.json
and
.tmp/protoc.json
for this test. These files will contain the generated FileDescriptorSet
messages for this test if testSingleGoogleapisPackage
is set. This is useful for debugging.