Testing algorithm
- Posted by SDPringle Oct 07, 2008
- 961 views
I just ran a test on the svn Euphoria 4.0 directory with 'make -f makefile.wat testwin' and had I forgot to set EUCOMPILEDIR or EUDIR before I did. The resulting emake.bat script put the -I setting to my 3.1 EUDIR instead. Needless to say, emake.bat failed on all of them. I know that is okay and I am sure there will be someone telling me its my fault inspite of the fact what I am saying here is only background information for the problem that I found.
When the test completes, it reports success for everything except t_text.e. Even though the exe files were not created at all. I would expect it to report 100% failure.
In eutest.ex the process is created with:
status = system_exec("emake.bat", 2)
This goes against the warnings in the documentation to use system_exec with batch files. So, I modified this to use cmd.exe /c ahead of emake.bat. CMD.exe is not a batch file so we can run system_exec on it. It is certainly better than doing what is done here but it doesn't solve the issue. I get the same results when my build process patch is applied.
What if I check if exe exists aftewards?
system("emake.bat", 2) status = not file_exists( filename & ".exe" )
The problem is, this creates a race-condition problem. If emake.bat succeeds the file system might not have the existence of the resulting executable updated yet. So, instead of getting false successes you'll get false failures. Pick your posion. Is there a way to tell the OS hang this process until all current file-system changes are syncronized? Two answers are the UNIX utility sync() and the system Internals Windows utility Sync() . There ought to be a system call for this. If there isn't we need a different work around.
Shawn Pringle