AdaCore / libadalang-tools

Libadalang-based tools
GNU General Public License v3.0
16 stars 13 forks source link

Should the persistent package (with global setup and teardown) be located outside the harness folder when using gnattest? #30

Open dalybrown opened 9 months ago

dalybrown commented 9 months ago

For unit testing with gnattest, there is the ability to setup and teardown globally here: https://github.com/AdaCore/libadalang-tools/blob/8702a8f4240fe4cdaaad5c0fdeeb1a27816280fd/src/test-common.adb#L900.

However, this file is by default generated in a subfolder of the harness directory. We typically treat everything in that folder as throwaway in the sense that we can regenerate it so we don't commit any of the files to version control. However, the one exception is this file mentioned above.

Would it make more sense to place that file outside the harness directory? It seems (to me at least) that it is cleaner if everything in the harness directory is ignored and everything in the tests is added to version control. Otherwise we need some complicated exceptions in our .gitignore file.

Alternatively, perhaps there is another option to provide gnattest where read-only files are placed in on folder and the other files (which are added to version control) are placed in their own folder.