E81016: orphan stdin file (no matching commandline args)

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

What went wrong

A stdin file exists but no test case matches it - there are no commandline arguments it belongs to, so it is never fed to any test.

How to fix it

  1. Check the filename matches the test case it is meant to supply.
  2. Add the matching commandline-args file, so the stdin file has a case.
  3. Or delete the stdin file if the case it served has gone.

Rationale

An input file nothing reads is indistinguishable from a test that is not running. Reporting it keeps a test directory honest about what it actually exercises.

See also

  • E81014: orphan envvars file
  • E81013: malformed line in envvars file

Examples

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

Fails with E81016: orphan stdin file (no matching commandline args) - reported by the test runner, not the compiler, when ek9 -t greeting.ek9 runs in this project.

bad/greeting.ek9

#!ek9
defines module error.e81016.bad

  defines function

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

bad/dev/tests.ek9

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

  references
    error.e81016.bad::greeting

  defines program

    @Test
    GreetingCases()
      -> name as String
      stdout <- Stdout()
      stdout.println(greeting(name))

bad/dev/commandline_arg_simple.txt

EK9

bad/dev/expected_case_simple.txt

Hello, EK9

bad/dev/stdin_arg_other.txt

typed input
$ ek9 -t greeting.ek9
ℹ️ Found 1 test:
  1 parameterized (1 cases total)

Executing 1 test...

❌ FAIL error.e81016.bad.tests::GreetingCases [Assert] (nms)
    Test configuration error: missing commandline_arg_other.txt

Summary: 0 passed, 1 failed (1 total)
Types: 1 assert
Duration: nms
ek9: tests failed (exit 11)
E81016: orphan stdin file (no matching commandline args)
  missing commandline_arg_other.txt
  See: ek9 -h E81016

Fixed: The stdin file belongs to a case: commandline_arg_other.txt

good/greeting.ek9

#!ek9
defines module error.e81016.good

  defines function

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

good/dev/tests.ek9

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

  references
    error.e81016.good::greeting

  defines program

    @Test
    GreetingCases()
      -> name as String
      stdout <- Stdout()
      stdout.println(greeting(name))

good/dev/commandline_arg_other.txt

World

good/dev/commandline_arg_simple.txt

EK9

good/dev/expected_case_other.txt

Hello, World

good/dev/expected_case_simple.txt

Hello, EK9

good/dev/stdin_arg_other.txt

typed input
$ ek9 -t greeting.ek9
ℹ️ Found 1 test:
  1 parameterized (2 cases total)

Executing 1 test...

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

Summary: 2 passed, 0 failed (2 results from 1 programs)
Types: 2 parameterized
Duration: nms