tests: allow for VAUTOFIX=1 ./vlib/v/slow_tests/repl/repl_test.v, describe repl_test.v in TESTS.md
Some checks are pending
Graphics CI / gg-regressions (push) Waiting to run
vlib modules CI / build-module-docs (push) Waiting to run
native backend CI / native-backend-windows (push) Waiting to run
native backend CI / native-backend-ubuntu (push) Waiting to run
Shy and PV CI / v-compiles-puzzle-vibes (push) Waiting to run
Sanitized CI / sanitize-undefined-clang (push) Waiting to run
Sanitized CI / sanitize-undefined-gcc (push) Waiting to run
Sanitized CI / sanitize-address-msvc (push) Waiting to run
Sanitized CI / sanitize-address-gcc (push) Waiting to run
Sanitized CI / sanitize-memory-clang (push) Waiting to run
Sanitized CI / tests-sanitize-address-clang (push) Waiting to run
sdl CI / v-compiles-sdl-examples (push) Waiting to run
Time CI / time-linux (push) Waiting to run
Time CI / time-macos (push) Waiting to run
Time CI / time-windows (push) Waiting to run
toml CI / toml-module-pass-external-test-suites (push) Waiting to run
Tools CI / tools-linux (clang) (push) Waiting to run
Tools CI / tools-linux (gcc) (push) Waiting to run
Tools CI / tools-linux (tcc) (push) Waiting to run
Tools CI / tools-macos (clang) (push) Waiting to run
Tools CI / tools-windows (gcc) (push) Waiting to run
Tools CI / tools-windows (msvc) (push) Waiting to run
Tools CI / tools-windows (tcc) (push) Waiting to run
Tools CI / tools-docker-ubuntu-musl (push) Waiting to run
vab CI / vab-compiles-v-examples (push) Waiting to run
vab CI / v-compiles-os-android (push) Waiting to run
wasm backend CI / wasm-backend (windows-2022) (push) Waiting to run
wasm backend CI / wasm-backend (ubuntu-22.04) (push) Waiting to run

This commit is contained in:
Delyan Angelov 2025-08-19 16:59:04 +03:00
parent a8187442b3
commit 0957e26c88
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED
2 changed files with 22 additions and 0 deletions

View file

@ -80,6 +80,21 @@ Each `.c.must_have` file, consists of multiple lines. Each of these
lines, *should* be present *at least once* in the output, when the .vv
file is compiled with `-o -` .
## REPL tests
The test runner for these is `vlib/v/slow_tests/repl/repl_test.v`.
The test cases for the V REPL, are stored in .repl files, in the folder
`vlib/v/slow_tests/repl/`. Each .repl file in this folder, contains several
lines of input to the V repl, followed by a single line of `===output===`,
and then the output lines, that the repl would normally show for the input
lines.
If you change the compiler or the REPL source, and you have breaks in those
.repl files, you can replace the current output in them, by running several
times `VAUTOFIX=1 ./vlib/v/slow_tests/repl/repl_test.v`, until all the
files are fixed and the test pass.
## `v vlib/v/slow_tests/run_project_folders_test.v`
This *test runner*, checks whether whole project folders, can be compiled, and run.

View file

@ -3,6 +3,8 @@ module runner
import os
import v.util.diff
const is_vautofix = os.getenv('VAUTOFIX') != ''
pub struct RunnerOptions {
pub:
wd string
@ -62,6 +64,11 @@ pub fn run_repl_file(wd string, vexec string, file string) !string {
}
os.rm(input_temporary_filename)!
if result != output {
if is_vautofix {
new_content := input + '===output===\n' + r.output.trim_right('\n\r') + '\n'
os.write_file(file, new_content)!
eprintln('>>> fixed file: `${file}`, new_content.len: ${new_content.len}')
}
return diff_error(file, output, result)
}
return file.replace('./', '')