From e465f7490c13b59a4c275c5f47967cbc8e2d66a5 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:16:19 +0100 Subject: [PATCH] tests: cleanup legacy temp path (#19716) --- cmd/tools/test_if_v_test_system_works.v | 2 +- cmd/tools/vbump_test.v | 7 ++++--- cmd/tools/vcheck-md.v | 2 +- cmd/tools/vcomplete_test.v | 7 ++++--- cmd/tools/vgret.v | 2 +- cmd/tools/vrepl.v | 2 +- vlib/io/util/util_test.v | 2 +- vlib/net/unix/unix_test.v | 7 ++++--- vlib/net/unix/use_net_and_net_unix_together_test.v | 11 +++++------ vlib/orm/orm_sql_or_blocks_test.v | 7 ++++--- vlib/os/file_test.v | 7 ++++--- vlib/os/find_abs_path_of_executable_test.v | 2 +- vlib/os/inode_test.v | 2 +- vlib/os/os_test.v | 2 +- vlib/os/process_test.v | 2 +- vlib/stbi/stbi_test.v | 2 +- vlib/toml/tests/alexcrichton_toml_rs_test.v | 2 +- vlib/toml/tests/burntsushi_toml_test.v | 2 +- vlib/toml/tests/iarna_toml_spec_test.v | 2 +- vlib/toml/tests/toml_test.v | 2 +- vlib/v/builder/builder_test.v | 7 ++++--- vlib/v/builder/interpreterbuilder/v_interpret_test.v | 2 +- vlib/v/gen/c/coutput_test.v | 4 ++-- vlib/v/gen/golang/tests/golang_test.v | 2 +- vlib/v/gen/js/jsgen_test.v | 2 +- vlib/v/gen/native/tests/native_test.v | 2 +- vlib/v/gen/wasm/tests/wasm_test.v | 2 +- vlib/v/live/live_test.v | 2 +- vlib/v/pref/options_test.v | 7 ++++--- vlib/v/slow_tests/crun_mode/crun_test.v | 10 +++++----- vlib/v/slow_tests/valgrind/valgrind_test.v | 2 +- vlib/v/tests/closure_generator_test.v | 2 +- vlib/v/tests/run_v_code_from_stdin_test.v | 10 +++++----- vlib/v/vcache/vcache_test.v | 4 +--- vlib/vweb/assets/assets_test.v | 2 +- 35 files changed, 69 insertions(+), 65 deletions(-) diff --git a/cmd/tools/test_if_v_test_system_works.v b/cmd/tools/test_if_v_test_system_works.v index d58db904f5..eac5fcff52 100644 --- a/cmd/tools/test_if_v_test_system_works.v +++ b/cmd/tools/test_if_v_test_system_works.v @@ -26,7 +26,7 @@ fn get_vexe_path() string { } fn new_tdir() string { - dir := os.join_path(os.vtmp_dir(), 'v', rand.ulid()) + dir := os.join_path(os.vtmp_dir(), rand.ulid()) os.rmdir_all(dir) or {} os.mkdir_all(dir) or { panic(err) } C.atexit(cleanup_tdir) diff --git a/cmd/tools/vbump_test.v b/cmd/tools/vbump_test.v index c886ebaf39..2b997da580 100644 --- a/cmd/tools/vbump_test.v +++ b/cmd/tools/vbump_test.v @@ -1,8 +1,9 @@ import os -const vexe = @VEXE - -const tfolder = os.join_path(os.vtmp_dir(), 'v', 'vbump') +const ( + vexe = @VEXE + tfolder = os.join_path(os.vtmp_dir(), 'vbump') +) fn testsuite_begin() { os.mkdir_all(tfolder) or {} diff --git a/cmd/tools/vcheck-md.v b/cmd/tools/vcheck-md.v index 177df2294e..0a4e6d5f11 100644 --- a/cmd/tools/vcheck-md.v +++ b/cmd/tools/vcheck-md.v @@ -21,7 +21,7 @@ const ( show_progress = os.getenv('GITHUB_JOB') == '' && '-silent' !in os.args non_option_args = cmdline.only_non_options(os.args[2..]) is_verbose = os.getenv('VERBOSE') != '' - vcheckfolder = os.join_path(os.vtmp_dir(), 'v', 'vcheck_${os.getuid()}') + vcheckfolder = os.join_path(os.vtmp_dir(), 'vcheck_${os.getuid()}') should_autofix = os.getenv('VAUTOFIX') != '' vexe = @VEXE ) diff --git a/cmd/tools/vcomplete_test.v b/cmd/tools/vcomplete_test.v index 224158b373..0e3853b13f 100644 --- a/cmd/tools/vcomplete_test.v +++ b/cmd/tools/vcomplete_test.v @@ -1,8 +1,9 @@ import os -const vexe = @VEXE - -const tfolder = os.join_path(os.vtmp_dir(), 'v', 'vcomplete_test') +const ( + vexe = @VEXE + tfolder = os.join_path(os.vtmp_dir(), 'vcomplete_test') +) enum Shell { bash diff --git a/cmd/tools/vgret.v b/cmd/tools/vgret.v index dcd93e8dd5..c5b00ed07a 100644 --- a/cmd/tools/vgret.v +++ b/cmd/tools/vgret.v @@ -58,7 +58,7 @@ Examples: Compare screenshots in `/tmp/src` to existing screenshots in `/tmp/dst` v gret --compare-only /tmp/src /tmp/dst ' - tmp_dir = os.join_path(os.vtmp_dir(), 'v', tool_name) + tmp_dir = os.join_path(os.vtmp_dir(), tool_name) runtime_os = os.user_os() v_root = os.real_path(@VMODROOT) ) diff --git a/cmd/tools/vrepl.v b/cmd/tools/vrepl.v index f2d737dc2e..2daa2eae1c 100644 --- a/cmd/tools/vrepl.v +++ b/cmd/tools/vrepl.v @@ -35,7 +35,7 @@ const ( is_stdin_a_pipe = os.is_atty(0) == 0 vexe = os.getenv('VEXE') vstartup = os.getenv('VSTARTUP') - repl_folder = os.join_path(os.vtmp_dir(), 'v', 'repl') + repl_folder = os.join_path(os.vtmp_dir(), 'repl') ) enum FnType { diff --git a/vlib/io/util/util_test.v b/vlib/io/util/util_test.v index 3ece4fa7f3..396f630ad7 100644 --- a/vlib/io/util/util_test.v +++ b/vlib/io/util/util_test.v @@ -5,7 +5,7 @@ const ( // tfolder will contain all the temporary files/subfolders made by // the different tests. It would be removed in testsuite_end(), so // individual os tests do not need to clean up after themselves. - tfolder = os.join_path(os.vtmp_dir(), 'v', 'tests', 'io_util_test') + tfolder = os.join_path(os.vtmp_dir(), 'tests', 'io_util_test') ) fn testsuite_begin() { diff --git a/vlib/net/unix/unix_test.v b/vlib/net/unix/unix_test.v index f41247b7c7..ba23fbe1eb 100644 --- a/vlib/net/unix/unix_test.v +++ b/vlib/net/unix/unix_test.v @@ -1,9 +1,10 @@ import os import net.unix -const tfolder = os.join_path(os.vtmp_dir(), 'v', 'unix_test') - -const test_port = os.join_path(tfolder, 'unix_domain_socket') +const ( + tfolder = os.join_path(os.vtmp_dir(), 'unix_test') + test_port = os.join_path(tfolder, 'unix_domain_socket') +) fn testsuite_begin() { os.mkdir_all(tfolder) or {} diff --git a/vlib/net/unix/use_net_and_net_unix_together_test.v b/vlib/net/unix/use_net_and_net_unix_together_test.v index 2a835a62e2..498973dea8 100644 --- a/vlib/net/unix/use_net_and_net_unix_together_test.v +++ b/vlib/net/unix/use_net_and_net_unix_together_test.v @@ -2,12 +2,11 @@ import os import net.unix import net -// ensure that `net` is used, i.e. no warnings -const use_net = net.no_timeout - -const tfolder = os.join_path(os.vtmp_dir(), 'v', 'net_and_unix_together') - -const test_port = os.join_path(tfolder, 'unix_domain_socket') +const ( + use_net = net.no_timeout // ensure that `net` is used, i.e. no warnings + tfolder = os.join_path(os.vtmp_dir(), 'net_and_unix_together') + test_port = os.join_path(tfolder, 'unix_domain_socket') +) fn testsuite_begin() { os.mkdir_all(tfolder) or {} diff --git a/vlib/orm/orm_sql_or_blocks_test.v b/vlib/orm/orm_sql_or_blocks_test.v index 4b6a000bb0..f85bc16c94 100644 --- a/vlib/orm/orm_sql_or_blocks_test.v +++ b/vlib/orm/orm_sql_or_blocks_test.v @@ -6,9 +6,10 @@ struct User { name string [unique] } -const db_folder = os.join_path(os.vtmp_dir(), 'v', 'orm_sql') - -const db_path = os.join_path(db_folder, 'sql_statement_or_blocks.db') +const ( + db_folder = os.join_path(os.vtmp_dir(), 'orm_sql') + db_path = os.join_path(db_folder, 'sql_statement_or_blocks.db') +) fn testsuite_begin() { os.mkdir_all(db_folder) or {} diff --git a/vlib/os/file_test.v b/vlib/os/file_test.v index fc1582be6b..734f972531 100644 --- a/vlib/os/file_test.v +++ b/vlib/os/file_test.v @@ -1,8 +1,9 @@ import os -const tfolder = os.join_path(os.vtmp_dir(), 'v', 'tests', 'os_file_test') - -const tfile = os.join_path_single(tfolder, 'test_file') +const ( + tfolder = os.join_path(os.vtmp_dir(), 'tests', 'os_file_test') + tfile = os.join_path_single(tfolder, 'test_file') +) fn testsuite_begin() { os.rmdir_all(tfolder) or {} diff --git a/vlib/os/find_abs_path_of_executable_test.v b/vlib/os/find_abs_path_of_executable_test.v index 14bf6c899a..fbc31e8ca8 100644 --- a/vlib/os/find_abs_path_of_executable_test.v +++ b/vlib/os/find_abs_path_of_executable_test.v @@ -1,7 +1,7 @@ import os fn test_find_abs_path_of_executable() { - tfolder := os.join_path(os.vtmp_dir(), 'v', 'tests', 'filepath_test') + tfolder := os.join_path(os.vtmp_dir(), 'tests', 'filepath_test') os.rmdir_all(tfolder) or {} assert !os.is_dir(tfolder) os.mkdir_all(tfolder)! diff --git a/vlib/os/inode_test.v b/vlib/os/inode_test.v index ab44d53731..c29fb93af3 100644 --- a/vlib/os/inode_test.v +++ b/vlib/os/inode_test.v @@ -4,7 +4,7 @@ const ( // tfolder will contain all the temporary files/subfolders made by // the different tests. It would be removed in testsuite_end(), so // individual os tests do not need to clean up after themselves. - tfolder = os.join_path(os.vtmp_dir(), 'v', 'tests', 'inode_test') + tfolder = os.join_path(os.vtmp_dir(), 'tests', 'inode_test') ) fn testsuite_begin() { diff --git a/vlib/os/os_test.v b/vlib/os/os_test.v index 431d663d30..f424fac587 100644 --- a/vlib/os/os_test.v +++ b/vlib/os/os_test.v @@ -5,7 +5,7 @@ const ( // tfolder will contain all the temporary files/subfolders made by // the different tests. It would be removed in testsuite_end(), so // individual os tests do not need to clean up after themselves. - tfolder = os.join_path(os.vtmp_dir(), 'v', 'tests', 'os_test') + tfolder = os.join_path(os.vtmp_dir(), 'tests', 'os_test') ) // os.args has to be *already initialized* with the program's argc/argv at this point diff --git a/vlib/os/process_test.v b/vlib/os/process_test.v index a810dc72e0..77695d473d 100644 --- a/vlib/os/process_test.v +++ b/vlib/os/process_test.v @@ -6,7 +6,7 @@ import time const ( vexe = os.getenv('VEXE') vroot = os.dir(vexe) - tfolder = os.join_path(os.vtmp_dir(), 'v', 'tests', 'os_process') + tfolder = os.join_path(os.vtmp_dir(), 'tests', 'os_process') test_os_process = os.join_path(tfolder, 'test_os_process.exe') test_os_process_source = os.join_path(vroot, 'cmd/tools/test_os_process.v') ) diff --git a/vlib/stbi/stbi_test.v b/vlib/stbi/stbi_test.v index 7d46ceacf7..48d8665b5c 100644 --- a/vlib/stbi/stbi_test.v +++ b/vlib/stbi/stbi_test.v @@ -1,7 +1,7 @@ import os import stbi -const tfolder = os.join_path(os.vtmp_dir(), 'v', 'stbi') +const tfolder = os.join_path(os.vtmp_dir(), 'stbi') fn testsuite_begin() { os.mkdir_all(tfolder) or {} diff --git a/vlib/toml/tests/alexcrichton_toml_rs_test.v b/vlib/toml/tests/alexcrichton_toml_rs_test.v index 702967db76..4c803517a1 100644 --- a/vlib/toml/tests/alexcrichton_toml_rs_test.v +++ b/vlib/toml/tests/alexcrichton_toml_rs_test.v @@ -37,7 +37,7 @@ const ( ] tests_folder = os.join_path('test-suite', 'tests') jq = os.find_abs_path_of_executable('jq') or { '' } - compare_work_dir_root = os.join_path(os.vtmp_dir(), 'v', 'toml', 'alexcrichton') + compare_work_dir_root = os.join_path(os.vtmp_dir(), 'toml', 'alexcrichton') // From: https://stackoverflow.com/a/38266731/1904615 jq_normalize = r'# Apply f to composite entities recursively using keys[], and to atoms def sorted_walk(f): diff --git a/vlib/toml/tests/burntsushi_toml_test.v b/vlib/toml/tests/burntsushi_toml_test.v index 2ba69767d7..0c1862fdfd 100644 --- a/vlib/toml/tests/burntsushi_toml_test.v +++ b/vlib/toml/tests/burntsushi_toml_test.v @@ -27,7 +27,7 @@ const ( //'integer/long.toml', // TODO https://github.com/vlang/v/issues/9507 jq = os.find_abs_path_of_executable('jq') or { '' } - compare_work_dir_root = os.join_path(os.vtmp_dir(), 'v', 'toml', 'burntsushi') + compare_work_dir_root = os.join_path(os.vtmp_dir(), 'toml', 'burntsushi') // From: https://stackoverflow.com/a/38266731/1904615 jq_normalize = r'# Apply f to composite entities recursively using keys[], and to atoms def sorted_walk(f): diff --git a/vlib/toml/tests/iarna_toml_spec_test.v b/vlib/toml/tests/iarna_toml_spec_test.v index a569b17e38..3de8a4ee43 100644 --- a/vlib/toml/tests/iarna_toml_spec_test.v +++ b/vlib/toml/tests/iarna_toml_spec_test.v @@ -43,7 +43,7 @@ const ( jq = os.find_abs_path_of_executable('jq') or { '' } python = os.find_abs_path_of_executable('python') or { '' } - compare_work_dir_root = os.join_path(os.vtmp_dir(), 'v', 'toml', 'iarna') + compare_work_dir_root = os.join_path(os.vtmp_dir(), 'toml', 'iarna') // From: https://stackoverflow.com/a/38266731/1904615 jq_normalize = r'# Apply f to composite entities recursively using keys[], and to atoms def sorted_walk(f): diff --git a/vlib/toml/tests/toml_test.v b/vlib/toml/tests/toml_test.v index 371cdbef53..8d78400b7b 100644 --- a/vlib/toml/tests/toml_test.v +++ b/vlib/toml/tests/toml_test.v @@ -68,7 +68,7 @@ fn test_toml() { } fn test_toml_file() { - out_path := os.join_path(os.vtmp_dir(), 'v', 'toml_tests') + out_path := os.join_path(os.vtmp_dir(), 'toml_tests') test_file := os.join_path(out_path, 'toml_example.toml') os.mkdir_all(out_path) or { assert false } defer { diff --git a/vlib/v/builder/builder_test.v b/vlib/v/builder/builder_test.v index cbfc9d077f..44c58b3f03 100644 --- a/vlib/v/builder/builder_test.v +++ b/vlib/v/builder/builder_test.v @@ -2,9 +2,10 @@ module main import os -const test_path = os.join_path(os.vtmp_dir(), 'v', 'run_check') - -const vexe = @VEXE +const ( + vexe = @VEXE + test_path = os.join_path(os.vtmp_dir(), 'run_check') +) fn testsuite_begin() { os.mkdir_all(test_path) or {} diff --git a/vlib/v/builder/interpreterbuilder/v_interpret_test.v b/vlib/v/builder/interpreterbuilder/v_interpret_test.v index 33bd3953e2..60f1a857cc 100644 --- a/vlib/v/builder/interpreterbuilder/v_interpret_test.v +++ b/vlib/v/builder/interpreterbuilder/v_interpret_test.v @@ -9,7 +9,7 @@ fn interpreter_wrap(a string) string { } fn interp_test(expression string, expected string) ! { - tmpdir := os.join_path(os.vtmp_dir(), 'v', 'interpret_test_${rand.ulid()}') + tmpdir := os.join_path(os.vtmp_dir(), 'interpret_test_${rand.ulid()}') os.mkdir_all(tmpdir) or {} defer { os.rmdir_all(tmpdir) or {} diff --git a/vlib/v/gen/c/coutput_test.v b/vlib/v/gen/c/coutput_test.v index c45ea31695..9fd2779891 100644 --- a/vlib/v/gen/c/coutput_test.v +++ b/vlib/v/gen/c/coutput_test.v @@ -23,7 +23,7 @@ fn mm(s string) string { fn test_out_files() { println(term.colorize(term.green, '> testing whether .out files match:')) os.chdir(vroot) or {} - output_path := os.join_path(os.vtmp_dir(), 'v', 'coutput', 'out') + output_path := os.join_path(os.vtmp_dir(), 'coutput', 'out') os.mkdir_all(output_path)! defer { os.rmdir_all(output_path) or {} @@ -97,7 +97,7 @@ fn test_out_files() { fn test_c_must_have_files() { println(term.colorize(term.green, '> testing whether `.c.must_have` files match:')) os.chdir(vroot) or {} - output_path := os.join_path(os.vtmp_dir(), 'v', 'coutput', 'c_must_have') + output_path := os.join_path(os.vtmp_dir(), 'coutput', 'c_must_have') os.mkdir_all(output_path)! defer { os.rmdir_all(output_path) or {} diff --git a/vlib/v/gen/golang/tests/golang_test.v b/vlib/v/gen/golang/tests/golang_test.v index cec7bd5561..d8ef46cdc6 100644 --- a/vlib/v/gen/golang/tests/golang_test.v +++ b/vlib/v/gen/golang/tests/golang_test.v @@ -19,7 +19,7 @@ fn test_golang() { dir := os.join_path(vroot, 'vlib/v/gen/golang/tests') files := os.ls(dir) or { panic(err) } // - wrkdir := os.join_path(os.vtmp_dir(), 'v', 'tests', 'golang') + wrkdir := os.join_path(os.vtmp_dir(), 'tests', 'golang') os.mkdir_all(wrkdir) or { panic(err) } defer { os.rmdir_all(wrkdir) or {} diff --git a/vlib/v/gen/js/jsgen_test.v b/vlib/v/gen/js/jsgen_test.v index 36d7f65d03..cd1ece548f 100644 --- a/vlib/v/gen/js/jsgen_test.v +++ b/vlib/v/gen/js/jsgen_test.v @@ -2,7 +2,7 @@ import os const ( test_dir = os.join_path('vlib', 'v', 'gen', 'js', 'tests') - output_dir = os.join_path(os.vtmp_dir(), 'v', '_js_tests/') + output_dir = os.join_path(os.vtmp_dir(), '_js_tests/') v_options = '-b js -w' node_options = '' ) diff --git a/vlib/v/gen/native/tests/native_test.v b/vlib/v/gen/native/tests/native_test.v index 21da26036d..be362fab0b 100644 --- a/vlib/v/gen/native/tests/native_test.v +++ b/vlib/v/gen/native/tests/native_test.v @@ -21,7 +21,7 @@ fn test_native() { dir := os.join_path(vroot, 'vlib', 'v', 'gen', 'native', 'tests') files := os.ls(dir) or { panic(err) } // - wrkdir := os.join_path(os.vtmp_dir(), 'v', 'tests', 'native') + wrkdir := os.join_path(os.vtmp_dir(), 'tests', 'native') os.mkdir_all(wrkdir) or { panic(err) } defer { os.rmdir_all(wrkdir) or {} diff --git a/vlib/v/gen/wasm/tests/wasm_test.v b/vlib/v/gen/wasm/tests/wasm_test.v index 6a0b9969a1..6a2b5ecb14 100644 --- a/vlib/v/gen/wasm/tests/wasm_test.v +++ b/vlib/v/gen/wasm/tests/wasm_test.v @@ -29,7 +29,7 @@ fn test_wasm() { dir := os.join_path(vroot, 'vlib/v/gen/wasm/tests') files := os.ls(dir) or { panic(err) } // - wrkdir := os.join_path(os.vtmp_dir(), 'v', 'tests', 'wasm') + wrkdir := os.join_path(os.vtmp_dir(), 'tests', 'wasm') os.mkdir_all(wrkdir) or { panic(err) } defer { os.rmdir_all(wrkdir) or {} diff --git a/vlib/v/live/live_test.v b/vlib/v/live/live_test.v index 1c3e41a380..817e23f326 100644 --- a/vlib/v/live/live_test.v +++ b/vlib/v/live/live_test.v @@ -33,7 +33,7 @@ TODO: Cleanup this when/if v has better process control/communication primitives */ const ( vexe = os.getenv('VEXE') - vtmp_folder = os.join_path(os.vtmp_dir(), 'v', 'tests', 'live') + vtmp_folder = os.join_path(os.vtmp_dir(), 'tests', 'live') main_source_file = os.join_path(vtmp_folder, 'main.v') tmp_file = os.join_path(vtmp_folder, 'mymodule', 'generated_live_module.tmp') source_file = os.join_path(vtmp_folder, 'mymodule', 'mymodule.v') diff --git a/vlib/v/pref/options_test.v b/vlib/v/pref/options_test.v index d4da60fd78..cea74a57b6 100644 --- a/vlib/v/pref/options_test.v +++ b/vlib/v/pref/options_test.v @@ -3,9 +3,10 @@ import os import time -const vexe = @VEXE - -const tfolder = os.join_path(os.vtmp_dir(), 'v', 'custom_compile') +const ( + vexe = @VEXE + tfolder = os.join_path(os.vtmp_dir(), 'custom_compile') +) fn testsuite_begin() { os.mkdir_all(tfolder) or {} diff --git a/vlib/v/slow_tests/crun_mode/crun_test.v b/vlib/v/slow_tests/crun_mode/crun_test.v index 42c7a1b75d..7157049921 100644 --- a/vlib/v/slow_tests/crun_mode/crun_test.v +++ b/vlib/v/slow_tests/crun_mode/crun_test.v @@ -1,11 +1,11 @@ import os import time -const crun_folder = os.join_path(os.vtmp_dir(), 'v', 'crun_folder') - -const vprogram_file = os.join_path(crun_folder, 'vprogram.vv') - -const vexe = os.getenv('VEXE') +const ( + vexe = os.getenv('VEXE') + crun_folder = os.join_path(os.vtmp_dir(), 'crun_folder') + vprogram_file = os.join_path(crun_folder, 'vprogram.vv') +) fn testsuite_begin() { os.setenv('VCACHE', crun_folder, true) diff --git a/vlib/v/slow_tests/valgrind/valgrind_test.v b/vlib/v/slow_tests/valgrind/valgrind_test.v index 4dfe1040ef..7a93aa6514 100644 --- a/vlib/v/slow_tests/valgrind/valgrind_test.v +++ b/vlib/v/slow_tests/valgrind/valgrind_test.v @@ -67,7 +67,7 @@ fn test_all() { mut files := os.ls(dir) or { panic(err) } files.sort() // - wrkdir := os.join_path(os.vtmp_dir(), 'v', 'tests', 'valgrind') + wrkdir := os.join_path(os.vtmp_dir(), 'tests', 'valgrind') os.mkdir_all(wrkdir) or { panic(err) } os.chdir(wrkdir) or {} // diff --git a/vlib/v/tests/closure_generator_test.v b/vlib/v/tests/closure_generator_test.v index 7e4d9a87a5..88f2ab5e75 100644 --- a/vlib/v/tests/closure_generator_test.v +++ b/vlib/v/tests/closure_generator_test.v @@ -170,7 +170,7 @@ fn test_closure_return_${styp}_${i}() ! { code := v_code.str() println('Compiling V code (${code.count('\n')} lines) ...') - wrkdir := os.join_path(os.vtmp_dir(), 'v', 'tests', 'closures') + wrkdir := os.join_path(os.vtmp_dir(), 'tests', 'closures') os.mkdir_all(wrkdir)! os.chdir(wrkdir)! full_path_to_target := os.join_path(wrkdir, 'closure_return_test.v') diff --git a/vlib/v/tests/run_v_code_from_stdin_test.v b/vlib/v/tests/run_v_code_from_stdin_test.v index b991be34dc..40d2be3e0e 100644 --- a/vlib/v/tests/run_v_code_from_stdin_test.v +++ b/vlib/v/tests/run_v_code_from_stdin_test.v @@ -1,10 +1,10 @@ import os -const vexe = os.getenv('VEXE') - -const turn_off_vcolors = os.setenv('VCOLORS', 'never', true) - -const vtmp_folder = os.join_path(os.vtmp_dir(), 'v', 'tests', 'run_v_code') +const ( + vexe = os.getenv('VEXE') + turn_off_vcolors = os.setenv('VCOLORS', 'never', true) + vtmp_folder = os.join_path(os.vtmp_dir(), 'tests', 'run_v_code') +) fn test_vexe_is_set() { assert vexe != '' diff --git a/vlib/v/vcache/vcache_test.v b/vlib/v/vcache/vcache_test.v index 23e221eadb..4df9d87e48 100644 --- a/vlib/v/vcache/vcache_test.v +++ b/vlib/v/vcache/vcache_test.v @@ -1,9 +1,7 @@ import os import v.vcache -const ( - vcache_folder = os.join_path(os.vtmp_dir(), 'v', 'cache_folder') -) +const vcache_folder = os.join_path(os.vtmp_dir(), 'cache_folder') fn check_cache_entry_fpath_invariants(x string, extension string) { a := x.replace(vcache_folder + os.path_separator, '').split(os.path_separator) diff --git a/vlib/vweb/assets/assets_test.v b/vlib/vweb/assets/assets_test.v index 457e8fa735..97dc0e01f2 100644 --- a/vlib/vweb/assets/assets_test.v +++ b/vlib/vweb/assets/assets_test.v @@ -1,7 +1,7 @@ import vweb.assets import os -const base_cache_dir = os.join_path(os.vtmp_dir(), 'v', 'assets_test_cache') +const base_cache_dir = os.join_path(os.vtmp_dir(), 'assets_test_cache') fn testsuite_begin() { os.mkdir_all(base_cache_dir) or {}