@@ -3,8 +3,10 @@ use std::str;
33
44use anyhow:: { Context , Result , bail} ;
55use itertools:: { Itertools , Position } ;
6+ use js_bindgen_shared:: IS_TEST_SECTION ;
67use wasm_encoder:: {
7- EntityType , ImportSection , Module , ProducersField , ProducersSection , RawSection , Section ,
8+ CustomSection , EntityType , ImportSection , Module , ProducersField , ProducersSection , RawSection ,
9+ Section ,
810} ;
911use wasmparser:: { Encoding , KnownCustom , Parser , Payload , TypeRef } ;
1012
@@ -19,6 +21,7 @@ pub fn processing(
1921 mut js_output : impl Write ,
2022 main_memory : MainMemory < ' _ > ,
2123 mut js_store : JsStore ,
24+ is_test : bool ,
2225) -> Result < Vec < u8 > > {
2326 // Start building final Wasm and JS.
2427 let mut wasm_output = Vec :: new ( ) ;
@@ -107,6 +110,14 @@ pub fn processing(
107110 }
108111 }
109112
113+ if is_test {
114+ CustomSection {
115+ name : IS_TEST_SECTION . into ( ) ,
116+ data : ( & [ ] ) . into ( ) ,
117+ }
118+ . append_to ( & mut wasm_output) ;
119+ }
120+
110121 let memory = memory. context ( "main memory should be present" ) ?;
111122 js_store. assert_expected ( ) ?;
112123
0 commit comments