Coder Social home page Coder Social logo

Comments (9)

spytheman avatar spytheman commented on September 23, 2024 2

For example:
./v -Wimpure-v -W test vlib/compress/zstd/
reveals that vlib/compress/zstd/zstd.v should be renamed to vlib/compress/zstd/zstd.c.v .

from v.

JalonSolov avatar JalonSolov commented on September 23, 2024 1

I think -Wimpure-v should work without -W test... which I never knew existed.

In any case, if -Wimpure-v is turned on by default, it will definitely affect all modes.

from v.

spytheman avatar spytheman commented on September 23, 2024

v -Wimpure-v test x_test.v
... will run the test x_test.v, ignore the warnings, then report whether the test passed (which it does).

v -Wimpure-v -W test x_test.v
... will turn the warnings into errors, then report the compilation failure.

v -Wimpure-v x_test.v will show you the warnings.

from v.

spytheman avatar spytheman commented on September 23, 2024

It does work without -W. It just produces warnings, and warnings do not cause compilation to fail.

-W just turns warnings into errors, and errors make the compilation fail.

-prod would have worked too.

v test . just passes all the options before test as compile flags to the underlying v file_test.v etc commands.

from v.

spytheman avatar spytheman commented on September 23, 2024

Try for example: v -Wimpure-v x_test.v , i.e. running the test directly by v, not by v test, and you will see the warnings.

from v.

JalonSolov avatar JalonSolov commented on September 23, 2024

Yes, I understand, but I'm saying it should "just work" without having to know a special sequence of things to type. v -Wimpure-v <followed by anything else> should always activate that message.

from v.

spytheman avatar spytheman commented on September 23, 2024

But it does already. v test just does not display notices, warnings, and the output of running individual _test.v files to you, unless it failed to compile it, or when it ran, but exited with status code != 0.

Currently -Wimpure-v, generates warnings. Warnings do not stop compilation -> v test will compile, and then it will run the test, which will succeed, and v test will just discard the output (including the warnings).

from v.

spytheman avatar spytheman commented on September 23, 2024

If what you are arguing for, is towards making v test display warnings and notices by default, then that is reasonable, even though I think that it can be confusing, since in most cases, they do not matter much for tests.

from v.

JalonSolov avatar JalonSolov commented on September 23, 2024

I think this is a special case, and should be displayed in all cases. Otherwise, it can cause confusion as to why tests won't work with other backends, unless you open the source and scan for C..

from v.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.