ld/testsuite: add support for remote testing in ld-cdtest
Patch to enable remote testing in ld-cdtest by replacing direct execution with 'remote_load', improving compatibility with various target environments.
Maciej W. Rozycki reviews a patch by Clément Chigot that adds support for remote testing within the ld-cdtest test suite. The patch replaces direct execution of test executables with remote_load, allowing tests to run on both native and remote targets. Rozycki confirms the patch works on his powerpc64le-linux-gnu native system and a remote mips-linux-gnu cross target. He notes a minor nit regarding the handling of differences between output and expected results, suggesting a refinement to the regexp_diff mechanism.
- proposer
Submits a patch to enable remote testing in ld-cdtest by using 'remote_load' for execution.
- reviewer
Reviews the patch, confirms its functionality on native and remote targets, and suggests a minor improvement for output comparison.
“I can see this works correctly here with native `powerpc64le-linux-gnu' system as well as remote `mips-linux-gnu' cross target, enabling the tests in the latter case. I have looked through the change and it seems good to me except for one nit across two places; see below.”
- contributor
Responds to Maciej's review, acknowledging the ping and the potential issue with email delivery.
Technical Tradeoffs
- Using `remote_load` broadens test applicability but adds complexity in managing remote execution environments.
- Replacing direct `exec` with `remote_load` requires careful handling of execution status and output capture.
- Refining output diffing with `regexp_diff` improves robustness but might require more complex regular expressions.
In Details
This patch enhances the ld-cdtest test suite within binutils by enabling it to run tests on remote targets. Previously, tests were executed directly on the host system. The change introduces remote_load to execute binaries on a cross-target environment. This is crucial for testing linkers in diverse embedded or cross-compilation scenarios where direct execution isn't feasible. The review also touches upon how test output differences are handled, suggesting improvements for robustness.
- ld-cdtest
- A test suite for the GNU linker (ld), likely focusing on code generation or specific linking scenarios.
- Remote testing
- Executing tests on a different machine or environment than the one initiating the test, common in cross-compilation and embedded systems development.
- remote_load
- A command or function within a testing framework that loads and executes a program on a remote or target system.
- regexp_diff
- A utility or function that compares two text files or strings using regular expressions to identify differences, often used in test suites to check output.
- Cross-target
- An environment where the development machine (host) and the execution machine (target) have different architectures or operating systems.