diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f70a59291..6eab419644 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,8 @@ jobs: tcc -version ./v -o v2 cmd/v # Make sure vtcc can build itself # ./v -silent test-compiler + - name: Fixed tests + run: ./v test-fixed # - name: Test v binaries # run: ./v -silent build-vbinaries @@ -127,41 +129,8 @@ jobs: # run: ./v -freestanding -o bare vlib/os/bare/bare_example_linux.v - name: v self compilation run: ./v -o v2 cmd/v && ./v2 -o v3 cmd/v && ./v3 -o v4 cmd/v - - name: temporary tests - run: | - ./v vlib/builtin/array_test.v - ./v vlib/builtin/string_test.v - ./v vlib/strconv/atof_test.v - ./v vlib/math/math_test.v - ./v vlib/bitfield/bitfield_test.v - ./v vlib/os/os_test.v - ./v vlib/os/inode_test.v - ./v vlib/v/tests/fn_multiple_returns_test.v - ./v vlib/v/tests/return_voidptr_test.v - ./v vlib/v/tests/voidptr_to_u64_cast_b_test.v - ./v vlib/v/tests/cstrings_test.v - ./v vlib/v/tests/valgrind/valgrind_test.v - ./v vlib/v/tests/nameof_test.v - ./v vlib/v/tests/repeated_multiret_values_test.v - ./v vlib/v/tests/modules/amodule/internal_module_test.v - ./v vlib/v/tests/modules/amodule/another_internal_module_test.v - ./v vlib/v/tests/modules/simplemodule/importing_test.v - ./v vlib/v/tests/reusable_mut_multiret_values_test.v - ./v vlib/v/tests/print_test.v - ./v vlib/v/tests/defer_test.v - ./v vlib/v/tests/typeof_simple_types_test.v - ./v vlib/v/tests/struct_chained_fields_correct_test.v - ./v vlib/v/tests/if_expression_test.v - ./v vlib/v/tests/backtrace_test.v - ./v vlib/v/tests/interfaces_map_test.v - ./v vlib/v/tests/fn_expecting_ref_but_returning_struct_test.v - ./v vlib/v/tests/inout/compiler_test.v - ./v vlib/v/tests/generic_test.v - ./v vlib/v/tests/interface_test.v - ./v vlib/v/tests/in_expression_test.v - ./v vlib/v/tests/attribute_test.v - ./v vlib/v/tests/str_gen_test.v - ./v vlib/v/tests/enum_hex_test.v + - name: Fixed tests + run: ./v test-fixed - name: x64 machine code generation run: | ./v -o vprod -prod cmd/v @@ -295,6 +264,8 @@ jobs: echo %VFLAGS% echo $VFLAGS .\make.bat -msvc + - name: Fixed tests + run: ./v test-fixed # - name: Test # run: | # .\v.exe -silent test-compiler diff --git a/.gitignore b/.gitignore index d0e3b18a62..99c972d172 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ fns.txt /cmd/tools/vtest /cmd/tools/vtest-compiler /cmd/tools/vtest-fmt +/cmd/tools/vtest-fixed /cmd/tools/vfmt /cmd/tools/vbin2v /cmd/tools/vup diff --git a/cmd/tools/vtest-fixed.v b/cmd/tools/vtest-fixed.v new file mode 100644 index 0000000000..724dde9e7c --- /dev/null +++ b/cmd/tools/vtest-fixed.v @@ -0,0 +1,58 @@ +module main + +import os +import testing + +const ( + fixed_test_files = [ + 'vlib/builtin/array_test.v', + 'vlib/builtin/string_test.v', + 'vlib/strconv/atof_test.v', + 'vlib/math/math_test.v', + 'vlib/bitfield/bitfield_test.v', + 'vlib/os/os_test.v', + 'vlib/os/inode_test.v', + 'vlib/v/tests/fn_multiple_returns_test.v', + 'vlib/v/tests/return_voidptr_test.v', + 'vlib/v/tests/voidptr_to_u64_cast_b_test.v', + 'vlib/v/tests/cstrings_test.v', + 'vlib/v/tests/valgrind/valgrind_test.v', + 'vlib/v/tests/nameof_test.v', + 'vlib/v/tests/repeated_multiret_values_test.v', + 'vlib/v/tests/modules/amodule/internal_module_test.v', + 'vlib/v/tests/modules/amodule/another_internal_module_test.v', + 'vlib/v/tests/modules/simplemodule/importing_test.v', + 'vlib/v/tests/reusable_mut_multiret_values_test.v', + 'vlib/v/tests/print_test.v', + 'vlib/v/tests/defer_test.v', + 'vlib/v/tests/typeof_simple_types_test.v', + 'vlib/v/tests/struct_chained_fields_correct_test.v', + 'vlib/v/tests/if_expression_test.v', + 'vlib/v/tests/backtrace_test.v', + 'vlib/v/tests/interfaces_map_test.v', + 'vlib/v/tests/fn_expecting_ref_but_returning_struct_test.v', + 'vlib/v/tests/inout/compiler_test.v', + 'vlib/v/tests/generic_test.v', + 'vlib/v/tests/interface_test.v', + 'vlib/v/tests/in_expression_test.v', + 'vlib/v/tests/attribute_test.v', + 'vlib/v/tests/str_gen_test.v', + 'vlib/v/tests/enum_hex_test.v', + 'vlib/v/tests/option_default_values_test.v', + ] +) + +fn main() { + args := os.args + args_string := args[1..].join(' ') + cmd_prefix := args_string.all_before('test-fixed') + title := 'testing all fixed tests' + testing.eheader(title) + mut tsession := testing.new_test_session(cmd_prefix) + tsession.files << fixed_test_files + tsession.test() + eprintln(tsession.benchmark.total_message(title)) + if tsession.benchmark.nfail > 0 { + panic('\nWARNING: failed ${tsession.benchmark.nfail} times.\n') + } +} diff --git a/cmd/v/v.v b/cmd/v/v.v index 146e242dd7..90708e4c82 100644 --- a/cmd/v/v.v +++ b/cmd/v/v.v @@ -17,7 +17,7 @@ import ( const ( simple_cmd = ['fmt', 'up', 'self', - 'test', 'test-fmt', 'test-compiler', + 'test', 'test-fmt', 'test-compiler', 'test-fixed', 'bin2v', 'repl', 'build-tools', 'build-examples', 'build-vbinaries',