[M8] reusable libraries: install layout + cargoxx-path deps
This commit is contained in:
@@ -131,16 +131,31 @@ TEST_CASE("discover lists src/bin/*.cpp as additional binaries", "[layout]") {
|
||||
REQUIRE(r->binaries[2].name == "pkg");
|
||||
}
|
||||
|
||||
TEST_CASE("discover does not recurse into src/bin/", "[layout]") {
|
||||
TEST_CASE("discover ignores src/bin/<sub>/ subdirs without main.cpp", "[layout]") {
|
||||
TempProject p;
|
||||
p.touch("src/main.cpp");
|
||||
p.touch("src/bin/foo.cpp");
|
||||
p.touch("src/bin/sub/nested.cpp"); // should be ignored
|
||||
p.touch("src/bin/sub/nested.cpp"); // no main.cpp at sub/ root, ignored
|
||||
auto r = discover(p.root(), "pkg");
|
||||
REQUIRE(r.has_value());
|
||||
REQUIRE(r->binaries.size() == 2);
|
||||
}
|
||||
|
||||
TEST_CASE("discover lists src/bin/<sub>/main.cpp as a binary named <sub>",
|
||||
"[layout]") {
|
||||
TempProject p;
|
||||
p.touch("src/main.cpp");
|
||||
p.touch("src/bin/extra/main.cpp");
|
||||
p.touch("src/bin/extra/helpers.cpp"); // not collected in v1
|
||||
auto r = discover(p.root(), "pkg");
|
||||
REQUIRE(r.has_value());
|
||||
REQUIRE(r->binaries.size() == 2);
|
||||
REQUIRE(r->binaries[0].name == "extra");
|
||||
REQUIRE(r->binaries[0].entry.filename() == "main.cpp");
|
||||
REQUIRE(r->binaries[0].entry.parent_path().filename() == "extra");
|
||||
REQUIRE(r->binaries[1].name == "pkg");
|
||||
}
|
||||
|
||||
TEST_CASE("discover lists tests/*.cpp", "[layout]") {
|
||||
TempProject p;
|
||||
p.touch("src/main.cpp");
|
||||
|
||||
Reference in New Issue
Block a user