LiblinphoneTester: sort suites & tests alphabetically

This commit is contained in:
Gautier Pelloux-Prayer 2016-06-07 10:17:29 +02:00
parent 03875265e8
commit 62b6a80ba0
4 changed files with 13 additions and 7 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="H1p-Uh-vWS">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="H1p-Uh-vWS">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Navigation Controller-->

View file

@ -79,16 +79,19 @@ static NSString *const kAllTestsName = @"Run All tests";
return;
}
[_tests
addObject:[TestItem testWithName:kAllTestsName fromSuite:self.detailItem]]; // suite name not used for this one
if ([self.detailItem isEqualToString:@"All"]) {
// dont sort tests if we use all suites at once
for (int i = 0; i < bc_tester_nb_suites(); i++) {
[self addTestsFromSuite:[NSString stringWithUTF8String:bc_tester_suite_name(i)]];
}
} else {
[self addTestsFromSuite:self.detailItem];
[_tests sortUsingComparator:^(TestItem *obj1, TestItem *obj2) {
return [obj1.name compare:obj2.name];
}];
}
// suite name not used for this one
[_tests insertObject:[TestItem testWithName:kAllTestsName fromSuite:self.detailItem] atIndex:0];
}
- (void)viewDidLoad {

View file

@ -67,6 +67,8 @@ void tester_logs_handler(int level, const char *fmt, va_list args) {
bc_tester_set_resource_dir_prefix([bundlePath UTF8String]);
bc_tester_set_writable_dir_prefix([documentPath UTF8String]);
liblinphonetester_ipv6 = true;
LOGI(@"Bundle path: %@", bundlePath);
LOGI(@"Document path: %@", documentPath);
@ -74,11 +76,12 @@ void tester_logs_handler(int level, const char *fmt, va_list args) {
int count = bc_tester_nb_suites();
_objects = [[NSMutableArray alloc] initWithCapacity:count + 1];
[_objects addObject:@"All"];
for (int i = 0; i < count; i++) {
const char *suite = bc_tester_suite_name(i);
[_objects addObject:[NSString stringWithUTF8String:suite]];
}
[_objects sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
[_objects insertObject:@"All" atIndex:0];
}
- (void)dealloc {

View file

@ -53,7 +53,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>3</string>
<string>6</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationExitsOnSuspend</key>