Skip to content

Implement rux test: discover and run Tests/ packages#118

Open
BibhabenduMukherjee wants to merge 4 commits into
rux-lang:devfrom
BibhabenduMukherjee:feat/implement-rux-test
Open

Implement rux test: discover and run Tests/ packages#118
BibhabenduMukherjee wants to merge 4 commits into
rux-lang:devfrom
BibhabenduMukherjee:feat/implement-rux-test

Conversation

@BibhabenduMukherjee

Copy link
Copy Markdown

Description

This PR replaces the placeholder RunTest stub in rux test with a fully functional test runner. It discovers, builds, and executes test packages, verifying exit codes to report test suite success/failure.

Changes Made

  1. Automated Test Discovery:
    • Scans subdirectories in Tests/ containing a Rux.toml manifest with Type = "bin".
    • Builds each test package in-process using the RunBuild pipeline.
  2. Robust Workspace Test Support:
    • Falls back to current_dir / "Tests" if no root Rux.toml is present (allowing developers to run ./build/rux test directly from the compiler repo's root directory).
  3. Non-blocking Standard Input Redirection:
    • Redirects test child process input (hStdInput on Windows, file descriptor 0 on Unix) to NUL / /dev/null so that tests exercising stdin (e.g. Echo) immediately receive EOF rather than blocking indefinitely.
  4. Summary & Output:
    • Reports pass/fail statuses for each test package and exits with a non-zero exit code if any test fails.
  5. Documentation:
    • Updated CONTRIBUTING.md to document the test layout, how to run tests, and how to write new test packages.

Replace the placeholder RunTest stub with a working test runner.
rux test now:

- Scans Tests/ for subdirectories containing a Rux.toml with Type = "bin"
- Builds each package in-process (via RunBuild with a temporary chdir)
- Executes the resulting binary and treats exit 0 as PASS
- Prints per-package PASS/FAIL lines and a final ok/FAILED summary
- Exits non-zero if any test package fails

Mirrors the convention established by the existing shell scripts in
Tests/ (run_*.sh), which also build and assert exit 0.

Also updates CONTRIBUTING.md to document the test layout, how to
add new test packages, and the role of the shell-based scripts.
@BibhabenduMukherjee BibhabenduMukherjee force-pushed the feat/implement-rux-test branch from 584f537 to 5b45117 Compare June 9, 2026 14:43
@yydev-official

Copy link
Copy Markdown
Contributor

Hello, Developer here.

As the Rux-lang team is currently working on releasing the Newest version of the Compiler we sadly Cannot merge PR's which include new functionality currently.

Your Pull Request will be reviewed after the Release has been finalized and the development for the next version has started

Thank you for Contributing and for your time.

Comment thread Source/Cli/Commands/Base/PackageCmd.cpp Outdated
Comment thread CONTRIBUTING.md Outdated
@Natuworkguy Natuworkguy requested a review from spatulari June 10, 2026 00:51
@BibhabenduMukherjee

Copy link
Copy Markdown
Author

Fixed both — changed the wording to 'Running workspace tests' and corrected the function syntax to func in CONTRIBUTING.md. Thanks for the review!

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.

3 participants