Run Headless GLua Unit Tests
run_glua_testRun headless Garry's Mod unit tests and assertions in a sandboxed Source Engine mock runtime without the game client. Surfaces failures with line numbers and stack traces for debugging.
Instructions
Execute headless Garry's Mod unit tests and assertions using the embedded Source Engine mock runtime (Python/Lua test harness) without requiring the Garry's Mod game client. Sandboxed headless subprocess execution with a default 5000ms timeout (configurable via timeout_ms up to 30000ms). Safe and non-destructive; does NOT modify source files on disk. Surfaces assertion failures and runtime exceptions with exact line numbers and stack traces. Provide either test_file_path (workspace path to a test script) or code_to_test (inline GLua test string with assertions); when both are provided, test_file_path takes precedence. Configure mock_realm ('client', 'server', 'shared', default 'shared') to set SERVER and CLIENT boolean constants and simulate realm-specific global libraries. Use this tool to execute automated test suites, verify mathematical computations, test hook callbacks, and validate net message serialization logic. Do NOT use for static analysis without execution (use lint_glua instead) or Zero-GC allocation profiling (use analyze_performance instead). Returns a GModToolResult envelope with status ('success' when all assertions pass, 'failed' on assertion or execution error), summary, and data containing passed (boolean), tests_run count, failures count, errors array (test_name, error_message, stack_trace), output_log (raw stdout/stderr), and execution_time_ms.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mock_realm | No | Source engine execution realm environment to simulate ('client', 'server', or 'shared'). Controls SERVER and CLIENT boolean constants and realm-restricted mock libraries. | shared |
| timeout_ms | No | Maximum execution timeout in milliseconds before aborting the test runner process (between 500 and 30000, default is 5000). | |
| code_to_test | No | Inline GLua test code string containing assertions (e.g. 'assert(type(Vector) == "function")'). Ignored if test_file_path is provided. | |
| test_file_path | No | Workspace path to test script file. Takes precedence over code_to_test when both are provided. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Domain-specific typed payload returned by the tool. | |
| status | Yes | Execution status of the tool call ('success', 'partial', 'blocked', or 'failed'). | |
| summary | Yes | Concise, human-readable summary of operational findings, diagnostics, or execution outcome. | |
| evidence | Yes | Traceability evidence including cited documentation and generated artifacts. | |
| warnings | Yes | List of non-fatal warnings, lint advisories, engine caveats, or security notices. | |
| nextActions | No | Actionable, ordered recommendations for the agent's immediate next steps. |