1. eutest -process-log -html question

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

new topic     » topic index » view message » categorize

2. Re: eutest -process-log -html question

axtens_bruce said...

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 
} 

axtens_bruce said...

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.

axtens_bruce said...

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu