mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
markused: only add .vtest_ functions, *when* compiling _test.v files (#23003)
This commit is contained in:
parent
c7ee45fc64
commit
f2c281eadf
2 changed files with 21 additions and 5 deletions
18
.github/workflows/c2v_ci.yml
vendored
18
.github/workflows/c2v_ci.yml
vendored
|
@ -38,6 +38,15 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
- name: Build V
|
||||
run: make -j4 && ./v symlink
|
||||
|
||||
- name: Set 8.8.8.8 as dns server
|
||||
run: |
|
||||
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart systemd-networkd
|
||||
sudo systemctl restart systemd-resolved
|
||||
dig distro.ibiblio.org
|
||||
|
||||
- name: Install C2V
|
||||
run: |
|
||||
v retry -- v install --git https://github.com/vlang/c2v
|
||||
|
@ -73,6 +82,15 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
- name: Build V
|
||||
run: make -j4 && ./v symlink
|
||||
|
||||
- name: Set 8.8.8.8 as dns server
|
||||
run: |
|
||||
sudo sed -i 's/#DNS=/DNS=8.8.8.8 8.8.4.4/g' /etc/systemd/resolved.conf
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart systemd-networkd
|
||||
sudo systemctl restart systemd-resolved
|
||||
dig distro.ibiblio.org
|
||||
|
||||
- name: Install C2V
|
||||
run: |
|
||||
v retry -- v install --git https://github.com/vlang/c2v
|
||||
|
|
|
@ -42,12 +42,9 @@ pub fn mark_used(mut table ast.Table, mut pref_ pref.Preferences, ast_files []&a
|
|||
'error',
|
||||
'builtin_init',
|
||||
'fast_string_eq',
|
||||
// TODO: process the _vinit const initializations automatically too
|
||||
'main.vtest_init',
|
||||
'main.vtest_new_metainfo',
|
||||
'main.vtest_new_filemetainfo',
|
||||
'println',
|
||||
]
|
||||
|
||||
$if debug_used_features ? {
|
||||
dump(table.used_features)
|
||||
}
|
||||
|
@ -295,7 +292,7 @@ pub fn mark_used(mut table ast.Table, mut pref_ pref.Preferences, ast_files []&a
|
|||
}
|
||||
// testing framework:
|
||||
if pref_.is_test {
|
||||
if k.starts_with('test_') || k.contains('.test_') {
|
||||
if k.starts_with('test_') || k.contains('.test_') || k.contains('.vtest_') {
|
||||
all_fn_root_names << k
|
||||
continue
|
||||
}
|
||||
|
@ -400,6 +397,7 @@ pub fn mark_used(mut table ast.Table, mut pref_ pref.Preferences, ast_files []&a
|
|||
all_fn_root_names << 'time.unix' // used by json
|
||||
table.used_features.used_maps++ // json needs new_map etc
|
||||
}
|
||||
|
||||
mut walker := Walker.new(
|
||||
table: table
|
||||
files: ast_files
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue