Skip to content

Cannot import the main module of a executable in the test module #5375

Open
@gmondada

Description

@gmondada

Description
Tests on a default Hello World carton project fails during compilation. Here is the result of carton test:

error: no such module 'carton_demo'
@testable import carton_demo
                 ^
note: module 'carton_demo' is the main module of an executable, and cannot be imported by tests and other targets

Executing swift test on the same project just works.

Steps to reproduce

mkdir carton_demo
cd carton_demo
carton init
carton test

Environment

  • carton --version => 0.17.0
  • swift-wasm toolchain: wasm-5.7.1-RELEASE
  • macOS 13.3
  • swift --version => swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions