Skip to content

Fix inconsistent test output in MSYS2 and WSL#154

Open
rory-cd wants to merge 1 commit into
thoth-tech:mainfrom
rory-cd:fix/msys2-tests
Open

Fix inconsistent test output in MSYS2 and WSL#154
rory-cd wants to merge 1 commit into
thoth-tech:mainfrom
rory-cd:fix/msys2-tests

Conversation

@rory-cd
Copy link
Copy Markdown

@rory-cd rory-cd commented Jan 25, 2026

Description

Problems

Integration tests run by sktest.exe sometimes produce inconsistent results between WSL and MSYS2 environments.

  • Animation test runs at a much faster speed in MSYS2, to the point where it's not even observable
  • Camera movement in the camera test is much faster in MSYS2 than WSL
  • Ray movement in the geometry test is much faster in MSYS2 than WSL
  • Sprite movement in the sprite test is much faster in MSYS2 than WSL
  • UI test fails to load Arial.ttf on WSL (A windows default font not included in the Resources directory)

Summary of changes

Fixes have been applied where possible without editing core SplashKit functions. There are some critical issues affecting MSYS2 which cause some tests to fail, but these bugs are not caused by the tests themselves, and will be updated in separate PRs. This PR also includes some minor changes unrelated to environment consistency (such as broken URLs and output messages). These have been addressed to allow the tests to run clearly.

  • Animation: Added frame rate cap to fix MSYS2 animation playing too fast
  • Animation: Minor cout adjustments for readability
  • Audio: Updated music URL to valid path
  • Audio: Adjusted cout messages to improve result clarity
  • Audio: Stopped music after 5 seconds to improve result clarity
  • Camera: Added frame cap and camera move speed for cross-platform consistency
  • Geometry: Added frame cap and ray move speed for cross-platform consistency
  • Sprites: Added frame cap and sprite move speed for cross-platform consistency
  • TCP Networking: Added endl to improve readability
  • Text: Updated font URL to valid path
  • UI: Changed font from Arial to Hara to avoid missing font in WSL/Linux

Known issues not addressed by this PR

  • Issues with running sktest.exe in MSYS2 environment
    There have been some reported issues running sktest (at all) on MSYS2. Specifically, the animation test was found to loop indefinitely, and some users found the test runner was freezing even before tests were launched. This has been addressed in Tests investigation issues #132.

  • Graphical bugs
    There are inconsistent results when running graphics, input, and text tests in MSYS2, with graphical output displaying unexpected results. An example is shown here. This is likely related to drawing text in MSYS2, and cannot be addressed by updating the tests themselves.

  • Issues with download paths in MSYS2
    Some download functions are buggy in MSYS2, most likely due to path differences in Windows vs Linux. This affects:

    • Audio test: download_music
    • Text test: download_font
    • Window test: download_bitmap
  • Terminal test fails
    Fails on both WSL and MSYS2. Not yet investigated.

  • UI test fails on MSYS2
    Due to an issue with interface.cpp - addressed in Fix interface out of bounds error on MSYS2 #155.

  • Bundle test fails bitmap freeing
    Addressed in Fix bundle freeing: Bitmap resources not being freed #153.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Ran sktest in WSL and MSYS2 environments

Testing Checklist

  • Tested with sktest

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have requested a review from ... on the Pull Request

Fixes minor inconsistencies in test output for MSYS2 and WSL.
Minor cross-platform fixes were also added to aid testing.
- Animation: Added frame rate cap to avoid MSYS2 hyperspeed
- Animation: Minor cout adjustments for readability
- Audio: Updated music URL to valid path
- Audio: Adjusted cout messages to improve result clarity
- Audio: Stopped music after 5 seconds to improve result clarity
- Camera: Added frame cap and camera move speed for cross-platform consistency
- Geometry: Added frame cap and ray move speed for cross-platform consistency
- Sprites: Added frame cap and sprite move speed for cross-platform consistency
- TCP Networking: Added endl to improve readability
- Text: Updated font URL to valid path
- UI: Changed font from Arial to Hara to avoid missing font in WSL/Linux
Copy link
Copy Markdown

@222448082Ashen 222448082Ashen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General Information

  • Type of Change: Bug fix (Testing infrastructure)

Code Quality

  • Repository: Correct. The PR is made to splashkit-core.
  • Readability: High. The addition of std::endl to console outputs and the use of named constants for movement speeds (RAY_STEP, speed) make the test code much cleaner and easier to read.
  • Maintainability: High. By switching from system-dependent fonts (arial.ttf) to bundled assets (hara.ttf) and updating broken external URLs, this PR makes the test suite significantly more reliable across different development environments.

Functionality

  • Correctness: The changes correctly address several stability issues in the interactive tests:
    • CPU Usage: Adding framerate limits to refresh_screen() (30 or 60 FPS) prevents the tests from consuming excessive CPU cycles on Windows/MSYS2.
    • Asset Availability: Updating URLs for download_font and download_music ensures that the networking tests don't fail due to dead links.
    • UX: Increasing movement speeds compensates for the new framerate limits, keeping the interactive elements responsive.
  • Impact on Existing Functionality: No impact on core library code; these changes are limited to the /src/test directory.

Testing

  • Test Results: Logic check confirms that the updates to the test loops follow SplashKit best practices. Specifically, the inclusion of stop_music() after a download test prevents audio from lingering across subsequent tests.

Documentation

  • Documentation: N/A.

Pull Request Details

  • Checklist Completion: All relevant items reviewed.

@222448082Ashen
Copy link
Copy Markdown

Recommendations & Observations

  1. Framerate Consistency: The move to standardized framerates (30/60) in tests is a great improvement. It makes visual verification much more consistent across different hardware.
  2. Robust Assets: Switching to hara.ttf in the UI test is a smart move. It's always better to test with assets we control (in the Resources folder) rather than relying on the host OS having specific fonts.

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.

2 participants