mirror of
https://github.com/NixOS/nix.git
synced 2025-11-19 00:39:37 +01:00
Merge pull request #14576 from corngood/cygwin-tests
Fix/disable tests on cygwin
This commit is contained in:
commit
5446d6345f
3 changed files with 15 additions and 4 deletions
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
namespace nixC {
|
namespace nixC {
|
||||||
|
|
||||||
TEST_F(nix_api_store_test, nix_eval_state_lookup_path)
|
TEST_F(nix_api_expr_test, nix_eval_state_lookup_path)
|
||||||
{
|
{
|
||||||
auto tmpDir = nix::createTempDir();
|
auto tmpDir = nix::createTempDir();
|
||||||
auto delTmpDir = std::make_unique<nix::AutoDelete>(tmpDir, true);
|
auto delTmpDir = std::make_unique<nix::AutoDelete>(tmpDir, true);
|
||||||
|
|
@ -42,12 +42,16 @@ TEST_F(nix_api_store_test, nix_eval_state_lookup_path)
|
||||||
nix_expr_eval_from_string(ctx, state, "builtins.seq <nixos-config> <nixpkgs>", ".", value);
|
nix_expr_eval_from_string(ctx, state, "builtins.seq <nixos-config> <nixpkgs>", ".", value);
|
||||||
assert_ctx_ok();
|
assert_ctx_ok();
|
||||||
|
|
||||||
|
nix_state_free(state);
|
||||||
|
|
||||||
ASSERT_EQ(nix_get_type(ctx, value), NIX_TYPE_PATH);
|
ASSERT_EQ(nix_get_type(ctx, value), NIX_TYPE_PATH);
|
||||||
assert_ctx_ok();
|
assert_ctx_ok();
|
||||||
|
|
||||||
auto pathStr = nix_get_path_string(ctx, value);
|
auto pathStr = nix_get_path_string(ctx, value);
|
||||||
assert_ctx_ok();
|
assert_ctx_ok();
|
||||||
ASSERT_EQ(0, strcmp(pathStr, nixpkgs.c_str()));
|
ASSERT_EQ(0, strcmp(pathStr, nixpkgs.c_str()));
|
||||||
|
|
||||||
|
nix_gc_decref(nullptr, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(nix_api_expr_test, nix_expr_eval_from_string)
|
TEST_F(nix_api_expr_test, nix_expr_eval_from_string)
|
||||||
|
|
|
||||||
|
|
@ -661,8 +661,14 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
CASE(R"(null)", ""),
|
CASE(R"(null)", ""),
|
||||||
CASE(R"({ v = "bar"; __toString = self: self.v; })", "bar"),
|
CASE(R"({ v = "bar"; __toString = self: self.v; })", "bar"),
|
||||||
CASE(R"({ v = "bar"; __toString = self: self.v; outPath = "foo"; })", "bar"),
|
CASE(R"({ v = "bar"; __toString = self: self.v; outPath = "foo"; })", "bar"),
|
||||||
CASE(R"({ outPath = "foo"; })", "foo"),
|
CASE(R"({ outPath = "foo"; })", "foo")
|
||||||
CASE(R"(./test)", "/test")));
|
// this is broken on cygwin because canonPath("//./test", false) returns //./test
|
||||||
|
// FIXME: don't use canonPath
|
||||||
|
#ifndef __CYGWIN__
|
||||||
|
,
|
||||||
|
CASE(R"(./test)", "/test")
|
||||||
|
#endif
|
||||||
|
));
|
||||||
#undef CASE
|
#undef CASE
|
||||||
|
|
||||||
TEST_F(PrimOpTest, substring)
|
TEST_F(PrimOpTest, substring)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#ifndef _WIN32
|
// TODO: investigate why this is hanging on cygwin
|
||||||
|
#if !defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
|
||||||
# include "nix/util/util.hh"
|
# include "nix/util/util.hh"
|
||||||
# include "nix/util/monitor-fd.hh"
|
# include "nix/util/monitor-fd.hh"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue