Library-function test-driver
Artoria2e5 opened this issue · comments
The current test driver is based on string (usually stdout and argv) I/O and is not quite convenient to call from more restrictive environments such as iOS. A graphics environment might also want to display the results without too much string manipulation. A more "struct
-ured" (pardon my pun) API taking a struct input (multithread, seed) and a struct output (anything printed) might be more adequate and portable. core_results
is 90% there already.
The less intrusive way is to redirect main
and ee_printf
. Basically the caller calls the renamed core_main
supplying argc and argv, then retrieve the result from a global buffer that the new printf writes to.
This can be achieved without modifying the 5 core files -- ifdef is enough to rename main(). The makefile still needs to be taken down and rewritten.