Skip to content

Commit ec67702

Browse files
authored
test: Add a unittest for the hard link based compiler detection (ccache#1517)
1 parent 2d44072 commit ec67702

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

unittest/test_ccache.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,16 @@ TEST_CASE("guess_compiler")
213213

214214
CHECK(guess_compiler(clang_cl) == CompilerType::clang_cl);
215215
}
216+
217+
SUBCASE("Probe hardlink for actual compiler")
218+
{
219+
const auto cwd = *fs::current_path();
220+
util::write_file(cwd / "gcc", "");
221+
const auto cc = cwd / "cc";
222+
CHECK(fs::create_hard_link("gcc", cc));
223+
224+
CHECK(guess_compiler(cc) == CompilerType::gcc);
225+
}
216226
#endif
217227
}
218228

0 commit comments

Comments
 (0)