Xcode - Test class File is part of module, ignoring import

前端 未结 3 943
鱼传尺愫
鱼传尺愫 2020-12-24 05:35

So I have an iOS project with tests and everything was working properly.

I felt the need to change the project name. I did as indicated at apple\'s docs, selected t

3条回答
  •  无人及你
    2020-12-24 06:00

    [UPTADE] This helped Jean-Frederic figuring out his answer. That's why I accepted it.

    I finally managed to fix this, but I'm not happy with the solution.

    Consider my app name AppName

    For some weird reason I cannot explain, my test target Build Settings -> Product Module Name had $(PRODUCT_NAME:c99extidentifier) which value was the Appname, instead of AppNameTests. I checked with other projects and the value is the same but converted to AppNameTests so in this case I'm not sure what I can do to make it automatically update and include the Test part in the name.

    What I ended up doing was setting the name as $(PRODUCT_NAME:c99extidentifier)Tests. Not sure if this is a proper solution, but for now it works.

    If anybody has a better solution, please feel free to share.

提交回复
热议问题