Add ComponentCompiler::build_from_path

This commit is contained in:
Simon Hausmann 2021-03-19 17:26:19 +01:00
parent fd9d154b27
commit 9eecdefb35
5 changed files with 57 additions and 0 deletions

View file

@ -277,4 +277,16 @@ SCENARIO("Component Compiler")
auto result = compiler.build_from_source("export Dummy := Rectangle {}", "");
REQUIRE(result.has_value());
}
SECTION("Compile failure from path")
{
auto result = compiler.build_from_path(SOURCE_DIR "/file-not-there.60");
REQUIRE_FALSE(result.has_value());
}
SECTION("Compile from path")
{
auto result = compiler.build_from_path(SOURCE_DIR "/tests/test.60");
REQUIRE(result.has_value());
}
}