Skip to content

Add resources unit tests; remove old test hook#159

Open
222448082Ashen wants to merge 1 commit intothoth-tech:mainfrom
222448082Ashen:unit-test/resource
Open

Add resources unit tests; remove old test hook#159
222448082Ashen wants to merge 1 commit intothoth-tech:mainfrom
222448082Ashen:unit-test/resource

Conversation

@222448082Ashen
Copy link
Copy Markdown

Description

This PR adds dedicated Catch2 coverage for resources path utilities and removes the legacy manual Resources test registration from the old sktest runner.

Summary of changes:

  • Added unit_test_resources.cpp with tests for:
  • path_to_resources
  • path_to_resources(kind) for all resource kinds
  • set_resources_path
  • path_to_resource
  • Added platform separator helpers in the new test file for stable path assertions.
  • Added an RAII guard in the new test file to restore the original resources path after each test case.
  • Removed old run_resources_tests registration from test_main.cpp.
  • Removed old run_resources_tests declaration from test_main.h.

Motivation and context:

  • The previous resources test path was a legacy manual print-based check in sktest.
  • This change migrates resources verification into automated unit tests so behavior is asserted and regressions are caught by CI/test runs.
  • The RAII guard prevents global resource path state leakage across tests.

Dependencies required for this change:

  • No new runtime dependencies.
  • Uses existing Catch2 unit test setup already present in the project.

Fixes #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (update or new)

How Has This Been Tested?

Current status:

  • Not executed in this shell due local CMake/toolchain mismatch in the current PowerShell environment.

Reproduction steps:

  1. Open an environment with the project’s expected build toolchain (MSYS2/MinGW as configured for this repo).
  2. From cmake, run: cmake --preset Windows
  3. From cmake, run: cmake --build build --target skunit_tests
  4. Run the unit tests binary with resources filter, for example: skunit_tests [resources]
  5. Optionally run full suite: skunit_tests

Testing Checklist

  • Tested with sktest
  • Tested with skunit_tests

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

Add a new Catch2 test file (unit_test_resources.cpp) that verifies resources path utilities: path_to_resources, path_to_resources(kind), set_resources_path, and path_to_resource. The tests include helpers for platform path separators and an RAII guard to restore the original resources path after each test. Remove the old run_resources_tests declaration and its registration in the main test runner (test_main.h / test_main.cpp) since the resources tests are now handled by the new unit test file.
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