From 5f9247cb8e2bb388d40191cc80f3d9552d51de25 Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Thu, 27 Dec 2018 14:25:47 -0600 Subject: [PATCH] Make emtest generation cargo fmt friendly --- build/emtests.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build/emtests.rs b/build/emtests.rs index 43a819402..dee31a190 100644 --- a/build/emtests.rs +++ b/build/emtests.rs @@ -116,7 +116,12 @@ pub fn compile(file: &str, ignores: &Vec) -> Option { let contents = format!( "#[test]{ignore} fn test_{rs_module_name}() {{ - assert_emscripten_output!(\"../../{module_path}\", \"{rs_module_name}\", vec![], \"../../{test_output_path}\"); + assert_emscripten_output!( + \"../../{module_path}\", + \"{rs_module_name}\", + vec![], + \"../../{test_output_path}\" + ); }} ", ignore = ignored, @@ -147,7 +152,7 @@ pub fn build() { let test = path.to_str().unwrap(); if !EXCLUDES.iter().any(|e| test.ends_with(e)) { if let Some(module_name) = compile(test, &ignores) { - modules.push(format!("mod {};", module_name)); + modules.push(module_name); } } } @@ -155,6 +160,8 @@ pub fn build() { } } } + modules.sort(); + let mut modules: Vec = modules.iter().map(|m| format!("mod {};", m)).collect(); assert!(modules.len() > 0, "Expected > 0 modules found"); modules.insert(0, BANNER.to_string());