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

Support alternative test name formatting #23

Closed
kornman00 opened this issue Jan 25, 2016 · 6 comments
Closed

Support alternative test name formatting #23

kornman00 opened this issue Jan 25, 2016 · 6 comments
Assignees

Comments

@kornman00
Copy link

As discussed in #22, in the Test Explorer window if VS can't fit the text after a "/" (that's then terminated by another "/" or the EOS) then it shortens everything after that "/" with "...". Perhaps a replacement string could be provided in GTA's settings? Eg, instead of "/" a user could specify "->" or something else.

Here are truncated instantiated test cases:
image

And here they are when the window is expanded to fit the next segment:
image

@kornman00
Copy link
Author

I guess the repro owners can only apply labels? This is meant to be an enhancement issue

@csoltenborn
Copy link
Owner

After thinking about it for a while, I'm not sure whether this is a good idea. Here's why:

  • The current test names resemble the names displayed by Google Test. Changing them might lead to confusion if the user is not aware of the setting (e.g. because she configured it long ago or received the setting via a shared solution settings file).
  • The regexes which can be used to assign traits to tests work against the tests' display names. This means that the user must be aware that if she changes one setting, she also has to change the other setting.
  • Even if VS cuts the names of some tests, the complete test names can be seen by hovering with the mouse over the according tests. Plus, the full name is shown the the details pane anyways if a test is selected.

Overall, it feels like we add quite a bit of complexity for a rather limited problem.

@kornman00 Does this convince you? What do you think?

@kornman00
Copy link
Author

Well, to the first point, Google Test Adapter adapts the tests to be interfaceable in VS' own Test Explorer. So I would expect there to be some settings to fix non 1:1 mapping quirks. Since I'm assuming the Test Explorer tree itself can't be tweaked, I would figure there could be an opt-in name setting to get around extreme cases, like presented in project above (I also believe I read somewhere that per-project settings could be set? So the opt-in could be per-project?).

If a user honestly initially forgets they have the '/' character replacement setting active, I'd think the appearance of its replacement in such long test name sequences would make them go "oh yeah".

Hovering over the entry in the tree is indeed a workaround. Sadly, I don't always have three monitors at my disposal to keep such windows always open. So personally, I keep the test explorer minimized along the left side of VS (not all projects I open include tests or require testing interaction on my part). I suppose in this case I can just have the Test Explorer expand all the way across my screen when I brush the cursor over the tab. A bit annoying, but managable.

Of course, It could be that a backwards slash doesn't exhibit that truncation behavior. Or maybe a space before and after the forward slash bypasses the behavior.

So perhaps there should be NO complexity to this limited problem...at the end of the day the problem is with how VS formats Google's instantiated cases (or are there other cases where GT uses forward slashes?), so perhaps some alternate concat string could be set by the user, instead of some full-fledged renaming policy.

That's my 2c. I'll...adapt to whatever decision you arrive at.

@csoltenborn csoltenborn self-assigned this Mar 12, 2016
@csoltenborn
Copy link
Owner

For the record:

  • \ basically has the same effect as / (difference: it is cut before the \, not after)
  • same for (space character, looks ugly anyways),|, and-
  • . would work, but is already used to separate suite from test name
  • _ would work, but is rather common in test names afaik (even if not recommended by Google)
  • :: would work, but is confusing imho (dedicated meaning in C++)
  • : would work

: seems to be the best option so far, but I still don't like it too much...

@kornman00
Copy link
Author

Thanks for taking the time to address this!

@csoltenborn
Copy link
Owner

You're welcome! Just give us some time until the next release...

csoltenborn pushed a commit that referenced this issue Oct 21, 2017

* addressing feedback

* Assorted fit-and-finish

* Undo unfinished work for BatchFile resource

* Fix some resources comments

* Remove unused resources

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

No branches or pull requests

3 participants