1. eutest -process-log -html question
- Posted by axtens_bruce in May
- 504 views
Also what function/library is being used to read the unittest.log when running eutest -process-log -html? Unittest.log isn't JSON. I'm not sure what it is nor am I sure how to write my own tool to parse it.
-Bruce
2. Re: eutest -process-log -html question
- Posted by ghaberek (admin) in May
- 486 views
Unittest.log isn't JSON.
Correct. For example, running eutest -log t_wildcard.e produces the following unittest.log file:
entry = { "file", "t_wildcard.e" } entry = { "passed", "is_match()", 0 } ... entry = { "summary", 4, 0, 4, 0 }
I'm not sure what it is
I guess you could call this "ESON." It's basically just Euphoria code which can be read with the routines get() (from files) or value() (from strings) found in std/get.e. Each "test" routine in std/unittest.e eventually calls add_log() which uses pretty_print() to write its data to unittest.log.
nor am I sure how to write my own tool to parse it.
Eutest calls do_process_log() when you pass -process-log on the command line. It's reading the file using a clever hack: starting here it splits the entire text file on "entry = " which results in a sequence containing each object in plain text, which are then passed through value() to parse them into real objects. Each "entry" in the log is indicated by its first element: "file", "passed" or "failed", and "summary". What you'll probably want then is an output containing a list of files and their corresponding results, data, and summary.
As I was poking around to collect this information, what started as an experiment in testing the use of split() and value() quickly turned into a simple but mostly complete parser, so here you go: std/utparse.e
Hope that helps.
-Greg