import { Config, LanguageConfig } from '../config'; export interface TestCaseResult { index: number; status: 'AC' | 'WA' | 'TLE' | 'RE'; durationMs: number; actualOutput: string; expectedOutput: string; errorOutput?: string; firstDiffLine?: number; memoryByte?: number; } export interface RunAllTestsResult { success: boolean; compileError?: string; results: TestCaseResult[]; } /** * Resolves the absolute path to a task directory. */ export declare function resolveTaskDirectory(workspaceRoot: string, taskArg?: string): string; /** * Detects the code file to execute in the task directory. */ export declare function detectCodeFile(workspaceRoot: string, taskDir: string, config: Config, fileArg?: string): { codeFile: string; langKey: string; langConfig: LanguageConfig; }; /** * Resolves a placeholder format `{{file: defaultValue}}` using the actual filename. */ export declare function resolvePlaceholder(str: string, actualFile?: string): string; /** * Resolves the build and run commands by substituting template filenames with the actual filename. */ export declare function resolveCommands(workspaceRoot: string, langConfig: LanguageConfig, actualFile: string, extension: string): { build: string; run: string; }; /** * Runs the build command if present. */ export declare function runBuild(buildCommand: string, taskDir: string): Promise<{ code: number; stderr: string; }>; /** * Parses a command line string into a command and an array of arguments, * respecting double and single quotes. */ export declare function parseCommandString(cmdStr: string): { command: string; args: string[]; }; /** * Warms up the execution environment by spawning the run command once, * immediately ending stdin, to bypass initial VM initialization and * OS-level execution overheads (like Gatekeeper on macOS). */ /** * Resolves relative command paths (e.g. ./a.out) to absolute paths relative to taskDir * to avoid OS path resolution overhead and potential spawn errors. */ export declare function resolveSpawnCommand(command: string, taskDir: string): string; /** * Runs a single test case. */ export declare function runTestCase(runCommand: string, taskDir: string, inputPath: string, outputPath: string, timeLimitMs: number, index: number): Promise; export declare function runAllTests(workspaceRoot: string, taskDir: string, fileArg?: string, timeLimitMs?: number): Promise;