Use the GL backend in the CI for node tests

In the CI we set SIXTYFPS_NO_QT=1 and this change removes the testing
backend from the nodejs tests, in order to fix #419 .
This commit is contained in:
Simon Hausmann 2021-09-06 11:45:51 +02:00 committed by Simon Hausmann
parent 8b5e29534f
commit 7da24c40c3
4 changed files with 1 additions and 15 deletions

View file

@ -16,16 +16,11 @@ path = "lib.rs"
crate-type = ["cdylib"] crate-type = ["cdylib"]
name = "sixtyfps_node_native" name = "sixtyfps_node_native"
[features]
# Enable some function used by the integration tests
testing = ["sixtyfps-rendering-backend-testing"]
[dependencies] [dependencies]
once_cell = "1.5" once_cell = "1.5"
sixtyfps-compilerlib = { version = "=0.1.2", path="../../../sixtyfps_compiler" } sixtyfps-compilerlib = { version = "=0.1.2", path="../../../sixtyfps_compiler" }
sixtyfps-interpreter = { version = "=0.1.2", path="../../../sixtyfps_runtime/interpreter", features = ["display-diagnostics"] } sixtyfps-interpreter = { version = "=0.1.2", path="../../../sixtyfps_runtime/interpreter", features = ["display-diagnostics"] }
sixtyfps-corelib = { version = "=0.1.2", path="../../../sixtyfps_runtime/corelib" } sixtyfps-corelib = { version = "=0.1.2", path="../../../sixtyfps_runtime/corelib" }
sixtyfps-rendering-backend-testing = { version = "=0.1.2", path="../../../sixtyfps_runtime/rendering_backends/testing", optional = true }
scoped-tls-hkt = "0.1" scoped-tls-hkt = "0.1"
neon = "0.8.0" neon = "0.8.0"
css-color-parser2 = "1.0.1" css-color-parser2 = "1.0.1"

View file

@ -547,8 +547,6 @@ register_module!(mut m, {
m.export_function("load", load)?; m.export_function("load", load)?;
m.export_function("mock_elapsed_time", mock_elapsed_time)?; m.export_function("mock_elapsed_time", mock_elapsed_time)?;
m.export_function("singleshot_timer", singleshot_timer)?; m.export_function("singleshot_timer", singleshot_timer)?;
#[cfg(feature = "testing")]
m.export_function("init_testing_backend", init_testing_backend)?;
Ok(()) Ok(())
}); });
@ -558,9 +556,3 @@ fn mock_elapsed_time(mut cx: FunctionContext) -> JsResult<JsValue> {
sixtyfps_corelib::tests::sixtyfps_mock_elapsed_time(ms as _); sixtyfps_corelib::tests::sixtyfps_mock_elapsed_time(ms as _);
Ok(JsUndefined::new().as_value(&mut cx)) Ok(JsUndefined::new().as_value(&mut cx))
} }
#[cfg(feature = "testing")]
fn init_testing_backend(mut cx: FunctionContext) -> JsResult<JsValue> {
sixtyfps_rendering_backend_testing::init();
Ok(JsUndefined::new().as_value(&mut cx))
}

View file

@ -12,7 +12,7 @@ name = "test-driver-nodejs"
[dev-dependencies] [dev-dependencies]
test_driver_lib = { path = "../driverlib" } test_driver_lib = { path = "../driverlib" }
sixtyfps-node = { path = "../../../api/sixtyfps-node/native", features = ["testing"] } sixtyfps-node = { path = "../../../api/sixtyfps-node/native" }
lazy_static = "1.4.0" lazy_static = "1.4.0"
which = "4.0.2" which = "4.0.2"
tempfile = "3.2" tempfile = "3.2"

View file

@ -54,7 +54,6 @@ pub fn test(testcase: &test_driver_lib::TestCase) -> Result<(), Box<dyn Error>>
r#" r#"
const assert = require('assert').strict; const assert = require('assert').strict;
let sixtyfpslib = require(String.raw`{sixtyfpspath}`); let sixtyfpslib = require(String.raw`{sixtyfpspath}`);
sixtyfpslib.private_api.init_testing_backend();
let sixtyfps = require(String.raw`{path}`); let sixtyfps = require(String.raw`{path}`);
"#, "#,
sixtyfpspath = sixtyfpspath.to_string_lossy(), sixtyfpspath = sixtyfpspath.to_string_lossy(),