Skip to content

z: add test, verify commands and Nanvix OS download step#52

Merged
ppenna merged 1 commit into
devfrom
feature-nanvix-tests
May 16, 2026
Merged

z: add test, verify commands and Nanvix OS download step#52
ppenna merged 1 commit into
devfrom
feature-nanvix-tests

Conversation

@ppenna

@ppenna ppenna commented May 16, 2026

Copy link
Copy Markdown
Contributor

Extend the build utility with end-to-end testing and verification capabilities for the Nanvix cross-toolchain.

Changes

download_steps now fetches the Nanvix OS multi-process release (libposix.a, user.ld, and nanvixd binaries) via gh release download when not already present in the install location.

New commands:

  • ./z test — runs a smoke test that cross-compiles .nanvix/tests/hello.c with the installed ${TARGET}-gcc, then (if KVM is available) executes the resulting ELF on nanvixd.elf and asserts value = 42 in the output.
  • ./z verify — checks that all expected toolchain artifacts (compiler binaries, libraries, Nanvix OS files) are present after installation.

CI pipeline updated to enable KVM, run verify, and run the smoke test after the stage-1 build completes.

Files

  • z — new functions: test_smoke_c, test_integration_c, test_steps, verify_steps; extended download_steps
  • .nanvix/tests/hello.c — minimal C test program
  • .github/workflows/ci.yml — added verify and test steps with KVM enablement

@ppenna ppenna changed the base branch from nanvix/v13.3.0 to dev May 16, 2026 16:45
@ppenna ppenna force-pushed the feature-nanvix-tests branch from 25fcb55 to a1d4fe2 Compare May 16, 2026 16:45
Copilot AI review requested due to automatic review settings May 16, 2026 16:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the ./z build utility with post-install validation: it can now download required Nanvix OS runtime artifacts, verify that an installed cross-toolchain has the expected files, and run a basic end-to-end C compile (and optionally execute the result under nanvixd when KVM is available). CI is updated to run the new verification and smoke test steps after the stage-1 install.

Changes:

  • Extend download_steps to fetch Nanvix OS release artifacts (libposix.a, user.ld, nanvixd binaries) via gh release download.
  • Add ./z verify (artifact presence checks) and ./z test (compile smoke test + optional KVM integration run).
  • Update GitHub Actions workflow to enable KVM and run verify/test after installation.
Show a summary per file
File Description
z Adds Nanvix OS download logic plus new test/verify commands and supporting functions.
.nanvix/tests/hello.c Adds a minimal C program used by the smoke/integration tests.
.github/workflows/ci.yml Exports GH_TOKEN, enables KVM permissions, and runs ./z verify and ./z test post-install.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 4

Comment thread z Outdated
Comment thread z
Comment thread z
Comment thread z
@ppenna ppenna force-pushed the feature-nanvix-tests branch from 35712e9 to b837f32 Compare May 16, 2026 17:42
@ppenna ppenna self-assigned this May 16, 2026
Copilot AI review requested due to automatic review settings May 16, 2026 17:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 3

Comment thread z Outdated
Comment thread z Outdated
Comment thread z
Extend the build utility with end-to-end testing and verification
capabilities for the Nanvix cross-toolchain.

download_steps now fetches the Nanvix OS multi-process release
(libposix.a, user.ld, and nanvixd binaries) via `gh release download`
when not already present in the install location.

New commands:
- `./z test`: runs a smoke test that cross-compiles .nanvix/tests/hello.c
  with the installed ${TARGET}-gcc, then (if KVM is available) executes
  the resulting ELF on nanvixd.elf and asserts "value = 42" in the output.
- `./z verify`: checks that all expected toolchain artifacts (compiler
  binaries, libraries, Nanvix OS files) are present after installation.

CI pipeline updated to enable KVM, run verify, and run the smoke test
after the stage-1 build completes.
@ppenna ppenna force-pushed the feature-nanvix-tests branch from 6793377 to f3c17dd Compare May 16, 2026 19:04
@ppenna ppenna merged commit d4758ca into dev May 16, 2026
1 check passed
@ppenna ppenna deleted the feature-nanvix-tests branch May 16, 2026 19:26
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