v/ci/freebsd_ci.vsh

69 lines
1.9 KiB
V

import os
import common { Task, exec }
fn v_doctor() {
dump(os.getenv('PATH'))
exec('v doctor')
if common.is_github_job {
exec('freebsd-version')
exec('sysctl hw.model')
exec('sysctl hw.ncpu')
exec('sysctl hw.physmem')
exec('sysctl hw.usermem')
exec('whoami')
exec('pwd')
exec('ls -la')
exec('git log -n1')
exec('cc --version')
}
}
fn build_v_with_prealloc() {
exec('v -cg -cstrict -o vstrict1 cmd/v')
exec('./vstrict1 -o vprealloc -prealloc cmd/v')
exec('./vprealloc run examples/hello_world.v')
exec('./vprealloc -o v3 cmd/v')
exec('./v3 -o v4 cmd/v')
exec('./v4 -d debug_malloc -d debug_realloc -o vdebug1 cmd/v')
}
fn verify_v_test_works() {
exec('echo \$VFLAGS')
exec('v cmd/tools/test_if_v_test_system_works.v')
exec('./cmd/tools/test_if_v_test_system_works')
}
fn build_fast_script() {
exec('cd cmd/tools/fast && v fast.v')
}
fn check_math() {
exec('v -silent test vlib/math')
println('Test the math module, using only the pure V versions,')
println(' without the .c.v overrides.')
exec('v -silent -exclude @vlib/math/*.c.v test vlib/math')
}
fn check_compress() {
exec('v -silent test vlib/compress')
}
fn run_essential_tests() {
if common.is_github_job {
exec('VTEST_JUST_ESSENTIAL=1 v -silent test-self')
} else {
exec('VTEST_JUST_ESSENTIAL=1 v -progress test-self')
}
}
const all_tasks = {
'v_doctor': Task{v_doctor, 'Run v doctor'}
'build_v_with_prealloc': Task{build_v_with_prealloc, 'Build V with prealloc'}
'verify_v_test_works': Task{verify_v_test_works, 'Verify that v test works'}
'build_fast_script': Task{build_fast_script, 'Check that building fast.v works'}
'check_math': Task{check_math, 'Check the `math` module works'}
'check_compress': Task{check_compress, 'Check the `compress` module works'}
'run_essential_tests': Task{run_essential_tests, 'Run only the essential tests'}
}
common.run(all_tasks)