tools: build examples, that start with module no_main as well

This commit is contained in:
Delyan Angelov 2025-02-19 17:19:50 +02:00
parent 4a8b3151b9
commit dfacc3321d
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED

View file

@ -796,9 +796,12 @@ pub fn prepare_test_session(zargs string, folder string, oskipped []string, main
}
c := os.read_file(fnormalised) or { panic(err) }
start := c#[0..header_bytes_to_search_for_module_main]
if start.contains('module ') && !start.contains('module main') {
skipped << fnormalised.replace(nparent_dir + '/', '')
continue next_file
if start.contains('module ') {
modname := start.all_after('module ').all_before('\n')
if modname !in ['main', 'no_main'] {
skipped << fnormalised.replace(nparent_dir + '/', '')
continue next_file
}
}
for skip_prefix in oskipped {
skip_folder := skip_prefix + '/'