Page MenuHomePhabricator

Inspect: support to print the exu diff result to standard output
ClosedPublic

Authored by YOhoho on Nov 5 2018, 1:49 AM.

Details

Summary

This is helpful to get simple result of .exu diff without file access

Test Plan

exactness_inspect --compare test.exu test.compare.exu --output=out.exu

Diff Detail

Repository
rTEXACT tools/exactness
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
YOhoho requested review of this revision.Nov 5 2018, 1:49 AM
YOhoho created this revision.
YOhoho updated this revision to Diff 17263.Nov 5 2018, 1:51 AM

Wrong deleted line..

YOhoho updated this revision to Diff 17264.Nov 5 2018, 2:40 AM

Remove needless stdout string comparison

JackDanielZ added inline comments.Nov 5 2018, 3:08 AM
src/bin/inspect.c
1126

Why don't you use int variables for each type, such as nb_imgs, nb_diff_imgs... It seems more natural and understandable. Moreover, you depend on enums order, which can be problematic if it changes.

1180

The output is not enough clear. If you don't read the code or the commit message, you don't know what means what is displayed
Maybe something like:
if there are no differences, just write Success (in green "<b><color=#00F>Success</color></b>")
Otherwise
Failure (in red):

  • Scenario (red or green, depending on result?): nb failures / total

same for objs and images

What do you think?

YOhoho added inline comments.Nov 5 2018, 3:47 AM
src/bin/inspect.c
1126

Agreed.
I'll use nb_scenarios, nb_shots, nb_objtrees.

1180

I don't want to add HTML tag in output because it is hard to parse. i think simple format is useful for other users.

What do you think about this format?
"result : %s\n"
"scenario (%d/%d)\n"
"image (%d/%d)\n"
"objs_tree(%d/%d)\n"
We can simply parse like that sscanf(str, "result : %s scenario(%d/%d)...", ret, &fail, &success,...);

If it is with the goal to parse it, so don't use the colors. Less pretty but more practical. Go for it!

YOhoho updated this revision to Diff 17281.Nov 7 2018, 8:07 PM
YOhoho edited the summary of this revision. (Show Details)
YOhoho edited the test plan for this revision. (Show Details)

apply new format

JackDanielZ added inline comments.Nov 8 2018, 2:34 AM
src/bin/inspect.c
1127

initialize them to 0

YOhoho updated this revision to Diff 17288.Nov 8 2018, 8:41 PM

initialize to 0

JackDanielZ accepted this revision.Nov 11 2018, 1:32 AM
This revision is now accepted and ready to land.Nov 11 2018, 1:32 AM
Closed by commit rTEXACT12af68f993dd: Inspect: support to print the exu diff result to standard output (authored by Yeongjong Lee <yj34.lee@samsung.com>, committed by JackDanielZ). · Explain WhyNov 11 2018, 1:34 AM
This revision was automatically updated to reflect the committed changes.