about summary refs log tree commit diff
path: root/third_party/nix/src/tests/store-api-test.cc
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-11-28T00·38-0500
committerglittershark <grfn@gws.fyi>2020-11-28T00·47+0000
commit363dbeae95ce46be2b716506de90717998391a57 (patch)
tree5ca44c863fb9ec3c116e6fbc8fe7f85e15d91b13 /third_party/nix/src/tests/store-api-test.cc
parent6f38ac6657cabcee067a6299551d280680be16ff (diff)
refactor(tvix): Centralize arbitrary definitions r/1948
To make it easier for future tests to use the arbitrary specialisations
we've defined for some nix types, centralize them all in a single
arbitrary.hh header file.

Change-Id: I767f27949cfe7ec55c79901f7d7aa538d2f98c6b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2182
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Diffstat (limited to 'third_party/nix/src/tests/store-api-test.cc')
-rw-r--r--third_party/nix/src/tests/store-api-test.cc23
1 files changed, 1 insertions, 22 deletions
diff --git a/third_party/nix/src/tests/store-api-test.cc b/third_party/nix/src/tests/store-api-test.cc
index 515613b799ee..259e4b991b57 100644
--- a/third_party/nix/src/tests/store-api-test.cc
+++ b/third_party/nix/src/tests/store-api-test.cc
@@ -2,31 +2,10 @@
 
 #include <gtest/gtest.h>
 #include <rapidcheck/Assertions.h>
-#include <rapidcheck/Gen.h>
 #include <rapidcheck/gtest.h>
 
 #include "libproto/worker.pb.h"
-
-namespace rc {
-template <>
-struct Arbitrary<nix::BuildResult::Status> {
-  static Gen<nix::BuildResult::Status> arbitrary() {
-    return gen::element(nix::BuildResult::Status::Built,
-                        nix::BuildResult::Status::Substituted,
-                        nix::BuildResult::Status::AlreadyValid,
-                        nix::BuildResult::Status::PermanentFailure,
-                        nix::BuildResult::Status::InputRejected,
-                        nix::BuildResult::Status::OutputRejected,
-                        nix::BuildResult::Status::TransientFailure,
-                        nix::BuildResult::Status::CachedFailure,
-                        nix::BuildResult::Status::TimedOut,
-                        nix::BuildResult::Status::MiscFailure,
-                        nix::BuildResult::Status::DependencyFailed,
-                        nix::BuildResult::Status::LogLimitExceeded,
-                        nix::BuildResult::Status::NotDeterministic);
-  }
-};
-}  // namespace rc
+#include "tests/arbitrary.hh"
 
 namespace nix {