1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: fix compilation (#8511)

This commit is contained in:
Lukas Neubert 2021-02-02 11:06:54 +01:00 committed by GitHub
parent d57a9c419d
commit 5aaeac79fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 15 deletions

View File

@ -37,7 +37,7 @@ mut:
// parser context in the worker processes:
table table.Table
scope ast.Scope
pref pref.Preferences
pref &pref.Preferences
period_ms int // print periodic progress
stop_print bool // stop printing the periodic progress
}
@ -96,7 +96,9 @@ fn main() {
}
fn process_cli_args() &Context {
mut context := &Context{}
mut context := &Context{
pref: 0
}
context.myself = os.executable()
mut fp := flag.new_flag_parser(os.args_after('test-parser'))
fp.application(os.file_name(context.myself))

View File

@ -113,6 +113,7 @@ pub fn new(input_path string) Doc {
time_generated: time.now()
}
d.fmt = fmt.Fmt{
pref: 0
indent: 0
is_debug: false
table: d.table

View File

@ -13,6 +13,9 @@ const (
error_missing_vexe = 1
error_failed_tests = 2
b2v_keep_path = os.join_path('vlib', 'v', 'fmt', 'tests', 'bin2v_keep.vv')
fpref = &pref.Preferences{
is_fmt: true
}
)
fn test_fmt() {
@ -49,13 +52,10 @@ fn test_fmt() {
continue
}
table := table.new_table()
file_ast := parser.parse_file(ipath, table, .parse_comments, &pref.Preferences{
is_fmt: true
ccompiler: 'gcc'
}, &ast.Scope{
file_ast := parser.parse_file(ipath, table, .parse_comments, fpref, &ast.Scope{
parent: 0
})
result_ocontent := fmt.fmt(file_ast, table, false)
result_ocontent := fmt.fmt(file_ast, table, fpref, false)
if expected_ocontent != result_ocontent {
fmt_bench.fail()
eprintln(fmt_bench.step_message_fail('file $vrelpath after formatting, does not look as expected.'))

View File

@ -11,6 +11,9 @@ import v.util
const (
error_missing_vexe = 1
error_failed_tests = 2
fpref = &pref.Preferences{
is_fmt: true
}
)
fn test_fmt() {
@ -44,12 +47,10 @@ fn test_fmt() {
continue
}
table := table.new_table()
file_ast := parser.parse_file(ipath, table, .parse_comments, &pref.Preferences{
is_fmt: true
}, &ast.Scope{
file_ast := parser.parse_file(ipath, table, .parse_comments, fpref, &ast.Scope{
parent: 0
})
result_ocontent := fmt.fmt(file_ast, table, false)
result_ocontent := fmt.fmt(file_ast, table, fpref, false)
if expected_ocontent != result_ocontent {
fmt_bench.fail()
eprintln(fmt_bench.step_message_fail('file $ipath after formatting, does not look as expected.'))

View File

@ -11,6 +11,9 @@ import v.util
const (
error_missing_vexe = 1
error_failed_tests = 2
fpref = &pref.Preferences{
is_fmt: true
}
)
fn test_vlib_fmt() {
@ -42,12 +45,10 @@ fn test_vlib_fmt() {
continue
}
table := table.new_table()
file_ast := parser.parse_file(ipath, table, .parse_comments, &pref.Preferences{
is_fmt: true
}, &ast.Scope{
file_ast := parser.parse_file(ipath, table, .parse_comments, fpref, &ast.Scope{
parent: 0
})
result_ocontent := fmt.fmt(file_ast, table, false)
result_ocontent := fmt.fmt(file_ast, table, fpref, false)
if expected_ocontent != result_ocontent {
fmt_bench.fail()
eprintln(fmt_bench.step_message_fail('file $ipath after formatting, does not look as expected.'))