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

Get file/line info for test cases #4

Closed
melak47 opened this issue Sep 2, 2018 · 2 comments
Closed

Get file/line info for test cases #4

melak47 opened this issue Sep 2, 2018 · 2 comments

Comments

@melak47
Copy link

melak47 commented Sep 2, 2018

Is your feature request related to a problem? Please describe.
You can't jump from the test case in the test explorer to the source file where the test is defined.

Describe the solution you'd like
For test discovery, run the executable with --verbosity high --list-test-names-only.
Catch will then produce output like:

map     @parsecxx/test/combinators.cpp(52)
times   @parsecxx/test/combinators.cpp(57)
operator<<      @parsecxx/test/combinators.cpp(96)

which can be split into test case name, file and line number.

Additional context
I tried to implement this myself, but I couldn't even get the extension to compile without any changes because of this error:

src/adapter.ts:302:70 - error TS2345: Argument of type '[string[], string[], [string, string[]], [string, string], [string, ProcessEnv]]' is not assignable to parameter of type '[string, string] | ConcatArray<[string, string]>'.
  Type '[string[], string[], [string, string[]], [string, string], [string, ProcessEnv]]' is not assignable to type 'ConcatArray<[string, string]>'.
    Types of property 'slice' are incompatible.
      Type '(start?: number, end?: number) => (string[] | [string, string] | [string, string[]] | [string, Pr...' is not assignable to type '(start?: number, end?: number) => [string, string][]'.
        Type '(string[] | [string, string] | [string, string[]] | [string, ProcessEnv])[]' is not assignable to type '[string, string][]'.
          Type 'string[] | [string, string] | [string, string[]] | [string, ProcessEnv]' is not assignable to type '[string, string]'.
            Type 'string[]' is not assignable to type '[string, string]'.
              Property '0' is missing in type 'string[]'.

302       const resolveDebugVariables = this.variableResolvedPair.concat([
                                                                         ~
303         ["${label}", testInfo.label],
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
307         ["${envObj}", testInfo.execOptions.env!]
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308       ]);
    ~~~~~~~
@matepek
Copy link
Owner

matepek commented Sep 2, 2018

wow, that's nice. I didn't know about this feature.
I will definitely implement it.
Actually after you run your tests, the navigation works, but your solution is good from the first load.

About your trying:
Not a TS guru. I wouldn't guess whats the problem :)

@matepek matepek closed this as completed Sep 3, 2018
@melak47
Copy link
Author

melak47 commented Sep 4, 2018

Thanks for implementing this. The problem on windows is not caused by your extension, as you expected: hbenl/vscode-test-explorer#11

matepek added a commit that referenced this issue Jan 11, 2019
@duaneellissd duaneellissd mentioned this issue Jul 4, 2023
1 task
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

2 participants