iOS 重复实现 --> 测试失败

标签 ios swift unit-testing

我的很多测试突然失败,我认为这与这个控制台输出有关:

    objc[46098]: Class GGLClearcutWriter is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GGLClearcutAccountData is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GGLClearcutRequest is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GGLClearcutLogger is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GGLConfiguration is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GGLConfigurationV2 is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GMRConfiguration is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GGLBundleUtil is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GGLContext is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GGLHash is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GGL_CLEARCUTClientanalyticsRoot is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GGL_CLEARCUTLuser_nameventKeyValues is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.
objc[46098]: Class GGL_CLEARCUTActiveExperiments is implemented in both /Users/user_name/Library/Developer/CoreSimulator/Devices/0C0F9526-F930-43F6-AB6F-AADF1DB2C780/data/Containers/Bundle/Application/679F4B16-4677-43C8-B025-E582E2A8FF2A/AppName.app/AppName and /Users/user_name/Library/Developer/Xcode/DerivedData/AppName-edmnkgnmwezwfqcqnznlsuagoizc/Build/Intermediates/CodeCoverage/AppName/Products/Debug-iphonesimulator/AppNameTests.xctest/AppNameTests. One of the two will be used. Which one is undefined.

我认为 GGL​​_* 与 Google 有关,它来自通过 cocoapods 导入的 Google Analytics。

测试在新模拟器上第一次运行时通过,但在第二次或以后运行时失败。

应用程序运行良好。 知道可能是什么问题吗?

最佳答案

这表明应用程序和测试也链接在相同的类别中。 这是不必要的,并且可能不必要地增加测试目标的大小

但是由于两者在您的情况下是相同的,因此它是无害的,我不知道这会如何使测试失败

关于iOS 重复实现 --> 测试失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35507757/

相关文章:

ios - 无法在 Swift 中将一个结构分配给另一个结构

ios - Parse.com 的一些列未在 segue 上更新

Android ui test with espresso 无法使用fresco SimpleDraweeView

node.js - Jest 模拟和测试 require.resolve 调用

python - 在 Python 中对不同函数重用单元测试的良好实践

ios - 将大数字四舍五入到最接近的百位, float 正在失去值(value)

IOS:使用离线 map

ios - 如何在iOS10中启用相机的拍照选项

ios - 使用数据将 PFFile 转换为 UIImage 并附加到数组

ios - 快速展开模态