E81005: program requires arguments but no commandline files found

Category: E81xxx-E83xxx Test configuration, execution and coverage · Classification: MISSING_ARGUMENTS · All error codes

What went wrong

A @Test program declares parameters but no commandline_arg_{id}.txt files were found to provide the arguments.

Worked examples

Compilable examples demonstrating this error and the correct fix:

  • ek9 -q 953 (How do @Test programs work with command-line arguments...)

Example error

A '@Test' program 'ProcessData()' that declares a parameter ('input as String'), in a directory with no commandline_arg_*.txt files, is this error: nothing supplies the argument it expects.

How to fix it

  1. Create commandline_arg_{id}.txt with args (one per line) and matching expected_case_{id}.txt with expected output
  2. Or remove parameters if test doesn't need them
  3. Or use assert statements instead of expected output files

Common causes

  • Forgot to create argument files
  • Files are in wrong directory

Examples

Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.

Fails with E81005: program requires arguments but no commandline files found - reported by the test runner, not the compiler, when ek9 -t greeting.ek9 runs in this project.

bad/greeting.ek9

#!ek9
defines module error.e81005.bad

  defines function

    greeting() as pure
      -> name as String
      <- result as String: `Hello, ${name}`

bad/dev/tests.ek9

#!ek9
defines module error.e81005.bad.tests

  references
    error.e81005.bad::greeting

  defines program

    @Test
    GreetingCases()
      -> name as String
      stdout <- Stdout()
      greeted <- greeting(name)
      stdout.println(greeted)
      assert greeted == `Hello, ${name}`
$ ek9 -t greeting.ek9
ℹ️ Found 1 test:
  1 assert (unit tests with assertions)

Executing 1 test...

❌ FAIL error.e81005.bad.tests::GreetingCases [Assert] (nms)
    Test configuration error: program declares 1 parameter(s) but no commandline_arg files found

Summary: 0 passed, 1 failed (1 total)
Types: 1 assert
Duration: nms
ek9: tests failed (exit 11)
E81005: program requires arguments but no commandline files found
  program declares 1 parameter(s) but no commandline_arg files found
  See: ek9 -h E81005

Fixed: The program is given its argument by commandline_arg_simple.txt

good/greeting.ek9

#!ek9
defines module error.e81005.good

  defines function

    greeting() as pure
      -> name as String
      <- result as String: `Hello, ${name}`

good/dev/tests.ek9

#!ek9
defines module error.e81005.good.tests

  references
    error.e81005.good::greeting

  defines program

    @Test
    GreetingCases()
      -> name as String
      stdout <- Stdout()
      greeted <- greeting(name)
      stdout.println(greeted)
      assert greeted == `Hello, ${name}`

good/dev/commandline_arg_simple.txt

EK9

good/dev/expected_case_simple.txt

Hello, EK9
$ ek9 -t greeting.ek9
ℹ️ Found 1 test:
  1 parameterized_hybrid (parameterized with assertions)

Executing 1 test...

✅ PASS error.e81005.good.tests::GreetingCases [Param:simple] (nms)

Summary: 1 passed, 0 failed (1 total)
Types: 1 parameterized_hybrid
Duration: nms