vendredi 28 avril 2017

Swift 3 - UI Tests Mach-O Linker error

I'm trying to write UI & Unit Tests for an app we're working on. In order to make it easy, I've written a class that randomly instantiates objects that can then be used by all the test classes.

The problem I'm encountering right now is that when building UI Tests, the Mach-o linker is throwing some errors saying Symbols not found for architecture ... and referencing my project's main classes and that random object generator.

The weird thing is that, for Unit Tests, the same random generator works just fine !

For context: Doesn't matter if I run everything on actual device or simulator (so the architecture argument in the error is irrelevant)

My project is setup in the following manner:

  • Workspace:
    • Project: My Project
      • Class Foo
      • Class Bar
    • Target: Unit Tests
      • Class RandomObjectGenerator
      • Unit test 1
    • Target: UI Tests
      • UI test 1

Note that RandomObjectGenerator class is assigned to the following targets: RandomObjectGenerator Target

As such, my Unit/UI test classes always specify @testable import MyProject.

Here's the error message thrown during compilation: Compiler Linker error

While in the editor, I can reference those classes just fine...

If anyone has any idea, I'd be glad to hear it. I'm kinda losing my mind to those errors :(

Aucun commentaire:

Enregistrer un commentaire