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

Differentiate normal source files from test files #216

Open
serkonda7 opened this issue Dec 29, 2020 · 3 comments
Open

Differentiate normal source files from test files #216

serkonda7 opened this issue Dec 29, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@serkonda7
Copy link
Contributor

In my eyes it would be a nice metric to see how many lines my program code has and how big my testing suite is.

In some languages this might be already possible when all test files are located in a tests folder but I mainly use V, where tests and source files are next to each other.

I would expect something like

───────────────────────────────────────────────────────────────────────────────
Language                 Files     Lines   Blanks  Comments     Code Complexity
───────────────────────────────────────────────────────────────────────────────
V                           15      1550      115        65     1370        189
V Test                       2       157       45         0      112          0

Maybe another flag could be added for this.

V has extension .v
V tests end with _test.v

@boyter
Copy link
Owner

boyter commented Dec 30, 2020

This is something I had considered... however it falls down where some languages have the tests inline such as rust.

I was looking though the V test code and annoyingly there isn't any import or such I can see that would allow you to do this sort of remap either using --remap-all which in theory would all you to do this.

I think the ability to remap via filename regex or some such might be worthwhile though... I just need to think about the implementation some more.

@crystalfp
Copy link

crystalfp commented Jan 22, 2023

I have a similar problem. My test files are Typescript with extension .test.ts and are counted as Typescript files. I run 3.1.0 on Windows.
I don't have found a command line option to remap file extensions to a Typescript (test) language that is equal to Typescript but counted separately.
Anyway, just a nice-to-have.
Thanks for this useful tool!
mario

@boyter
Copy link
Owner

boyter commented Jan 24, 2023

I think this is possible for some languages, but inline would be problematic, due to inline tests. However that might also be possible...

Its something I am considering adding in, although it might need language specific code to achieve and not the generic one that is currently implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: TODO
Development

No branches or pull requests

4 participants
@boyter @crystalfp @serkonda7 and others