From 0215931367dd1dd7d525415bd2d99d1c6287e0c6 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Thu, 21 Mar 2024 07:35:12 +0100 Subject: [PATCH] test: update tests to run with `v test` (#46) --- .github/workflows/analyzer_tests.yml | 3 --- tests/{main.v => analyzer_test.v} | 5 +++-- tests/bench.v | 2 +- tests/completion.v | 2 +- tests/definitions.v | 2 +- tests/documentation.v | 2 +- tests/implementations.v | 2 +- tests/supers.v | 2 +- tests/{type_tests.v => types.v} | 2 +- 9 files changed, 10 insertions(+), 12 deletions(-) rename tests/{main.v => analyzer_test.v} (92%) rename tests/{type_tests.v => types.v} (98%) diff --git a/.github/workflows/analyzer_tests.yml b/.github/workflows/analyzer_tests.yml index e2082ec6..5db8a015 100644 --- a/.github/workflows/analyzer_tests.yml +++ b/.github/workflows/analyzer_tests.yml @@ -44,7 +44,4 @@ jobs: submodules: true - name: Run tests - run: cd tests && v run . - - - name: Run other V tests run: v test . diff --git a/tests/main.v b/tests/analyzer_test.v similarity index 92% rename from tests/main.v rename to tests/analyzer_test.v index 4e324ba1..82d38907 100644 --- a/tests/main.v +++ b/tests/analyzer_test.v @@ -1,15 +1,16 @@ -module main +module tests import os import term import testing -fn main() { +fn test_all() { defer { os.rmdir_all(testing.temp_path) or { println('Failed to remove temp path: ${testing.temp_path}') } } + os.chdir(os.join_path(@VMODROOT, 'tests'))! mut testers := []testing.Tester{} diff --git a/tests/bench.v b/tests/bench.v index 7297325f..e3b17502 100644 --- a/tests/bench.v +++ b/tests/bench.v @@ -1,4 +1,4 @@ -module main +module tests import testing diff --git a/tests/completion.v b/tests/completion.v index c3a01b17..4171aaeb 100644 --- a/tests/completion.v +++ b/tests/completion.v @@ -1,4 +1,4 @@ -module main +module tests import testing import server.completion.providers diff --git a/tests/definitions.v b/tests/definitions.v index 43e484da..d1bb6023 100644 --- a/tests/definitions.v +++ b/tests/definitions.v @@ -1,4 +1,4 @@ -module main +module tests import testing diff --git a/tests/documentation.v b/tests/documentation.v index 894852fd..9fd917e7 100644 --- a/tests/documentation.v +++ b/tests/documentation.v @@ -1,4 +1,4 @@ -module main +module tests import testing diff --git a/tests/implementations.v b/tests/implementations.v index bcf95f51..ba1df140 100644 --- a/tests/implementations.v +++ b/tests/implementations.v @@ -1,4 +1,4 @@ -module main +module tests import testing diff --git a/tests/supers.v b/tests/supers.v index 1fed39e5..4a9e58ef 100644 --- a/tests/supers.v +++ b/tests/supers.v @@ -1,4 +1,4 @@ -module main +module tests import testing diff --git a/tests/type_tests.v b/tests/types.v similarity index 98% rename from tests/type_tests.v rename to tests/types.v index e1988987..04dffeef 100644 --- a/tests/type_tests.v +++ b/tests/types.v @@ -1,4 +1,4 @@ -module main +module tests import testing