Skip to content

Commit f6f2729

Browse files
committed
testing_framework: object shader argument support
1 parent cd9006b commit f6f2729

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

testing_framework/src/main.rs

+15
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ pub struct RustFileInfo {
5151
shader_texture: Vec<(String, usize)>,
5252
#[serde(default = "default_obj_files")]
5353
obj_files: Vec<PathBuf>,
54+
#[serde(default = "default_object_shader")]
55+
object_shader: Vec<(String, String)>,
5456
}
5557

5658
fn default_textures() -> Vec<PathBuf> {
@@ -65,6 +67,10 @@ fn default_obj_files() -> Vec<PathBuf> {
6567
vec![]
6668
}
6769

70+
fn default_object_shader() -> Vec<(String, String)> {
71+
vec![]
72+
}
73+
6874
impl Default for RustFileInfo {
6975
fn default() -> Self {
7076
Self {
@@ -83,6 +89,7 @@ impl Default for RustFileInfo {
8389
textures: vec![PathBuf::from("example_texture.png")],
8490
shader_texture: vec![("shader_1".to_string(), 0)],
8591
obj_files: vec![PathBuf::from("example_obj_file.obj")],
92+
object_shader: vec![("object_1".to_string(), "shader_1".to_string())],
8693
}
8794
}
8895
}
@@ -300,6 +307,14 @@ fn main() {
300307
command.arg(obj_file_path);
301308
});
302309
}
310+
if !file.object_shader.is_empty() {
311+
file.object_shader
312+
.iter()
313+
.for_each(|(object_name, shader_name)| {
314+
command.arg("--object-shader");
315+
command.arg(format!("{},{}", object_name, shader_name));
316+
});
317+
}
303318
command
304319
.arg("--rt-file")
305320
.arg(file.rt_path.as_path())

0 commit comments

Comments
 (0)