mirror of
https://github.com/vlang/v.git
synced 2025-09-18 11:56:57 -04:00
ci,tests: fix compilation of vlib/v/tests/bench/gcboehm/GC_bench.v, add a CI task for checking that .v files inside vlib/v/tests/bench
continue to compile
This commit is contained in:
parent
e446eb5953
commit
8ae962b4d5
6
.github/workflows/linux_ci.yml
vendored
6
.github/workflows/linux_ci.yml
vendored
@ -76,10 +76,12 @@ jobs:
|
|||||||
run: TZ=Europe/Paris ./v test vlib/time/
|
run: TZ=Europe/Paris ./v test vlib/time/
|
||||||
- name: Build examples
|
- name: Build examples
|
||||||
run: ./v -W build-examples
|
run: ./v -W build-examples
|
||||||
- name: Test building v tools
|
- name: Build v tools
|
||||||
run: ./v -W build-tools
|
run: ./v -W build-tools
|
||||||
- name: Test v binaries
|
- name: Build v binaries
|
||||||
run: ./v build-vbinaries
|
run: ./v build-vbinaries
|
||||||
|
- name: Build benches
|
||||||
|
run: ./v should-compile-all vlib/v/tests/bench/
|
||||||
- name: Run a VSH script
|
- name: Run a VSH script
|
||||||
run: ./v run examples/v_script.vsh
|
run: ./v run examples/v_script.vsh
|
||||||
- name: Test v tutorials
|
- name: Test v tutorials
|
||||||
|
@ -26,21 +26,21 @@ const (
|
|||||||
|
|
||||||
fn waste_mem() {
|
fn waste_mem() {
|
||||||
mut objs := PtrPtrObj{
|
mut objs := PtrPtrObj{
|
||||||
nxt: []&PtrObj{len: n}
|
nxt: unsafe { []&PtrObj{len: n} }
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
sz := rand.int_in_range(10, 1000)
|
sz := rand.int_in_range(10, 1000) or { 10 }
|
||||||
mut new_obj := &PtrObj{
|
mut new_obj := &PtrObj{
|
||||||
nxt: []&DataObj{len: sz}
|
nxt: unsafe { []&DataObj{len: sz} }
|
||||||
}
|
}
|
||||||
sz2 := rand.int_in_range(10, 500000)
|
sz2 := rand.int_in_range(10, 500000) or { 10 }
|
||||||
new_obj2 := &DataObj{
|
new_obj2 := &DataObj{
|
||||||
data: []f64{len: sz2}
|
data: unsafe { []f64{len: sz2} }
|
||||||
}
|
}
|
||||||
idx2 := rand.int_in_range(0, sz)
|
idx2 := rand.int_in_range(0, sz) or { 0 }
|
||||||
new_obj.nxt[idx2] = new_obj2
|
new_obj.nxt[idx2] = new_obj2
|
||||||
// non-equally distributed random index
|
// non-equally distributed random index
|
||||||
idx := int(math.sqrt(math.sqrt(rand.f64n(n4))))
|
idx := int(math.sqrt(math.sqrt(rand.f64n(n4) or { 0.0 })))
|
||||||
objs.nxt[idx] = new_obj
|
objs.nxt[idx] = new_obj
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user