mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
implement 'v build-vbinaries' tooling
This commit is contained in:

committed by
Alexander Medvednikov

parent
5ff387bbe4
commit
ee1edab2a9
@ -27,7 +27,7 @@ fn v_test_compiler(vargs string){
|
||||
|
||||
/*
|
||||
if !os.file_exists(parent_dir + '/v.v') {
|
||||
println('v.v is missing, it must be next to the V executable')
|
||||
eprintln('v.v is missing, it must be next to the V executable')
|
||||
exit(1)
|
||||
}
|
||||
*/
|
||||
@ -37,38 +37,37 @@ fn v_test_compiler(vargs string){
|
||||
if os.file_exists('/v.v') {
|
||||
os.system('$vexe -o v.c v.v')
|
||||
if os.system('cc -Werror v.c') != 0 {
|
||||
println('cc failed to build v.c without warnings')
|
||||
eprintln('cc failed to build v.c without warnings')
|
||||
exit(1)
|
||||
}
|
||||
println('v.c can be compiled without warnings. This is good :)')
|
||||
eprintln('v.c can be compiled without warnings. This is good :)')
|
||||
}
|
||||
}
|
||||
|
||||
building_tools_failed := testing.v_build_failing(vargs, 'tools')
|
||||
|
||||
println('\nTesting all _test.v files...')
|
||||
eprintln('\nTesting all _test.v files...')
|
||||
mut compiler_test_session := testing.new_test_sesion( vargs )
|
||||
compiler_test_session.files << os.walk_ext(parent_dir, '_test.v')
|
||||
compiler_test_session.test()
|
||||
println( compiler_test_session.benchmark.total_message('running V tests') )
|
||||
eprintln( compiler_test_session.benchmark.total_message('running V tests') )
|
||||
|
||||
println('')
|
||||
eprintln('')
|
||||
building_examples_failed := testing.v_build_failing(vargs, 'examples')
|
||||
|
||||
|
||||
eprintln('')
|
||||
v_module_install_cmd := '$vexe install nedpals.args'
|
||||
println('\nInstalling a v module with: $v_module_install_cmd ')
|
||||
eprintln('\nInstalling a v module with: $v_module_install_cmd ')
|
||||
mut vmark := benchmark.new_benchmark()
|
||||
ret := os.system(v_module_install_cmd)
|
||||
if ret != 0 {
|
||||
println('failed to run v install')
|
||||
exit(1)
|
||||
eprintln('failed to run v install')
|
||||
}
|
||||
if !os.file_exists(v_modules_path + '/nedpals/args') {
|
||||
println('v failed to install a test module')
|
||||
exit(1)
|
||||
eprintln('v failed to install a test module')
|
||||
}
|
||||
vmark.stop()
|
||||
println( 'Installing a v module took: ' + vmark.total_duration().str() + 'ms')
|
||||
eprintln( 'Installing a v module took: ' + vmark.total_duration().str() + 'ms')
|
||||
|
||||
if building_tools_failed || compiler_test_session.failed || building_examples_failed {
|
||||
exit(1)
|
||||
|
Reference in New Issue
Block a user