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

Explain how tests know when to end #19

Closed
Rangi42 opened this issue Dec 22, 2022 · 2 comments · Fixed by #20
Closed

Explain how tests know when to end #19

Rangi42 opened this issue Dec 22, 2022 · 2 comments · Fixed by #20

Comments

@Rangi42
Copy link

Rangi42 commented Dec 22, 2022

If I initialize a test with pc = SomeRoutine, I would expect it to end when the routine returns. But there are more complex cases. What about testing a routine that calls other routines, where they may return? What about if SomeRoutine pops its return address off the stack and messes with it? Or if you start with call SomeRoutine / dw SomeData, and SomeRoutine pops its "return address" to use SomeData as an argument? Or if you're testing a whole ROM (so pc isn't initialized) and there may be interrupts?

@eievui5
Copy link
Owner

eievui5 commented Dec 22, 2022

At the moment, evunit pushes $FFFF to the stack before running your code, and when pc == $FFFF, the test is considered over. There’s an issue open to allow for more arbitrary end conditions.

@Rangi42
Copy link
Author

Rangi42 commented Dec 22, 2022

Got it. I think it would be nice to explain that in the README even if it'll be improved eventually.

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

Successfully merging a pull request may close this issue.

2 participants