Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests #3571

Merged
merged 12 commits into from May 8, 2020
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -16,7 +16,8 @@ makefiles = \
misc/upstart/local.mk \
doc/manual/local.mk \
tests/local.mk \
tests/plugins/local.mk
tests/plugins/local.mk \
tests/unit-tests/local.mk

-include Makefile.config

Expand Down
1 change: 1 addition & 0 deletions release-common.nix
Expand Up @@ -55,6 +55,7 @@ rec {
# Tests
git
mercurial
gmock
]
++ lib.optionals stdenv.isLinux [libseccomp utillinuxMinimal]
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
Expand Down
4 changes: 4 additions & 0 deletions tests/unit-tests/local.mk
@@ -0,0 +1,4 @@
LIBS=-larchive -lcrypto -llzma -lbz2 -lz -lbrotlienc -lbrotlidec
unit-tests:
echo $(nix_LDFLAGS)
$(CXX) -o unit-test $(nix_CXXFLAGS) $(nix_LDFLAGS) $(LIBS) --std=c++17 $$(pkg-config --libs gtest_main) ./src/libutil/*.o tests/unit-tests/test-util.cc