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

tests: unify all temporary files/folders under $VTMP/v, that can be cleaned by v wipe-cache (#15774)

This commit is contained in:
Delyan Angelov
2022-09-16 04:56:19 +03:00
committed by GitHub
parent 7e69619add
commit f922ed0941
28 changed files with 210 additions and 144 deletions

View File

@ -1,5 +1,17 @@
import os
const vexe = @VEXE
const tfolder = os.join_path(os.temp_dir(), 'v', 'vbump')
fn testsuite_begin() {
os.mkdir_all(tfolder) or {}
}
fn testsuite_end() {
os.rmdir_all(tfolder) or {}
}
struct BumpTestCase {
file_name string
contents string
@ -62,10 +74,7 @@ fn main() {
]
fn run_individual_test(case BumpTestCase) ? {
vexe := @VEXE
temp_dir := os.temp_dir()
test_file := os.join_path_single(temp_dir, case.file_name)
test_file := os.join_path_single(tfolder, case.file_name)
os.rm(test_file) or {}
os.write_file(test_file, case.contents)?