Repository navigation
test: add in-repo test framework and labelled test layout - #2630
Closed
elhajahmadj wants to merge 2 commits into
Closed
elhajahmadj wants to merge 2 commits into
elhajahmadj wants to merge 2 commits into
Conversation
ElfReader validates the section header entry size, the string table index and section name bounds, and rejects virtual addresses that wrap or map outside the file. Jpeg decoding zero-initialises stb allocations and returns nullopt when the stream has no start of scan.
Adds core/testing with named cases, a runner that keeps going after failures, skip exit code 77 and the anyps5_add_test helper. Tests move into unit, integration, gpu and e2e folders with matching CTest labels, and new unit tests cover nid, ElfReader, GuestImageReader and the JPEG and PNG decoders. docs/dev/TESTING.md describes the layout.
|
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes. |
7 of 9 tasks
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a small in-repo test framework (
core/testing) and moves back-end tests into a labelled layout, soctest -L unitruns fast tests that don't need a device.core/testing: named cases, a runner that keeps going after a failed case,--list,--case <name>, positional arguments, skip exit code 77 (skipped, <reason>, read bytools/check_skips.py),RequireEqual,RequireThrows*andTemporaryDirectory. It needs only the C++20 standard library, so the relinker-only build can use it. It is an INTERFACE library compiled into each test, so tests built with thecore/libsunwind flags can still catch failures.anyps5_add_testandanyps5_add_library_testregister tests with one of the labelsunit,integration,gpu,e2eortooling. Only unit tests get an explicit 30 s timeout; the other labels usectest --timeout.tests/{unit,integration,gpu,e2e}folders. New unit tests cover nid (SHA-1, NID compute and resolve, the patchers, export exclusions),ElfReader,GuestImageReaderand the JPEG and PNG decoders.docs/dev/TESTING.mddescribes the layout.CONTRIBUTING.mdandREADME.mdlink to it..gitignore:Testing/(the CTest output folder) also matchedcore/testing/include/Testing/, so this adds negations for the framework folder.Fixes found by the new tests (
fix:commit):ElfReaderchecks the section header entry size,shstrndx < shnumand section name bounds. It rejects virtual addresses that wrap or map outside the file.Jpeg::Decodezero-initialises stb allocations, so a truncated scan no longer returns uninitialised pixels. It returnsnulloptwhen there is no start-of-scan marker.Found but not fixed here (each needs its own PR):
DumpSamplesruns inside a render pass.main.sceVideoOutOpenafter a failure may corrupt the heap.guest_sce_netis flaky under parallel load.Follow-up: 75 test files still use the old
main()+Requirestyle throughCUSTOM_MAINor the old helpers. Converting them goes in a separate PR.Tested
all+libs): no errors.ctest -L unitpasses 49 of 49.tools/check_test_registration.pyreports 500 test executables, none built and not run.-DANYPS5_RELINKER_ONLY=ON: builds without warnings, and all 61 tests pass.tools/check_conventions.pypasses.Checklist
main; no other open PR implements the same functions. This branch is about 370 commits behindmainand touches files that changed there, so it will need a rebase before merge.NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)