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

Allow to configure a (regex?) pattern which is used to find executables containing tests #6

Open
jonnydee opened this issue Jan 12, 2015 · 6 comments

Comments

@jonnydee
Copy link

The documentation says test executables are (only) found if their file names end with 'test' or 'tests'. However, in our (very big) project we cannot change how our test executables are named, because their name follows a company-wide naming rule and the complete build system relies on it and, hence, such a change would be very expensive.
So it would be nice if there was a way to customize how those test executables may be named. The most flexible way would be a regular expression. But a configurable list of file name postfixes would also suffice -- at least in our case.
For backward compatibility, you could define a regular expression maching file names ending with 'test' or 'tests', or if youl rather liked the second approach, you could add 'test' and 'tests' to that postfix list as a default.

@markusl
Copy link
Owner

markusl commented Jan 12, 2015

Hi Jonny.

The limitation for the output file name is because the extension actually runs the executable and for security reasons it is best to limit it as much as possible while still being useful.

I'm afraid you need to recompile the extension to change the pattern which is used to look for tests. However, if you use the effort to make it configurable I can repackage a new version of the extension and ship it to all users.

Regards,
Markus

@evakili
Copy link

evakili commented Jan 13, 2015

What do you mean by recompile? Shouldn't it be on tools|options or somewhere similar?

@markusl
Copy link
Owner

markusl commented Jan 13, 2015

@evakili I mean, to change the regex pattern, the extension needs to be packaged again. The extension does not make the regex pattern configurable at the moment.

@noizefloor
Copy link

I know this issue is more than a year old, but we are having pretty much the same problem over here. We are still having plenty of CPPUnit test hosts, which are (huge surprise) all called TestHost. As all our CPPUnit Testhosts support the command line parameter and so does the gtest runner, I figured it might be a good idea to call the executable with -h first and only tread it as a google test runner if the parameter "--gtest_list_tests" is found in the result. I just created a pull request. I hope that solution might help some of you as well.

@markusl As my f# knowledge is very limited (or not existing if you wanna put it like that) you might wanna take a look and optimize it a bit. At least I tried ;)

@noizefloor
Copy link

I just found GoogleTestAdapter. It's pretty much a port of the Google Test Runner in C#, which is already way better for me. Also it let's you configure the pattern to discover Test binaries. You can do that globally (Tools->Options->Google Test Adapter) or by using a configuration file for every solution. That means you can leave the global setting empty and configure the explicit test host name in the configuration file. Exactly what I was looking for.

@philmccarthy24
Copy link

We're in the same situation as @jonnydee. This adapter project looks great but we can't use it because we can't rename our test projects...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants