diff --git a/configure.ac b/configure.ac index 0066bc389..1b0d6fd27 100644 --- a/configure.ac +++ b/configure.ac @@ -274,12 +274,6 @@ 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 ]) -AC_CHECK_LIB([rapidcheck], []) - - # Look for nlohmann/json. PKG_CHECK_MODULES([NLOHMANN_JSON], [nlohmann_json >= 3.9]) diff --git a/doc/manual/src/contributing/hacking.md b/doc/manual/src/contributing/hacking.md index 9dbafcc0a..aeb0d41b3 100644 --- a/doc/manual/src/contributing/hacking.md +++ b/doc/manual/src/contributing/hacking.md @@ -92,8 +92,7 @@ $ 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/) and -[rapidcheck](https://github.com/emil-e/rapidcheck) frameworks. +[googletest](https://google.github.io/googletest/) framework. 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. diff --git a/flake.nix b/flake.nix index 549ded43d..88ffcf333 100644 --- a/flake.nix +++ b/flake.nix @@ -82,9 +82,7 @@ }); configureFlags = - [ - "CXXFLAGS=-I${lib.getDev rapidcheck}/extras/gtest/include" - ] ++ lib.optionals stdenv.isLinux [ + lib.optionals stdenv.isLinux [ "--with-boost=${boost}/lib" "--with-sandbox-shell=${sh}/bin/busybox" ] @@ -118,7 +116,6 @@ boost lowdown-nix gtest - rapidcheck ] ++ lib.optionals stdenv.isLinux [libseccomp] ++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium @@ -658,7 +655,6 @@ inherit system crossSystem; overlays = [ self.overlays.default ]; }; - inherit (nixpkgsCross) lib; in with commonDeps { pkgs = nixpkgsCross; }; nixpkgsCross.stdenv.mkDerivation { name = "nix-${version}"; @@ -671,11 +667,7 @@ nativeBuildInputs = nativeBuildDeps; buildInputs = buildDeps ++ propagatedDeps; - configureFlags = [ - "CXXFLAGS=-I${lib.getDev nixpkgsCross.rapidcheck}/extras/gtest/include" - "--sysconfdir=/etc" - "--disable-doc-gen" - ]; + configureFlags = [ "--sysconfdir=/etc" "--disable-doc-gen" ]; enableParallelBuilding = true; diff --git a/src/libstore/tests/local.mk b/src/libstore/tests/local.mk index a2cf8a0cf..f74295d97 100644 --- a/src/libstore/tests/local.mk +++ b/src/libstore/tests/local.mk @@ -12,4 +12,4 @@ libstore-tests_CXXFLAGS += -I src/libstore -I src/libutil libstore-tests_LIBS = libstore libutil -libstore-tests_LDFLAGS := -lrapidcheck $(GTEST_LIBS) +libstore-tests_LDFLAGS := $(GTEST_LIBS) diff --git a/src/libstore/tests/path.cc b/src/libstore/tests/path.cc index 8ea252c92..db6f31a0a 100644 --- a/src/libstore/tests/path.cc +++ b/src/libstore/tests/path.cc @@ -2,7 +2,6 @@ #include #include -#include #include "path-regex.hh" #include "store-api.hh" @@ -63,82 +62,5 @@ TEST_DO_PARSE(equals_sign, "foo=foo") #undef TEST_DO_PARSE -// For rapidcheck -void showValue(const StorePath & p, std::ostream & os) { - os << p.to_string(); -} - -} - -namespace rc { -using namespace nix; - -template<> -struct Arbitrary { - static Gen arbitrary(); -}; - -Gen Arbitrary::arbitrary() -{ - auto len = *gen::inRange(1, StorePath::MaxPathLen); - - std::string pre { HASH_PART "-" }; - pre.reserve(pre.size() + len); - - for (size_t c = 0; c < len; ++c) { - switch (auto i = *gen::inRange(0, 10 + 2 * 26 + 6)) { - case 0 ... 9: - pre += '0' + i; - case 10 ... 35: - pre += 'A' + (i - 10); - break; - case 36 ... 61: - pre += 'a' + (i - 36); - break; - case 62: - pre += '+'; - break; - case 63: - pre += '-'; - break; - case 64: - pre += '.'; - break; - case 65: - pre += '_'; - break; - case 66: - pre += '?'; - break; - case 67: - pre += '='; - break; - default: - assert(false); - } - } - - return gen::just(StorePath { pre }); -} - -} // namespace rc - -namespace nix { - -RC_GTEST_FIXTURE_PROP( - StorePathTest, - prop_regex_accept, - (const StorePath & p)) -{ - RC_ASSERT(std::regex_match(std::string { p.name() }, nameRegex)); -} - -RC_GTEST_FIXTURE_PROP( - StorePathTest, - prop_round_rip, - (const StorePath & p)) -{ - RC_ASSERT(p == store->parseStorePath(store->printStorePath(p))); -} }