tools: use the same same skipping logic for the platform specific _test.v files in v test-self too (#20815)

This commit is contained in:
Delyan Angelov 2024-02-13 18:36:51 +02:00 committed by GitHub
parent 8215f21585
commit f43b52860d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 19 additions and 18 deletions

View file

@ -13,6 +13,8 @@ import runtime
import rand
import strings
pub const host_os = pref.get_host_os()
pub const github_job = os.getenv('GITHUB_JOB')
pub const runner_os = os.getenv('RUNNER_OS') // GitHub runner OS
@ -386,6 +388,23 @@ pub fn (mut ts TestSession) test() {
if ts.build_tools && dot_relative_file.ends_with('_test.v') {
continue
}
// Skip OS-specific tests if we are not running that OS
// Special case for android_outside_termux because of its
// underscores
if file.ends_with('_android_outside_termux_test.v') {
if !testing.host_os.is_target_of('android_outside_termux') {
remaining_files << dot_relative_file
ts.skip_files << file
continue
}
}
os_target := file.all_before_last('_test.v').all_after_last('_')
if !testing.host_os.is_target_of(os_target) {
remaining_files << dot_relative_file
ts.skip_files << file
continue
}
remaining_files << dot_relative_file
}
remaining_files = vtest.filter_vtest_only(remaining_files, fix_slashes: false)