Hi
Imagine if you could load an FGL module dynamically, that was generated and compiled on the fly...
Do you think this would help?
I mean, you could generate any FGL code you want, compile it to a 42m module and load it dynamically, get references to the functions of the module and call these functions (a bit like dlopen / dlsym of C dynamic linking loader).
I need to double check this with the team but I always liked that idea and I don't think this is very difficult.
Observations:
1. Unit tests are generally very closely associated with the code they test, preferable in the same module.
2. As a module may be associated with multiple programs you can't do the tests at the program level.
3. Function names in modules have to be unique so general names like setup_tests()/run_tests() won't work.
Given this I could see it working as follows: Write a program that loads a 4gl from disk and compiles it (or loads the 42m directly), searches for function names based on a pattern, for example mymodule_run_tests(), and if it exists runs the function. The only bit not so nice is that fact that we have to look for a function name based on a pattern. A PRIVATE keyword would be really useful :-)
Thanks