Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Add original test line to the test output for easier debugging #2

Open
TalSk opened this issue Apr 30, 2020 · 0 comments

Comments

@TalSk
Copy link
Contributor

TalSk commented Apr 30, 2020

So obviously it is extremely hard to debug long tests since you can't know exactly where you failed.
I tried to play with some changes, and figured the following does a decent job (A change to line 84):

    for line_number, line in enumerate(i.readlines()):
        time.sleep(0.1)
        p.stdin.writelines([bytes("printf \"\\nTest line: " + str(line_number) + "\\n\"\n", "utf-8")])

The trick is sending smash an echo command that will print the current test line number. This will require re-running all tests to get the new .exp files.
This is not perfect mainly because it really clutters the output, but it did help me find where I failed way more easily than I would have otherwise.
What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant