Diary 2019-08-22
Notes on processing the coverage database:
- There is one context with an empty name. It is valid coverage for all arcs, and should be associated with the first statement in each file.
- All coverage within test modules is valid.
- All other names are module paths to test modules. The default target can be extracted by the regex tests.(.*\.)test_([^.]*)\.[^.]* or something like that, I just eyeballed it.
- The file names are stored as absolute paths. They should be converted into paths relative to the cwd, probably.
- I expect files to include the tests under the tests directory, and the code under test, in the src/whatever directory. I guess I should try to support the src-less layout.
- In any case, the file paths can be converted into module paths.
- Then, the following expansions can occur: test file to all contexts that originate from it, and test file to the files associated with all modules considered to be under test for it.
- From there, it's a matter of discarding all arcs where the combination of file_id and context_id doesn't match any known combination.
I'm kind of rusty on doing sophisticated things with SQL in a non-terrible way; I don't know if there's an efficient way to do that.
Okay, I pushed this entry as late as I could; later, probably. I have to call it now. Good night.