Rewrite the plain Makefile, add GoogleTest support#1276
Merged
johnbartholomew merged 4 commits intogoogle:masterfrom Feb 8, 2026
Merged
Rewrite the plain Makefile, add GoogleTest support#1276johnbartholomew merged 4 commits intogoogle:masterfrom
johnbartholomew merged 4 commits intogoogle:masterfrom
Conversation
In particular: * The (system) GoogleTest library is found using pkg-config. * Test binaries are built. * Object files are put in a .makebuild/ directory to keep them separate from the code tree (for cleanliness) * Dependencies are discovered during normal compilation instead of using a separate depends step. * Variables are cleaned up a bit. * The use of the `od` command from the environment is dropped, instead the Makefile builds and uses the to_c_array program (which is how the CMakeLists and Bazel builds already work) * Instead of grep|cut|sed to extract the version number, a single `sed` command is used. * The test binaries have their rpath set to $ORIGIN so that they can find the local libjsonnet.so where they are without LD_LIBRARY_PATH shenanigans. * tests.sh now executes the GoogleTest tests as well
Not everyone will have it installed; if it's missing then just skip those tests. Unless the user tells us to use it, in which case abort. Also, warn if it's missing, unless the user tells us _not_ to use it.
d1b3a8d to
0d3dc54
Compare
b6ddc90 to
eebff0e
Compare
d24927e to
eee9ff6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In particular:
pkg-config. If it's not found, those tests will be skipped (as they are already).odcommand from the environment is dropped, instead the Makefile builds and uses the to_c_array program (which is how the CMakeLists and Bazel builds already work)sedcommand is used.