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,10 +796,13 @@ pub fn prepare_test_session(zargs string, folder string, oskipped []string, main
|
||||||
}
|
}
|
||||||
c := os.read_file(fnormalised) or { panic(err) }
|
c := os.read_file(fnormalised) or { panic(err) }
|
||||||
start := c#[0..header_bytes_to_search_for_module_main]
|
start := c#[0..header_bytes_to_search_for_module_main]
|
||||||
if start.contains('module ') && !start.contains('module main') {
|
if start.contains('module ') {
|
||||||
|
modname := start.all_after('module ').all_before('\n')
|
||||||
|
if modname !in ['main', 'no_main'] {
|
||||||
skipped << fnormalised.replace(nparent_dir + '/', '')
|
skipped << fnormalised.replace(nparent_dir + '/', '')
|
||||||
continue next_file
|
continue next_file
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for skip_prefix in oskipped {
|
for skip_prefix in oskipped {
|
||||||
skip_folder := skip_prefix + '/'
|
skip_folder := skip_prefix + '/'
|
||||||
if fnormalised.starts_with(skip_folder) {
|
if fnormalised.starts_with(skip_folder) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue