julia-vscode / TestItemRunner.jl

Run Julia test items
MIT License
76 stars 11 forks source link

Organize testitems in a tree according to file structure #48

Open ffevotte opened 1 year ago

ffevotte commented 1 year ago

It seems to me that the discussion in #5 lead to the consensus that testitems should be organized in a tree following the same structure as the filesystem (maybe keeping the possibility to add finer tag-based subdivisions later).

This PR tries to implement this in the non-vscode context, using a tree of nested TestSets to structure the tests. For example, running the tests of TestItemRunner itself now produces the following output:

(TestItemRunner) pkg> test
     Testing TestItemRunner
     [...]
     Testing Running tests...
Test Summary:           | Pass  Total  Time
TestItemRunner          |   18     18  0.1s
  src/TestItemRunner.jl |    9      9  0.1s
    compute_line_column |    9      9  0.1s
  test                  |    9      9  0.0s
    runtests.jl         |    3      3  0.0s
      default_imports   |    1      1  0.0s
      TestSetup         |    2      2  0.0s
    testitemtree.jl     |    6      6  0.0s
      insert_node!      |    2      2  0.0s
      simplify!         |    4      4  0.0s
     Testing TestItemRunner tests passed 

In your opinion, would that be a desirable feature ? And a correct implementation of it ?

I feel like the new TestItemTree type introduced in this PR might be useful to structure tests in the same way in the VSCode context, but I'm not sure whether this is actually the case. And if so, I'm not sure where the code could go in order to be useable in both contexts. Do you have any thoughts about this?

ffevotte commented 1 year ago

Marking this as WIP because the implementation uses (at least) splitpath and only which are not supported in Julia 1.0