Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing with -run-only does not detect fails #22778

Open
jorgeluismireles opened this issue Nov 6, 2024 · 0 comments
Open

testing with -run-only does not detect fails #22778

jorgeluismireles opened this issue Nov 6, 2024 · 0 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@jorgeluismireles
Copy link

jorgeluismireles commented Nov 6, 2024

Describe the bug

Using -run-only argument to test only a single test function within a file does not detect a failure, or seems does not check anything.

By the way -run-only is documented if you type v help test but it doesn't if you type v test help.

Reproduction Steps

I have a simple test file with two functions one should pass and another shouldn't:

$ cat x/testing/all_test.v
fn test_ok() {
	assert 1 == 1, 'not expected to failed'
}

fn test_fail() {
	assert 1 == 0, 'expected to fail'
}
$

I test the whole file and fails as expected:

$ v x/testing/all_test.v
x/testing/all_test.v:6: ✗ fn test_fail
   > assert 1 == 0, 'expected to fail'
     Left value (len: 1): `1`
    Right value (len: 1): `0`
        Message: expected to fail
$

Then I use the flag -run-only for the function that should pass and "passes":

$ v x/testing/all_test.v -run-only test_ok
$

Then I use the flag -run-only for the function that should fail and "passes" too:

$ v x/testing/all_test.v -run-only test_fail
$

The same happens using -stats just printing the extra info...

Expected Behavior

Test correctly a single function using the filter -run-only.

Current Behavior

Seems argument -run-only does not perform any test at all.

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.8 b30be51

Environment details (OS name and version, etc.)

V full version: V 0.4.8 da3112e.b30be51
OS: linux, Ubuntu 20.04.6 LTS
Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i3-4150 CPU @ 3.50GHz

vexe: /home/jorge/v/v
vexe mtime: 2024-11-06 15:56:20

vroot: OK, value: /home/jorge/v
VMODULES: OK, value: /home/jorge/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.25.1
Git vroot status: weekly.2024.36-458-gb30be518
.git/config present: true

CC version: cc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
emcc version: N/A
thirdparty/tcc status: thirdparty-linux-amd64 0134e9b9

Huly®: V_0.6-21224

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@jorgeluismireles jorgeluismireles added the Bug This tag is applied to issues which reports bugs. label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

1 participant