mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Attempt to fix window build by properly escaping backslashes
This commit is contained in:
parent
4f5e8c7aff
commit
3c46df46d9
1 changed files with 14 additions and 10 deletions
|
@ -69,36 +69,40 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
dir
|
dir
|
||||||
});
|
});
|
||||||
|
|
||||||
let test_function_name =
|
let test_function_name = testcase
|
||||||
testcase.relative_path.file_stem().unwrap().to_string_lossy().replace("/", "_");
|
.relative_path
|
||||||
|
.file_stem()
|
||||||
|
.unwrap()
|
||||||
|
.to_string_lossy()
|
||||||
|
.replace(|c: char| !c.is_ascii_alphanumeric(), "_");
|
||||||
|
|
||||||
write!(
|
write!(
|
||||||
tests_file,
|
tests_file,
|
||||||
r#"
|
r##"
|
||||||
#[test]
|
#[test]
|
||||||
fn test_cpp_{function_name}() {{
|
fn test_cpp_{function_name}() {{
|
||||||
cppdriver::test(&test_driver_lib::TestCase{{
|
cppdriver::test(&test_driver_lib::TestCase{{
|
||||||
absolute_path: std::path::PathBuf::from("{absolute_path}"),
|
absolute_path: std::path::PathBuf::from(r#"{absolute_path}"#),
|
||||||
relative_path: std::path::PathBuf::from("{relative_path}"),
|
relative_path: std::path::PathBuf::from(r#"{relative_path}"#),
|
||||||
}}).unwrap();
|
}}).unwrap();
|
||||||
}}
|
}}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_interpreter_{function_name}() {{
|
fn test_interpreter_{function_name}() {{
|
||||||
interpreter::test(&test_driver_lib::TestCase{{
|
interpreter::test(&test_driver_lib::TestCase{{
|
||||||
absolute_path: std::path::PathBuf::from("{absolute_path}"),
|
absolute_path: std::path::PathBuf::from(r#"{absolute_path}"#),
|
||||||
relative_path: std::path::PathBuf::from("{relative_path}"),
|
relative_path: std::path::PathBuf::from(r#"{relative_path}"#),
|
||||||
}}).unwrap();
|
}}).unwrap();
|
||||||
}}
|
}}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_nodejs_{function_name}() {{
|
fn test_nodejs_{function_name}() {{
|
||||||
nodejs::test(&test_driver_lib::TestCase{{
|
nodejs::test(&test_driver_lib::TestCase{{
|
||||||
absolute_path: std::path::PathBuf::from("{absolute_path}"),
|
absolute_path: std::path::PathBuf::from(r#"{absolute_path}"#),
|
||||||
relative_path: std::path::PathBuf::from("{relative_path}"),
|
relative_path: std::path::PathBuf::from(r#"{relative_path}"#),
|
||||||
}}).unwrap();
|
}}).unwrap();
|
||||||
}}
|
}}
|
||||||
"#,
|
"##,
|
||||||
function_name = test_function_name,
|
function_name = test_function_name,
|
||||||
absolute_path = testcase.absolute_path.to_string_lossy(),
|
absolute_path = testcase.absolute_path.to_string_lossy(),
|
||||||
relative_path = testcase.relative_path.to_string_lossy(),
|
relative_path = testcase.relative_path.to_string_lossy(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue