Class NativeTestExecutor

java.lang.Object
org.ek9lang.cli.NativeTestExecutor
All Implemented Interfaces:
TestExecutor

final class NativeTestExecutor extends Object implements TestExecutor
Executes native LLVM-compiled test programs as subprocesses.

This executor spawns each test program as a separate native process, capturing stdout and stderr. Used for LLVM-compiled EK9 programs.

Process execution includes:

  • Timeout handling to prevent hung tests
  • Separate capture of stdout and stderr streams
  • Cross-platform executable resolution
  • Constructor Details

    • NativeTestExecutor

      NativeTestExecutor(Path executableDir)
      Create a native test executor with default timeout.
      Parameters:
      executableDir - Directory containing compiled native executables
    • NativeTestExecutor

      NativeTestExecutor(Path executableDir, long timeoutSeconds)
      Create a native test executor with specified timeout.
      Parameters:
      executableDir - Directory containing compiled native executables
      timeoutSeconds - Maximum execution time per test
  • Method Details

    • execute

      Description copied from interface: TestExecutor
      Execute a test program and capture its output.
      Specified by:
      execute in interface TestExecutor
      Parameters:
      test - The test program to execute
      Returns:
      Execution result with captured output and status
    • execute

      public TestExecutor.ExecutionResult execute(TestProgram test, List<String> arguments)
      Description copied from interface: TestExecutor
      Execute a test program with command line arguments.

      Used for parameterized black-box tests where arguments are read from commandline_arg_*.txt files.

      Specified by:
      execute in interface TestExecutor
      Parameters:
      test - The test program to execute
      arguments - Command line arguments to pass
      Returns:
      Execution result with captured output and status