Files
HTMLKit/Tests/HTMLKitTests/HTMLKitParserPerformance.m
T
iska a102f5cd7d Fix loading of test resources
Building and testing the project via Xcode copies the resources into
the testing bundle, which is not the case for SwiftPM. Hence the helper
method, that tries loading the resource from the bundle first. If it is
nil then the resource is loaded from the test module path directly.
2017-03-13 23:01:53 +01:00

36 lines
753 B
Objective-C

//
// HTMLKitParserPerformance.m
// HTMLKit
//
// Created by Iska on 11/04/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import <XCTest/XCTest.h>
#import "HTMLParser.h"
#import "HTMLKitTestUtil.h"
@interface HTMLKitParserPerformance : XCTestCase
@end
@implementation HTMLKitParserPerformance
#define HTMLKIT_NO_DOM_CHECKS
- (void)testParserPerformance
{
NSString *path = [HTMLKitTestUtil pathForFixture:@"HTML Standard" ofType:@"html" inDirectory:@"Fixtures"];
NSString *string = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
[self measureBlock:^{
HTMLParser *parser = [[HTMLParser alloc] initWithString:string];
[parser parseDocument];
}];
}
#undef HTMLKIT_NO_DOM_CHECKS
@end