diff --git a/deps/src/qmlwrap/wrap_qml.cpp b/deps/src/qmlwrap/wrap_qml.cpp index 1a535cd..a776b9c 100644 --- a/deps/src/qmlwrap/wrap_qml.cpp +++ b/deps/src/qmlwrap/wrap_qml.cpp @@ -62,8 +62,8 @@ JULIA_CPP_MODULE_BEGIN(registry) if(!success) { e->quit(); + jl_error("Error loading QML"); } - return success; }); qml_module.method("qt_prefix_path", []() { return QLibraryInfo::location(QLibraryInfo::PrefixPath); }); diff --git a/test/badqml.jl b/test/badqml.jl new file mode 100644 index 0000000..e82942a --- /dev/null +++ b/test/badqml.jl @@ -0,0 +1,7 @@ +using QML +try + @qmlapp joinpath(dirname(@__FILE__), "qml", "badqml.qml") + exec() +catch e + @test e.msg == "Error loading QML" +end \ No newline at end of file diff --git a/test/functions.jl b/test/functions.jl index bbb4808..7c9dce1 100644 --- a/test/functions.jl +++ b/test/functions.jl @@ -70,7 +70,7 @@ set_state2 = TestModuleFunction.set_state2 qmlfunction("unexported_return_two", UnExported.return_two) qmlfunction("unexported_check", UnExported.check) -@test(@qmlapp joinpath(dirname(@__FILE__), "qml", "functions.qml")) +@qmlapp joinpath(dirname(@__FILE__), "qml", "functions.qml") exec() stringresult = VERSION < v"0.5-dev" ? ASCIIString : String diff --git a/test/qml/badqml.qml b/test/qml/badqml.qml new file mode 100644 index 0000000..2d22a3b --- /dev/null +++ b/test/qml/badqml.qml @@ -0,0 +1,7 @@ +import QtQuick 2.7 +import QtQuick.Controls 1.5 + +ApplicationWindow { + visible: true + fail +} \ No newline at end of file