aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/libstore/machines.cc
diff options
context:
space:
mode:
authorRebecca Turner <rbt@sent.as>2024-04-08 12:43:35 -0700
committerRebecca Turner <rbt@sent.as>2024-04-08 12:43:35 -0700
commit12f2565f91a82ec3c99ee7a422f69efaf284353d (patch)
treef004ba2c4b3adf4648ae5eb1f04f67eac35f604f /tests/unit/libstore/machines.cc
parentb3233405381b50c7f7eb87d7962b25a06d16be44 (diff)
Don't run libstore unit tests in project root
This keeps the libstore unit tests from writing `libstore-unit-tests.xml` to the project root. Change-Id: I0d9909aabf9f3574cc1e72a5ae81daefba9a394b
Diffstat (limited to 'tests/unit/libstore/machines.cc')
-rw-r--r--tests/unit/libstore/machines.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/libstore/machines.cc b/tests/unit/libstore/machines.cc
index 702461926..0277237bb 100644
--- a/tests/unit/libstore/machines.cc
+++ b/tests/unit/libstore/machines.cc
@@ -1,5 +1,6 @@
#include "machines.hh"
#include "globals.hh"
+#include "tests/test-data.hh"
#include <gmock/gmock-matchers.h>
@@ -17,7 +18,6 @@ using nix::getMachines;
using nix::Machine;
using nix::Machines;
using nix::pathExists;
-using nix::Settings;
using nix::settings;
class Environment : public ::testing::Environment {
@@ -138,7 +138,7 @@ TEST(machines, getMachinesWithIncorrectFormat) {
}
TEST(machines, getMachinesWithCorrectFileReference) {
- auto path = absPath("tests/unit/libstore/test-data/machines.valid");
+ auto path = nix::getUnitTestDataPath("machines.valid");
ASSERT_TRUE(pathExists(path));
settings.builders = std::string("@") + path;
@@ -165,6 +165,6 @@ TEST(machines, getMachinesWithIncorrectFileReference) {
}
TEST(machines, getMachinesWithCorrectFileReferenceToIncorrectFile) {
- settings.builders = std::string("@") + absPath("tests/unit/libstore/test-data/machines.bad_format");
+ settings.builders = std::string("@") + nix::getUnitTestDataPath("machines.bad_format");
EXPECT_THROW(getMachines(), FormatError);
}