Skip to content

Commit 5446d63

Browse files
authored
Merge pull request NixOS#14576 from corngood/cygwin-tests
Fix/disable tests on cygwin
2 parents 5462c5e + b115c90 commit 5446d63

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

src/libexpr-tests/nix_api_expr.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace nixC {
1616

17-
TEST_F(nix_api_store_test, nix_eval_state_lookup_path)
17+
TEST_F(nix_api_expr_test, nix_eval_state_lookup_path)
1818
{
1919
auto tmpDir = nix::createTempDir();
2020
auto delTmpDir = std::make_unique<nix::AutoDelete>(tmpDir, true);
@@ -42,12 +42,16 @@ TEST_F(nix_api_store_test, nix_eval_state_lookup_path)
4242
nix_expr_eval_from_string(ctx, state, "builtins.seq <nixos-config> <nixpkgs>", ".", value);
4343
assert_ctx_ok();
4444

45+
nix_state_free(state);
46+
4547
ASSERT_EQ(nix_get_type(ctx, value), NIX_TYPE_PATH);
4648
assert_ctx_ok();
4749

4850
auto pathStr = nix_get_path_string(ctx, value);
4951
assert_ctx_ok();
5052
ASSERT_EQ(0, strcmp(pathStr, nixpkgs.c_str()));
53+
54+
nix_gc_decref(nullptr, value);
5155
}
5256

5357
TEST_F(nix_api_expr_test, nix_expr_eval_from_string)

src/libexpr-tests/primops.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,14 @@ INSTANTIATE_TEST_SUITE_P(
661661
CASE(R"(null)", ""),
662662
CASE(R"({ v = "bar"; __toString = self: self.v; })", "bar"),
663663
CASE(R"({ v = "bar"; __toString = self: self.v; outPath = "foo"; })", "bar"),
664-
CASE(R"({ outPath = "foo"; })", "foo"),
665-
CASE(R"(./test)", "/test")));
664+
CASE(R"({ outPath = "foo"; })", "foo")
665+
// this is broken on cygwin because canonPath("//./test", false) returns //./test
666+
// FIXME: don't use canonPath
667+
#ifndef __CYGWIN__
668+
,
669+
CASE(R"(./test)", "/test")
670+
#endif
671+
));
666672
#undef CASE
667673

668674
TEST_F(PrimOpTest, substring)

src/libutil-tests/monitorfdhup.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#ifndef _WIN32
1+
// TODO: investigate why this is hanging on cygwin
2+
#if !defined(_WIN32) && !defined(__CYGWIN__)
23

34
# include "nix/util/util.hh"
45
# include "nix/util/monitor-fd.hh"

0 commit comments

Comments
 (0)