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

ci: test self compilation with -autofree

This commit is contained in:
Alexander Medvednikov
2020-05-07 17:37:10 +02:00
parent d096763f62
commit be063d740b
4 changed files with 16 additions and 5 deletions

View File

@@ -33,11 +33,11 @@ pub fn (mut b Builder) gen_c(v_files []string) string {
pub fn (mut b Builder) build_c(v_files []string, out_file string) {
b.out_name_c = out_file
b.info('build_c($out_file)')
output := b.gen_c(v_files)
output2 := b.gen_c(v_files)
mut f := os.create(out_file) or {
panic(err)
}
f.writeln(output)
f.writeln(output2)
f.close()
// os.write_file(out_file, b.gen_c(v_files))
}

View File

@@ -43,7 +43,14 @@ pub fn compile(command string, pref &pref.Preferences) {
if pref.is_test || pref.is_run {
b.run_compiled_executable_and_exit()
}
// v.finalize_compilation()
b.myfree()
}
// Temporary, will be done by -autofree
fn (mut b Builder) myfree() {
// for file in b.parsed_files {
// }
b.parsed_files.free()
}
fn (mut b Builder) run_compiled_executable_and_exit() {
@@ -152,7 +159,7 @@ pub fn (v Builder) get_user_files() []string {
preludes_path := os.join_path(vroot, 'cmd', 'tools', 'preludes')
if v.pref.is_livemain || v.pref.is_liveshared {
user_files << os.join_path(preludes_path, 'live.v')
}
}
if v.pref.is_livemain {
user_files << os.join_path(preludes_path, 'live_main.v')
}