mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
tools: move _test.v files for vdoc at the same level (#21473)
This commit is contained in:
parent
972a137087
commit
8eaaba6094
36 changed files with 11 additions and 12 deletions
10
.github/workflows/module_docs_ci.yml
vendored
10
.github/workflows/module_docs_ci.yml
vendored
|
@ -24,13 +24,11 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build V
|
||||
run: make -j4
|
||||
run: make -j4 && ./v symlink
|
||||
- name: Install markdown from vpm
|
||||
run: v retry -- v install markdown
|
||||
- name: Test v doc
|
||||
run: |
|
||||
# While the integration tests (executing the v doc command) should install
|
||||
# markdown automatically, unit tests won't. Run integration tests first.
|
||||
./v test cmd/tools/vdoc/tests/
|
||||
./v test cmd/tools/vdoc/*.v
|
||||
run: ./v test cmd/tools/vdoc/
|
||||
- name: Build module documentation
|
||||
run: ./v doc -m -f html vlib/
|
||||
- name: Deploy docs to vercel
|
||||
|
|
4
TESTS.md
4
TESTS.md
|
@ -191,5 +191,5 @@ The VDOC test vdoc_file_test.v now also supports VAUTOFIX, which is
|
|||
useful, if you change anything inside cmd/tools/vdoc or vlib/v/doc/,
|
||||
or inside the modules that it depends on (like markdown).
|
||||
After such changes, just run this command *2 times*, and commit the
|
||||
resulting changes in `cmd/tools/vdoc/tests/testdata` as well:
|
||||
`VAUTOFIX=1 ./v cmd/tools/vdoc/tests/vdoc_file_test.v`
|
||||
resulting changes in `cmd/tools/vdoc/testdata` as well:
|
||||
`VAUTOFIX=1 ./v cmd/tools/vdoc/vdoc_file_test.v`
|
||||
|
|
|
@ -13,8 +13,9 @@ fn test_output() {
|
|||
os.setenv('VCOLORS', 'never', true)
|
||||
os.chdir(vroot)!
|
||||
mut total_fails := 0
|
||||
test_files := vtest.filter_vtest_only(os.walk_ext('cmd/tools/vdoc/tests/testdata',
|
||||
'.v'), basepath: vroot)
|
||||
test_files := vtest.filter_vtest_only(os.walk_ext('cmd/tools/vdoc/testdata', '.v'),
|
||||
basepath: vroot
|
||||
)
|
||||
for path in test_files {
|
||||
mut fails := 0
|
||||
qpath := os.quoted_path(path)
|
||||
|
@ -45,7 +46,7 @@ fn test_output() {
|
|||
fn test_run_examples_good() {
|
||||
os.setenv('VCOLORS', 'never', true)
|
||||
os.chdir(vroot)!
|
||||
res := os.execute('${vexe} doc -comments -run-examples cmd/tools/vdoc/tests/testdata/run_examples_good/main.v')
|
||||
res := os.execute('${vexe} doc -comments -run-examples cmd/tools/vdoc/testdata/run_examples_good/main.v')
|
||||
assert res.exit_code == 0
|
||||
assert res.output.contains('module main'), res.output
|
||||
assert res.output.contains('fn abc()'), res.output
|
||||
|
@ -57,7 +58,7 @@ fn test_run_examples_good() {
|
|||
fn test_run_examples_bad() {
|
||||
os.setenv('VCOLORS', 'never', true)
|
||||
os.chdir(vroot)!
|
||||
res := os.execute('${vexe} doc -comments -run-examples cmd/tools/vdoc/tests/testdata/run_examples_bad/main.v')
|
||||
res := os.execute('${vexe} doc -comments -run-examples cmd/tools/vdoc/testdata/run_examples_bad/main.v')
|
||||
assert res.exit_code != 0
|
||||
assert res.output.contains('error in documentation example'), res.output
|
||||
assert res.output.contains(' left value: 5 * 5 = 25'), res.output
|
Loading…
Add table
Add a link
Reference in a new issue