z: integrate GCC compile-only torture tests into test command#53
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Integrates GCC's compile-only torture test suite into the ./z test flow by introducing a check_steps() Bash function and the DejaGnu configuration (board file, site template, and simulator wrapper) needed to drive make check-gcc against the *-nanvix cross-compiler targets.
Changes:
- Add
check_steps()tozand call it fromtest_steps()so./z testrunsmake check-gccwith--target_board=nanvix-sim compile.exp. - Add DejaGnu board file (
nanvix-sim.exp), site template (site.exp.in), and ananvix-sim-runwrapper that adaptsnanvixd.elfto the simulator interface. - Support optional execute / all suites in
check_steps, with a print of thegcc.sumsummary.
Show a summary per file
| File | Description |
|---|---|
| z | Adds check_steps() and wires it as the final phase of test_steps(); generates nanvix-site.exp, installs the simulator wrapper, and invokes make check-gcc. |
| .nanvix/dejagnu/baseboards/nanvix-sim.exp | New DejaGnu board file selecting the in-tree compiler, hard-coding Nanvix link flags, and pointing the simulator hook at nanvix-sim-run. |
| .nanvix/dejagnu/nanvix-sim-run | New Bash wrapper that runs an ELF binary on nanvixd.elf under timeout, suppressing stderr. |
| .nanvix/dejagnu/site.exp.in | New site.exp template that appends the Nanvix board directory to DejaGnu's boards_dir. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 8
Introduce infrastructure to run GCC's built-in testsuite against the Nanvix cross-compiler, validating code generation for i686-nanvix and x86_64-nanvix targets. New files: - .nanvix/dejagnu/baseboards/nanvix-sim.exp: DejaGnu board file that configures target capabilities (no signals, no argv, status wrapper), linker flags for libposix.a/user.ld, and simulator invocation. - .nanvix/dejagnu/nanvix-sim-run: Wrapper adapting nanvixd.elf to the simulator interface DejaGnu expects. Logs nanvixd diagnostics to a separate file, passes test program stderr through, and emits a recognizable marker on timeout (--foreground -k 5). - .nanvix/dejagnu/site.exp.in: Template for DejaGnu site configuration that adds the custom board directory to the search path. Modified: - z: Add check_steps() function supporting compile, execute, and all test suites. Integrate into test_steps() as an opt-in step gated by Z_RUN_TORTURE=1 to avoid blocking routine developer test runs. Environment variables are scoped to the make child process. The sim wrapper install is guarded by a writability check. The .sum file is parsed for unexpected failures since make check-gcc always returns 0. Usage: Z_RUN_TORTURE=1 ./z test # smoke + integration + torture tests ./z test # smoke + integration only (default)
4e74588 to
958f81c
Compare
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.
Summary
Integrates GCC's built-in compile-only torture tests (
gcc.c-torture/compile/) into the./z testcommand to validate code generation for the Nanvix cross-compiler targets.Changes
New files
.nanvix/dejagnu/baseboards/nanvix-sim.exp— DejaGnu board file configuring the Nanvix target (linker flags, simulator settings, target capabilities).nanvix/dejagnu/nanvix-sim-run— Wrapper script adaptingnanvixd.elfto the simulator interface DejaGnu expects.nanvix/dejagnu/site.exp.in— Template for DejaGnu site configurationModified
z— Addedcheck_steps()function and integrated it as the final step oftest_steps()How it works
Compile-only tests run
make check-gcc RUNTESTFLAGS="--target_board=nanvix-sim compile.exp"which exercises thousands of C programs through the cross-compiler, catching code generation bugs without needing target execution.Execution tests (optional, requires
/dev/kvm) use thenanvix-sim-runwrapper to run binaries onnanvixd.elfvia the DejaGnu simulator protocol.Usage
The
check_steps()function also supports being called directly with different suites if exposed later:compile— compile-only torture tests (default, no KVM needed)execute— execution tests via nanvixd (requires/dev/kvm)all— both