mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
tools: build examples, that start with module no_main
as well
This commit is contained in:
parent
4a8b3151b9
commit
dfacc3321d
1 changed files with 6 additions and 3 deletions
|
@ -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 + '/'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue