Skip to content

Integration Test Runner for Cyrus Compiler #174

@tahadostifam

Description

@tahadostifam

🚧 Task: Integration Test Runner for Cyrus Compiler

📋 Summary

We need a Python script to run integration tests for .cyr source files within a given directory. These test files will include metadata specifying inputs and expected outputs. The script should use the compiler (path passed dynamically) to compile and execute each test file, then compare the actual output against the expected one.

This will be used in our GitHub CI pipeline to automatically verify that changes to the compiler do not break existing expected behavior.


✅ Requirements

  • Recursively search for .cyr source files in a specified directory.
  • For each file:
    • Read metadata embedded at the top of the source file:
      • stdin: standard input (optional)
      • args: command-line arguments (optional)
      • stdout: expected output
    • Run the source file using the Cyrus compiler, where the compiler path is passed dynamically (via environment variable or CLI arg).
    • Compare the program’s output with the expected stdout.
    • If the output differs, print a detailed error and fail the test.
  • Exit with proper code so GitHub Actions can catch failures.

🧪 Test File Format Example

Each test file (*.cyr) will begin with structured metadata in comments:

// @stdout: Greeting: Hello

public func main() {
    #name = "Cyrus";
    printf("Greeting: %s\n", name);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions