Skip to content

Commit 1411c27

Browse files
authored
ci: run v -W -silent test-self vlib on linux, so deprecations/warnings introduced in PRs, can fail (and be fixed) earlier (#25955)
1 parent 0d55187 commit 1411c27

21 files changed

+62
-39
lines changed

ci/linux_ci.vsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ fn test_pure_v_math_module() {
2121
2222
fn self_tests() {
2323
if common.is_github_job {
24-
exec('v -silent test-self vlib')
24+
exec('v -W -silent test-self vlib')
2525
} else {
2626
exec('v -progress test-self vlib')
2727
}
2828
}
2929
3030
fn build_examples() {
3131
if common.is_github_job {
32-
exec('v build-examples')
32+
exec('v -W build-examples')
3333
} else {
3434
exec('v -progress build-examples')
3535
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
vlib/v/checker/tests/comptime_compile_warn_with_string_interp_test.vv:6:3: warning: invalid type i8 5
2+
4 | $if T is i8 {
3+
5 | assert typeof[T]().name == typeof[i8]().name
4+
6 | $compile_warn('invalid type ${T.name} ${T.idx}')
5+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6+
7 | return 1
7+
8 | }
8+
vlib/v/checker/tests/comptime_compile_warn_with_string_interp_test.vv:16:3: warning: invalid type i8 5, i16 6
9+
14 | assert typeof[T]().name == typeof[i8]().name
10+
15 | assert typeof[R]().name == typeof[i16]().name
11+
16 | $compile_warn('invalid type ${T.name} ${T.idx}, ${R.name} ${R.idx}')
12+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13+
17 | return 1
14+
18 | }
15+
vlib/v/checker/tests/comptime_compile_warn_with_string_interp_test.vv:27:3: warning: invalid type i8 5, i16 6, i32 7
16+
25 | assert typeof[R]().name == typeof[i16]().name
17+
26 | assert typeof[E]().name == typeof[i32]().name
18+
27 | $compile_warn('invalid type ${T.name} ${T.idx}, ${R.name} ${R.idx}, ${E.name} ${E.idx}')
19+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20+
28 | return 1
21+
29 | }

vlib/v/tests/comptime/comptime_compile_warn_with_string_interp_test.v renamed to vlib/v/checker/tests/comptime_compile_warn_with_string_interp_test.vv

File renamed without changes.

vlib/v/tests/aliases/type_alias_of_pointer_types_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn test_alias_of_pointer() {
8686
println('Actual handle value is: ${handle}')
8787
println('Memory address of handle is: ${&handle}')
8888

89-
example(handle)
89+
unsafe { example(handle) }
9090
assert '${handle}' == '0'
9191
}
9292

vlib/v/tests/builtin_maps/map_complex_array_test.v

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ fn test_map_complex_array() {
1212
}
1313
arr := [instr]
1414
map1['Hello'] = arr
15-
map1['Hello'][0].a = 2
16-
println(map1['Hello'][0].a)
17-
assert map1['Hello'][0].a == 2
18-
assert map1['Hello'][0].b == 2
15+
unsafe {
16+
map1['Hello'][0].a = 2
17+
println(map1['Hello'][0].a)
18+
assert map1['Hello'][0].a == 2
19+
assert map1['Hello'][0].b == 2
20+
}
1921
}

vlib/v/tests/builtin_strings_and_interpolation/string_interpolation_test.v

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,12 @@ fn test_inttypes_string_interpolation() {
9797
ui := u32(3421958087) // 0xCBF6 EFC7
9898
vp := voidptr(ui)
9999
mut bp := &u8(unsafe { nil })
100-
$if x64 {
101-
bp = &u8(15541149836) // 0x3 9E53 208C
102-
} $else {
103-
bp = &u8(3541149836) // 0xD311 A88C
100+
unsafe {
101+
$if x64 {
102+
bp = &u8(15541149836) // 0x3 9E53 208C
103+
} $else {
104+
bp = &u8(3541149836) // 0xD311 A88C
105+
}
104106
}
105107
l := i64(-7694555558525237396)
106108
ul := u64(17234006112912956370)

vlib/v/tests/c_const_u8_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import net
1+
import net as _
22

33
const C.AF_UNIX u16
44

vlib/v/tests/c_function_mut_param/code_test.c.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module main
55
fn C.mut_arg(key &u8, mut val usize)
66

77
fn test_c_function_mut_param() {
8-
key := &u8(1)
8+
key := unsafe { &u8(1) }
99
mut val := usize(1)
1010
C.mut_arg(key, mut &val)
1111
assert val == usize(5)

vlib/v/tests/c_function_mut_param/option_args_test.c.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module main
55
fn C.mut_arg(&u8, mut val usize)
66

77
fn test_c_function_mut_param() {
8-
key := &u8(1)
8+
key := unsafe { &u8(1) }
99
mut val := usize(1)
1010
C.mut_arg(key, mut &val)
1111
assert val == usize(5)

vlib/v/tests/c_structs/cstruct_ref_test.c.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn (it C.MyCStruct) wrap() MyWrapper {
1616

1717
fn test_main() {
1818
dump(C.MyCStruct{
19-
data: &u8(123)
19+
data: unsafe { &u8(123) }
2020
}.wrap())
2121
assert true
2222
}

0 commit comments

Comments
 (0)