Euphoria
Ticket #172:
couldn't add to unittest.log
-
Reported by
ne1uno
Jul 10, 2010
unittest.log problem started sometime around r3141 on eubins.
I use a bat to create an html test report and noticed the same problem. something changed in eutest in the coverage branch and after merge.
this test runs ok with r3155 source/eutest.ex using later eui & includes
(have to modify split() parameter order)
r3174 to r3118 source/eutest.ex fails
FAILURE: t_*.e couldn't add to unittest.log
unittest.log gets left zero size on exit
not sure where the problem starts exactly and no clue why. nothing obvious jumps out on a diff of eutest.ex versions.
the makefiles can generate an html report as well, target report , this test file shows the problem much quicker.
include std/unittest.e
include std/filesys.e
-- doesn't make any sense to bother translating this...
ifdef not EC then
sequence eutest = ".." & SLASH &".." & SLASH & "source" & SLASH & "eutest.ex"
sequence incdir = ".." & SLASH & ".." & SLASH & "include"
sequence exe = command_line()
exe = exe[1]
delete_file("report.html")
sequence files = dir( "t_test_*.e" )
for i = 1 to length( files ) do
integer result = system_exec( sprintf("%s -i %s %s -log %s",
{exe, incdir, eutest, files[i][D_NAME]}), 2 )
integer expected = file_exists( files[i][D_NAME] & ".fail")
test_equal( sprintf("eutest %s", {files[i][D_NAME]}), expected = 0, result = 0 )
end for
system( sprintf("%s -i %s %s -process-log -html >report.html",
{exe, incdir, eutest}), 2 )
test_equal( "eutest report.html exists", 1, file_exists("report.html"))
test_equal( "unittest.log >0", 1, 0<file_length("unittest.log"))
puts(1, "t_eutest report summary:\n")
set_test_verbosity( TEST_SHOW_ALL )
end ifdef
test_report()
/*
tests\eutest\t_eutest_report.e
modified from tests\t_eutest.e
*/
Details
1. Comment by DerekParnell
Jul 10, 2010
I just uploaded a fix for this. The problem was when Matt did the 'coverage' stuff, he recoded the command line switch processing and forgot to pass the "-log" switch to the unit test run, so it was never adding to the log file. This was reported as an error so the test was deemed to have failed.
2. Comment by ne1uno
Jul 10, 2010
sounds right, that commandline processing, as Matt pointed out, was pretty convoluted. will test more later.
3. Comment by DerekParnell
Jul 10, 2010
In fact, I added a new switch to eutest.ex that gives us a generic method of passing switches just meant for unittest.e.
eg.
eutest -testopt xyz
This will now pass "-xyz" onto the unittest's command line.
4. Comment by ne1uno
Jul 11, 2010
unittest report on eubins working again, eutest probably ok. eubins 3319.html
Jeremy must have tweaked the build, not sure it could have built automatically the last 25 revs without some help. (see dev list)