Skip to content

testament spec: targets doesn't work well with cmd #16344

Open
@timotheecour

Description

@timotheecour

I found this while working on #16343

3 bugs:

  • only 1 nim invocation should occur
  • PASS: tests/compiler/tcppCompileToNamespace.nim c is misleading because it actually uses cpp backend
  • if you use nim $target instead of nim cpp, the test will not honor targets: "cpp" (and fail as expected, for reasons unrelated to this issue) and will attempt c target

Example

from tests/compiler/tcppCompileToNamespace.nim

discard """
cmd: "nim cpp --cppCompileToNamespace:foo $options -r $file"
targets: cpp
"""
import os
echo "a" / "b"
doAssert defined(cpp)

Current Output

PASS: tests/compiler/tcppCompileToNamespace.nim c                  ( 0.18 sec)
PASS: tests/compiler/tcppCompileToNamespace.nim cpp                ( 0.17 sec)

Expected Output

PASS: tests/compiler/tcppCompileToNamespace.nim cpp ( 0.17 sec)

Additional Information

devel 1.5.1 0b73106

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions