@@ -17,7 +17,7 @@ pub mod arbitraries {
1717 use reqwest:: Url ;
1818 use uuid:: Uuid ;
1919
20- use crate :: tasks:: { config:: CommonConfig , analysis, merge} ;
20+ use crate :: tasks:: { config:: CommonConfig , analysis, merge, coverage , report , fuzz } ;
2121
2222 prop_compose ! {
2323 fn arb_uuid( ) (
@@ -46,7 +46,8 @@ pub mod arbitraries {
4646 prop_compose ! {
4747 fn arb_url( ) (
4848 // Don't use this for any url that isn't just being used for a string comparison (as for the config tests)
49- url in r"https?://(www\.)?[-a-zA-Z0-9]{1,256}\.[a-zA-Z]{1,6}([-a-zA-Z]*)"
49+ // basically all that matters here is that we generate a parsable url
50+ url in r"https?://(www\.)?[-a-zA-Z0-9]{1,256}\.com"
5051 ) -> Url {
5152 match Url :: parse( & url) {
5253 Ok ( url) => url,
@@ -123,7 +124,7 @@ pub mod arbitraries {
123124 extra_output in option:: of( arb_synced_dir( ) ) ,
124125 min_available_memory_mb in any:: <u64 >( ) ,
125126 machine_identity in arb_machine_identity( ) ,
126- tags in prop:: collection:: hash_map( ".*" , ".*" , 10 ) ,
127+ tags in prop:: collection:: hash_map( ".*" , ".*" , 3 ) ,
127128 from_agent_to_task_endpoint in ".*" ,
128129 from_task_to_agent_endpoint in ".*" ,
129130 ) -> CommonConfig {
@@ -240,4 +241,229 @@ pub mod arbitraries {
240241 arb_merge_config ( ) . boxed ( )
241242 }
242243 }
244+
245+ prop_compose ! {
246+ fn arb_coverage_config( ) (
247+ target_exe in arb_pathbuf( ) ,
248+ target_env in prop:: collection:: hash_map( ".*" , ".*" , 10 ) ,
249+ target_options in arb_string_vec_no_vars( ) ,
250+ target_timeout in option:: of( any:: <u64 >( ) ) ,
251+ coverage_filter in option:: of( ".*" ) ,
252+ module_allowlist in option:: of( ".*" ) ,
253+ source_allowlist in option:: of( ".*" ) ,
254+ input_queue in Just ( None ) ,
255+ readonly_inputs in prop:: collection:: vec( arb_synced_dir( ) , 10 ) ,
256+ coverage in arb_synced_dir( ) ,
257+ common in arb_common_config( ) ,
258+ ) -> coverage:: generic:: Config {
259+ coverage:: generic:: Config {
260+ target_exe,
261+ target_env,
262+ target_options,
263+ target_timeout,
264+ coverage_filter,
265+ module_allowlist,
266+ source_allowlist,
267+ input_queue,
268+ readonly_inputs,
269+ coverage,
270+ common,
271+ }
272+ }
273+ }
274+
275+ impl Arbitrary for coverage:: generic:: Config {
276+ type Parameters = ( ) ;
277+ type Strategy = BoxedStrategy < Self > ;
278+
279+ fn arbitrary_with ( _args : Self :: Parameters ) -> Self :: Strategy {
280+ arb_coverage_config ( ) . boxed ( )
281+ }
282+ }
283+
284+ prop_compose ! {
285+ fn arb_dotnet_coverage_config( ) (
286+ target_exe in arb_pathbuf( ) ,
287+ target_env in prop:: collection:: hash_map( ".*" , ".*" , 10 ) ,
288+ target_options in arb_string_vec_no_vars( ) ,
289+ target_timeout in option:: of( any:: <u64 >( ) ) ,
290+ input_queue in Just ( None ) ,
291+ readonly_inputs in prop:: collection:: vec( arb_synced_dir( ) , 10 ) ,
292+ coverage in arb_synced_dir( ) ,
293+ tools in arb_synced_dir( ) ,
294+ common in arb_common_config( ) ,
295+ ) -> coverage:: dotnet:: Config {
296+ coverage:: dotnet:: Config {
297+ target_exe,
298+ target_env,
299+ target_options,
300+ target_timeout,
301+ input_queue,
302+ readonly_inputs,
303+ coverage,
304+ tools,
305+ common,
306+ }
307+ }
308+ }
309+
310+ impl Arbitrary for coverage:: dotnet:: Config {
311+ type Parameters = ( ) ;
312+ type Strategy = BoxedStrategy < Self > ;
313+
314+ fn arbitrary_with ( _args : Self :: Parameters ) -> Self :: Strategy {
315+ arb_dotnet_coverage_config ( ) . boxed ( )
316+ }
317+ }
318+
319+ prop_compose ! {
320+ fn arb_dotnet_report_config( ) (
321+ target_exe in arb_pathbuf( ) ,
322+ target_env in prop:: collection:: hash_map( ".*" , ".*" , 10 ) ,
323+ target_options in arb_string_vec_no_vars( ) ,
324+ target_timeout in option:: of( any:: <u64 >( ) ) ,
325+ input_queue in Just ( None ) ,
326+ crashes in option:: of( arb_synced_dir( ) ) ,
327+ reports in option:: of( arb_synced_dir( ) ) ,
328+ unique_reports in option:: of( arb_synced_dir( ) ) ,
329+ no_repro in option:: of( arb_synced_dir( ) ) ,
330+ tools in arb_synced_dir( ) ,
331+ check_fuzzer_help in any:: <bool >( ) ,
332+ check_retry_count in any:: <u64 >( ) ,
333+ minimized_stack_depth in option:: of( any:: <usize >( ) ) ,
334+ check_queue in any:: <bool >( ) ,
335+ common in arb_common_config( ) ,
336+ ) -> report:: dotnet:: generic:: Config {
337+ report:: dotnet:: generic:: Config {
338+ target_exe,
339+ target_env,
340+ target_options,
341+ target_timeout,
342+ input_queue,
343+ crashes,
344+ reports,
345+ unique_reports,
346+ no_repro,
347+ tools,
348+ check_fuzzer_help,
349+ check_retry_count,
350+ minimized_stack_depth,
351+ check_queue,
352+ common,
353+ }
354+ }
355+ }
356+
357+ impl Arbitrary for report:: dotnet:: generic:: Config {
358+ type Parameters = ( ) ;
359+ type Strategy = BoxedStrategy < Self > ;
360+
361+ fn arbitrary_with ( _args : Self :: Parameters ) -> Self :: Strategy {
362+ arb_dotnet_report_config ( ) . boxed ( )
363+ }
364+ }
365+
366+ prop_compose ! {
367+ fn arb_generator_fuzz_config( ) (
368+ generator_exe in Just ( "src/lib.rs" . to_string( ) ) ,
369+ generator_env in prop:: collection:: hash_map( ".*" , ".*" , 10 ) ,
370+ generator_options in arb_string_vec_no_vars( ) ,
371+ readonly_inputs in prop:: collection:: vec( arb_synced_dir( ) , 10 ) ,
372+ crashes in arb_synced_dir( ) ,
373+ tools in option:: of( arb_synced_dir( ) ) ,
374+ target_exe in arb_pathbuf( ) ,
375+ target_env in prop:: collection:: hash_map( ".*" , ".*" , 10 ) ,
376+ target_options in arb_string_vec_no_vars( ) ,
377+ target_timeout in option:: of( any:: <u64 >( ) ) ,
378+ check_asan_log in any:: <bool >( ) ,
379+ check_debugger in any:: <bool >( ) ,
380+ check_retry_count in any:: <u64 >( ) ,
381+ rename_output in any:: <bool >( ) ,
382+ ensemble_sync_delay in option:: of( any:: <u64 >( ) ) ,
383+ common in arb_common_config( ) ,
384+ ) -> fuzz:: generator:: Config {
385+ fuzz:: generator:: Config {
386+ generator_exe,
387+ generator_env,
388+ generator_options,
389+ readonly_inputs,
390+ crashes,
391+ tools,
392+ target_exe,
393+ target_env,
394+ target_options,
395+ target_timeout,
396+ check_asan_log,
397+ check_debugger,
398+ check_retry_count,
399+ rename_output,
400+ ensemble_sync_delay,
401+ common,
402+ }
403+ }
404+ }
405+
406+ impl Arbitrary for fuzz:: generator:: Config {
407+ type Parameters = ( ) ;
408+ type Strategy = BoxedStrategy < Self > ;
409+
410+ fn arbitrary_with ( _args : Self :: Parameters ) -> Self :: Strategy {
411+ arb_generator_fuzz_config ( ) . boxed ( )
412+ }
413+ }
414+
415+ prop_compose ! {
416+ fn arb_supervisor_config( ) (
417+ inputs in arb_synced_dir( ) ,
418+ crashes in arb_synced_dir( ) ,
419+ crashdumps in option:: of( arb_synced_dir( ) ) ,
420+ supervisor_exe in Just ( "src/lib.rs" . to_string( ) ) ,
421+ supervisor_env in prop:: collection:: hash_map( ".*" , ".*" , 0 ) ,
422+ supervisor_options in arb_string_vec_no_vars( ) ,
423+ supervisor_input_marker in option:: of( ".*" ) ,
424+ target_exe in option:: of( arb_pathbuf( ) ) ,
425+ target_options in option:: of( arb_string_vec_no_vars( ) ) ,
426+ tools in option:: of( arb_synced_dir( ) ) ,
427+ wait_for_files in Just ( None ) ,
428+ stats_file in Just ( None ) ,
429+ stats_format in Just ( None ) ,
430+ ensemble_sync_delay in Just ( None ) ,
431+ reports in option:: of( arb_synced_dir( ) ) ,
432+ unique_reports in Just ( None ) ,
433+ no_repro in Just ( None ) ,
434+ coverage in option:: of( arb_synced_dir( ) ) ,
435+ common in arb_common_config( ) ,
436+ ) -> fuzz:: supervisor:: SupervisorConfig {
437+ fuzz:: supervisor:: SupervisorConfig {
438+ inputs,
439+ crashes,
440+ crashdumps,
441+ supervisor_exe,
442+ supervisor_env,
443+ supervisor_options,
444+ supervisor_input_marker,
445+ target_exe,
446+ target_options,
447+ tools,
448+ wait_for_files,
449+ stats_file,
450+ stats_format,
451+ ensemble_sync_delay,
452+ reports,
453+ unique_reports,
454+ no_repro,
455+ coverage,
456+ common,
457+ }
458+ }
459+ }
460+
461+ impl Arbitrary for fuzz:: supervisor:: SupervisorConfig {
462+ type Parameters = ( ) ;
463+ type Strategy = BoxedStrategy < Self > ;
464+
465+ fn arbitrary_with ( _args : Self :: Parameters ) -> Self :: Strategy {
466+ arb_supervisor_config ( ) . boxed ( )
467+ }
468+ }
243469}
0 commit comments