Beluga
Beluga copied to clipboard
New overall test harness
The current bash script for testing has been a problem almost every time we try to upgrade it, due to cross-platform compatibility issues. I believe that it should be replaced entirely.
I think that a replacement in Python would be suitable, since it is easy to invoke other programs using the subprocess
module, but I would also be interested in a test harness written in OCaml. This would open the door to writing unit tests as well.
I was about to ask Brigitte and you abou this! Thank you for bringing this up. However, I'm not sure whether python will be a good solution, regarding the fact that python 2.* reached the end of its life but pre-installed python for many OSs is still 2.*. What do you think?
That's exactly my concern with using Python. I believe macOS still ships Python 2, so we still have the same portability issue with supporting macOS. I think that writing the harness directly in OCaml might be the best option, provided that there is a cross-platform library for filesystem operations we can use. If there is no such library, then personally I'm at a loss as to how one should proceed.
Some unit tests have been introduced using the OUnit2 library in OCaml. bisect_ppx
can also be used to check test coverage.
Testing of the Beluga core will prove challenging though because of the unmanaged states and global variables.