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

Test store paths, with property tests, fix bug #7639

Merged
merged 3 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add rapidcheck dependency for testing
Property tests are great!

Co-authored-by: Cole Helbling <[email protected]>
  • Loading branch information
Ericson2314 and cole-h committed Jan 23, 2023
commit 7fe308c2f840325199f49526b257bbe4ded5a909
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ fi
PKG_CHECK_MODULES([GTEST], [gtest_main])


# Look for rapidcheck.
# No pkg-config yet, https://github.com/emil-e/rapidcheck/issues/302
AC_CHECK_HEADERS([rapidcheck/gtest.h], [], [], [#include <gtest/gtest.h>])
AC_CHECK_LIB([rapidcheck], [])


# Look for nlohmann/json.
PKG_CHECK_MODULES([NLOHMANN_JSON], [nlohmann_json >= 3.9])

Expand Down
3 changes: 2 additions & 1 deletion doc/manual/src/contributing/hacking.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ $ nix develop

The unit-tests for each Nix library (`libexpr`, `libstore`, etc..) are defined
under `src/{library_name}/tests` using the
[googletest](https://google.github.io/googletest/) framework.
[googletest](https://google.github.io/googletest/) and
[rapidcheck](https://github.com/emil-e/rapidcheck) frameworks.

You can run the whole testsuite with `make check`, or the tests for a specific component with `make libfoo-tests_RUN`. Finer-grained filtering is also possible using the [--gtest_filter](https://google.github.io/googletest/advanced.html#running-a-subset-of-the-tests) command-line option.

Expand Down
5 changes: 4 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
});

configureFlags =
lib.optionals stdenv.isLinux [
[
"CXXFLAGS=-I${lib.getDev rapidcheck}/extras/gtest/include"
] ++ lib.optionals stdenv.isLinux [
"--with-boost=${boost}/lib"
"--with-sandbox-shell=${sh}/bin/busybox"
]
Expand Down Expand Up @@ -116,6 +118,7 @@
boost
lowdown-nix
gtest
rapidcheck
]
++ lib.optionals stdenv.isLinux [libseccomp]
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
Expand Down
2 changes: 1 addition & 1 deletion src/libstore/tests/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ libstore-tests_CXXFLAGS += -I src/libstore -I src/libutil

libstore-tests_LIBS = libstore libutil

libstore-tests_LDFLAGS := $(GTEST_LIBS)
libstore-tests_LDFLAGS := -lrapidcheck $(GTEST_LIBS)