是否有 Xcode 键盘快捷键可以从 跳转MyObject.m到MyObjectTests.m,反之亦然?如果是,那是什么?
我正在将单元测试(SenTest)添加到我现有的XCode 4.2项目中.XCode抱怨它无法找到所需的Box2D头文件.例如,
Box2D/Dynamics/b2Fixture.h file not found
Run Code Online (Sandbox Code Playgroud)
Box2D源文件被添加到" libs"组下的项目中.在构建非测试目标时,会发现头文件没有问题.显然,我无法将头文件添加到测试目标,但我已将Box2D的所有.cpp文件添加到该目标.如上所述,这导致了更多的"词汇或预处理器问题".
如何告诉XCode在哪里找到这些头文件?
一旦第一次STAssert失败,有没有办法停止执行iOS单元测试?
例如,如果我有多个STAsserts:
STAssertTrue([myobject succeeded], @"failed");
STAssertNotNil(foo,@"bar");
Run Code Online (Sandbox Code Playgroud)
如果Xcode在第一个失败后停止执行测试,我会很高兴.有什么办法吗?
当我尝试在xcode 5.0中创建单元测试文件时,出现以下错误:
The test bundle at /.../Tests.octest could not be loaded because it is built for a different architecture than the currently-running test rig (which is running as x86_64).
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
所以我有一个问题,Apple过去3次拒绝了我的应用程序.他们总是给我留下这个错误.
Incident Identifier: 0F8AC4C8-57A6-4E1E-BE2B-0A93E6A85564
CrashReporter Key: 03e6d04a9f8fcf7989c751d0befe3b50ff6720c8
Hardware Model: xxx
Process: Unoffical Statitics [1012]
Path: /var/mobile/Applications/0A0DD25F-0320-4D79-BB3D-F69A9823B82C/Unoffical Statitics.app/Unoffical Statitics
Identifier: com.APPSTARME.ManUtd
Version: 1.0 (1.0)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-02-12 10:44:08.759 -0800
OS Version: iOS 7.0.4 (11B554a)
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000000e7ffdefe
Triggered by Thread: 0
Dyld Error Message:
Library not loaded: /Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit
Referenced from: /var/mobile/Applications/0A0DD25F-0320-4D79-BB3D-F69A9823B82C/Unoffical Statitics.app/Unoffical Statitics
Reason: image not found
Dyld Version: 324
Binary Images:
0x2befd000 - 0x2bf1d77a dyld …Run Code Online (Sandbox Code Playgroud) 我们最近使用iOS应用程序设置了一些Xcode机器人,以自动构建和测试我正在处理的应用程序.如果我只是构建和分析,构建过程工作正常.如果我将其设置为运行测试,则会以可变数量的错误结束Unexpected TestSuiteWillFinish.例如,最近一次运行显示:
运行测试套件TimeClockTestCase遇到错误(Unexpected TestCaseDidFinish)testParseResponseString遇到错误(Unexpected TestSuiteWillFinish)testGetIntegrationID遇到错误(意外的TestSuiteWillFinish)
之前的那个只有一个错误:
testAddChildObjectTypeTimeClockEvent遇到错误(意外的TestSuiteWillFinish)
无论显示什么错误,集成结果都会显示所有测试都已通过.如果我直接通过Xcode运行测试(而不是在服务器上运行bot),则没有错误并且传递相同数量的测试.
导致这些错误的原因是什么?如何消除它们?
这些是来自TimeClockTestCase的日志:
Test Suite 'TimeClockTestCase' started at 2014-02-23 23:11:09 +0000
2014-02-23 18:11:09.653 -0500 [TimeClockResponseCommand parseResponseString] [Line 74] W: Unsupported action number "3" in TIMECLOCK response command
Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockEvent]' started.
Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockEvent]' passed (0.000 seconds).
Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockMode]' started.
Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockMode]' passed (0.000 seconds).
Test Case '-[TimeClockTestCase testTimeclockEventColl]' started.
Test Case '-[TimeClockTestCase testTimeclockEventColl]' passed (0.000 seconds).
Test Case '-[TimeClockTestCase testTimeclockModeColl]' …Run Code Online (Sandbox Code Playgroud) 我正在使用FoneMonkey进行自动化,它利用OCUnit(SenTestingKit)以编程方式编写测试用例.有谁知道是否有办法定义测试脚本的运行顺序?在每个脚本中,有没有办法确定测试用例何时运行?
我读了一个简单的方法来查看保存的NSUserDefaults?
我找到了应用程序的.plist文件,但是哪个是测试包的文件?
我有一个测试用例和一个帮助类.在helper类中,我想在这里使用assert:
MainTests.h
#import <SenTestingKit/SenTestingKit.h>
@interface MainTests : SenTestCase
@end
Run Code Online (Sandbox Code Playgroud)
MainTests.m
#import "MainTests.h"
#import "HelperClass.h"
@implementation MainTests
- (void)testExample {
HelperClass *helperClass = [[HelperClass alloc] init];
[helperClass fail];
}
@end
Run Code Online (Sandbox Code Playgroud)
HelperClass.h
#import <SenTestingKit/SenTestingKit.h>
@interface HelperClass : SenTestCase
- (void)fail;
@end
Run Code Online (Sandbox Code Playgroud)
HelperClass.m
#import "HelperClass.h"
@implementation HelperClass
- (void)fail {
STFail(@"This should fail");
}
@end
Run Code Online (Sandbox Code Playgroud)
旁注:我必须使辅助类成为子类,SenTestCase才能访问断言宏.
来自辅助类的断言被忽略.有什么想法吗?如何在辅助类中使用断言?
我正在尝试为库编写单元测试.库中的方法返回字符串,我想确保它返回正确的字符串.但是STAssertEqualsSenTestKit中的某个宏看起来却是不同的值,即使它是相同的.
你可以看到描述部分清楚地表明两个字符串值是相同的,但是这个宏抱怨它们的值是不同的.当我从方法返回静态字符串时(就像返回一样@"op_user")它传递了测试用例.任何人都知道导致此测试失败的原因是什么?
sentestingkit ×10
unit-testing ×6
ios ×5
ocunit ×3
iphone ×2
objective-c ×2
xcode ×2
assert ×1
automation ×1
box2d ×1
frameworks ×1
xcode4.2 ×1
xctest ×1