byte-physics / igortest

Igor Pro Universal Testing Framework
https://docs.byte-physics.de/igor-unit-testing-framework/
BSD 3-Clause "New" or "Revised" License
7 stars 2 forks source link

Add auto generated tests #463

Open Garados007 opened 7 months ago

Garados007 commented 7 months ago

It is quite difficult to run auto generated tests using igortest. A current approach with the existing igortest could be:

  1. Perform the first test run. (must be inside an IM)
    1. Each test case can generate new code (as a string) and save it as a new file in a specified path.
    2. Run compilation tests using the generated code.
  2. Perform the second test run.
    1. Load all code from the specified path.
    2. Search for test cases there and execute them.
  3. Cleanup all auto generated code.

This results in two test runs and multiple coverage and test result files. You also need to change your CI code to combine all results. It is also difficult to associate the generated code with the generator function.

A simpler approach could be to create new assertion/helper functions that:

Auto generated code can be quite useful if you need lots of combinations that is difficult to test with usual code and needs to be written one by one. It is also quite useful if you want lots of compilation checks with small snippets of code.