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

tests: fixed init/dt regressions and add os.exit() if UNATTENDED=1 #271

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

jstine35
Copy link
Collaborator

@jstine35 jstine35 commented Jan 26, 2025

  • load() function was not being called due to some merge error conflict that added an extra "end" in the wrong place
  • the dt value was not passed into update(dt) due to a difference in how xpcall() works between lua 5.1 and 5.2
  • switched syntax from state.['member'] to state.member for readability
  • Fixes inconsistent background color by setting the background color ever frame instead of just once on Load()

calling os.exit() if UNATTENDED=1 (env)

This should be some handy boilerplate to facilitate running tests as part of PR smoke checks. It's also useful for my local bash shell driven development testing too, but I'm hesitant to make it the default behavior, since I can imagine other workflows that might use a persistent instance of retroarch to relaunch the test repeatedly after lua modifications.

Getting pretty close to the point where the unit tests - or some significant subset of them - should be runnable via the CI to improve PR test coverage. (still some blockers such as having a libretro frontend that can run in a way that is friendly to the restrictions imposed by github runners, eg. no GPU)

 - load() function was not being called due to some merge error conflict that added an extra "end" in the wrong place
 - the `dt` value was not passed into `update(dt)` due to a difference in how `xpcall()` works between lua 5.1 and 5.2
 - switched syntax from `state.['member']` to `state.member` for readability
 - Fixes inconsistent background color by setting the background color ever frame instead of just once on Load()
This should be some handy boilerplate to facilitate running tests as part of PR smoke checks.
@jstine35 jstine35 requested review from RobLoach and kivutar January 26, 2025 05:42
@jstine35 jstine35 merged commit d257cfc into libretro:master Jan 27, 2025
10 checks passed
@jstine35 jstine35 deleted the unit_test_fixes branch January 27, 2025 20:47
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 this pull request may close these issues.

1 participant