From 77049600e670c09a7ccf0ff5f85777e96704558a Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Sun, 30 Jul 2023 05:00:48 +0200 Subject: [PATCH] tests: make projects_with_c_code closer to actual projects (#19008) --- vlib/v/tests/project_with_c_code/.v.mod.stop | 4 ---- vlib/v/tests/project_with_c_code/mod1/v.mod | 5 ----- vlib/v/tests/project_with_c_code/mod1/wrapper.v | 4 ++-- vlib/v/tests/project_with_c_code/v.mod | 5 +++++ vlib/v/tests/project_with_c_code_2/.v.mod.stop | 5 ----- .../project_with_c_code_2/{main2_test.v => main_test.v} | 0 vlib/v/tests/project_with_c_code_2/modc/v.mod | 5 ----- vlib/v/tests/project_with_c_code_2/modc/wrapper.v | 6 +++--- vlib/v/tests/project_with_c_code_2/v.mod | 5 +++++ vlib/v/tests/project_with_c_code_3/.v.mod.stop | 4 ---- vlib/v/tests/project_with_c_code_3/mod1/v.mod | 5 ----- vlib/v/tests/project_with_c_code_3/v.mod | 5 +++++ 12 files changed, 20 insertions(+), 33 deletions(-) delete mode 100644 vlib/v/tests/project_with_c_code/.v.mod.stop delete mode 100644 vlib/v/tests/project_with_c_code/mod1/v.mod create mode 100644 vlib/v/tests/project_with_c_code/v.mod delete mode 100644 vlib/v/tests/project_with_c_code_2/.v.mod.stop rename vlib/v/tests/project_with_c_code_2/{main2_test.v => main_test.v} (100%) delete mode 100644 vlib/v/tests/project_with_c_code_2/modc/v.mod create mode 100644 vlib/v/tests/project_with_c_code_2/v.mod delete mode 100644 vlib/v/tests/project_with_c_code_3/.v.mod.stop delete mode 100644 vlib/v/tests/project_with_c_code_3/mod1/v.mod create mode 100644 vlib/v/tests/project_with_c_code_3/v.mod diff --git a/vlib/v/tests/project_with_c_code/.v.mod.stop b/vlib/v/tests/project_with_c_code/.v.mod.stop deleted file mode 100644 index abdf0f97cf..0000000000 --- a/vlib/v/tests/project_with_c_code/.v.mod.stop +++ /dev/null @@ -1,4 +0,0 @@ -Do not delete this file. -It is used by V to stop the lookup for v.mod, -so that the top level vlib/v.mod is not found, -if you delete mod1/v.mod . diff --git a/vlib/v/tests/project_with_c_code/mod1/v.mod b/vlib/v/tests/project_with_c_code/mod1/v.mod deleted file mode 100644 index 72ddcfdaf2..0000000000 --- a/vlib/v/tests/project_with_c_code/mod1/v.mod +++ /dev/null @@ -1,5 +0,0 @@ -Module { - name: 'mod1', - description: 'A simple module, containing C code.', - dependencies: [] -} diff --git a/vlib/v/tests/project_with_c_code/mod1/wrapper.v b/vlib/v/tests/project_with_c_code/mod1/wrapper.v index f02233fcf0..e244a55a84 100644 --- a/vlib/v/tests/project_with_c_code/mod1/wrapper.v +++ b/vlib/v/tests/project_with_c_code/mod1/wrapper.v @@ -1,7 +1,7 @@ module mod1 -#flag -I @VMODROOT/c -#flag @VMODROOT/c/implementation.o +#flag -I @VMODROOT/mod1/c +#flag @VMODROOT/mod1/c/implementation.o #include "header.h" diff --git a/vlib/v/tests/project_with_c_code/v.mod b/vlib/v/tests/project_with_c_code/v.mod new file mode 100644 index 0000000000..119685a768 --- /dev/null +++ b/vlib/v/tests/project_with_c_code/v.mod @@ -0,0 +1,5 @@ +Module { + name: 'project_with_c_code', + description: 'A simple project, containing C code.', + dependencies: [] +} diff --git a/vlib/v/tests/project_with_c_code_2/.v.mod.stop b/vlib/v/tests/project_with_c_code_2/.v.mod.stop deleted file mode 100644 index 415b54b581..0000000000 --- a/vlib/v/tests/project_with_c_code_2/.v.mod.stop +++ /dev/null @@ -1,5 +0,0 @@ -Do not delete this file. - -It is used by V to stop the lookup for v.mod, -so that the top level vlib/v.mod is not found, -if you delete modc/v.mod . diff --git a/vlib/v/tests/project_with_c_code_2/main2_test.v b/vlib/v/tests/project_with_c_code_2/main_test.v similarity index 100% rename from vlib/v/tests/project_with_c_code_2/main2_test.v rename to vlib/v/tests/project_with_c_code_2/main_test.v diff --git a/vlib/v/tests/project_with_c_code_2/modc/v.mod b/vlib/v/tests/project_with_c_code_2/modc/v.mod deleted file mode 100644 index b696153145..0000000000 --- a/vlib/v/tests/project_with_c_code_2/modc/v.mod +++ /dev/null @@ -1,5 +0,0 @@ -Module { - name: 'modc', - description: 'Another module, wrapping some C code.', - dependencies: [] -} diff --git a/vlib/v/tests/project_with_c_code_2/modc/wrapper.v b/vlib/v/tests/project_with_c_code_2/modc/wrapper.v index 537a728c76..1c8f6b59b2 100644 --- a/vlib/v/tests/project_with_c_code_2/modc/wrapper.v +++ b/vlib/v/tests/project_with_c_code_2/modc/wrapper.v @@ -1,7 +1,7 @@ module modc -#flag -I @VMODROOT -#flag @VMODROOT/impl.o +#flag -I @VMODROOT/modc +#flag @VMODROOT/modc/impl.o #include "header.h" struct C.Atype { @@ -14,7 +14,7 @@ struct C.Atype { // Relatedly, if you want to mark a V function as unsafe, use [unsafe]. // // The V compiler forces all calls of unsafe functions to be wrapped in `unsafe{...}` blocks. -struct Vtype { +pub struct Vtype { pub mut: p &C.Atype } diff --git a/vlib/v/tests/project_with_c_code_2/v.mod b/vlib/v/tests/project_with_c_code_2/v.mod new file mode 100644 index 0000000000..9014e01e4c --- /dev/null +++ b/vlib/v/tests/project_with_c_code_2/v.mod @@ -0,0 +1,5 @@ +Module { + name: 'project_with_c_code_2', + description: 'A simple project, containing C code.', + dependencies: [] +} diff --git a/vlib/v/tests/project_with_c_code_3/.v.mod.stop b/vlib/v/tests/project_with_c_code_3/.v.mod.stop deleted file mode 100644 index abdf0f97cf..0000000000 --- a/vlib/v/tests/project_with_c_code_3/.v.mod.stop +++ /dev/null @@ -1,4 +0,0 @@ -Do not delete this file. -It is used by V to stop the lookup for v.mod, -so that the top level vlib/v.mod is not found, -if you delete mod1/v.mod . diff --git a/vlib/v/tests/project_with_c_code_3/mod1/v.mod b/vlib/v/tests/project_with_c_code_3/mod1/v.mod deleted file mode 100644 index 72ddcfdaf2..0000000000 --- a/vlib/v/tests/project_with_c_code_3/mod1/v.mod +++ /dev/null @@ -1,5 +0,0 @@ -Module { - name: 'mod1', - description: 'A simple module, containing C code.', - dependencies: [] -} diff --git a/vlib/v/tests/project_with_c_code_3/v.mod b/vlib/v/tests/project_with_c_code_3/v.mod new file mode 100644 index 0000000000..5f3806de78 --- /dev/null +++ b/vlib/v/tests/project_with_c_code_3/v.mod @@ -0,0 +1,5 @@ +Module { + name: 'project_with_c_code_3', + description: 'A simple project, containing C code.', + dependencies: [] +}