mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Add ComponentCompiler::build_from_path
This commit is contained in:
parent
fd9d154b27
commit
9eecdefb35
5 changed files with 57 additions and 0 deletions
10
api/sixtyfps-cpp/tests/test.60
Normal file
10
api/sixtyfps-cpp/tests/test.60
Normal file
|
@ -0,0 +1,10 @@
|
|||
/* LICENSE BEGIN
|
||||
This file is part of the SixtyFPS Project -- https://sixtyfps.io
|
||||
Copyright (c) 2020 Olivier Goffart <olivier.goffart@sixtyfps.io>
|
||||
Copyright (c) 2020 Simon Hausmann <simon.hausmann@sixtyfps.io>
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-only
|
||||
This file is also available under commercial licensing terms.
|
||||
Please contact info@sixtyfps.io for more information.
|
||||
LICENSE END */
|
||||
export Test := Rectangle {}
|
|
@ -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());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue