|
@@ -181,7 +181,6 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
|
|
|
NSLog("[KdanAuto]Auto Test \(objectIndex)")
|
|
|
if (objectIndex >= objects.count) {
|
|
|
// 所有自动化测试对象均执行完成
|
|
|
- NSLog("[KdanAuto]6");
|
|
|
do {
|
|
|
let rtfData = try? report.data(from: .init(location: 0, length: report.length),
|
|
|
documentAttributes: [.documentType: NSAttributedString.DocumentType.rtf])
|
|
@@ -190,12 +189,9 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
|
|
|
try? FileManager.default.removeItem(atPath: path);
|
|
|
try? rtfData?.write(to: NSURL.fileURL(withPath: path))
|
|
|
} catch {
|
|
|
- NSLog("[KdanAuto]7");
|
|
|
}
|
|
|
|
|
|
- NSLog("[KdanAuto]8");
|
|
|
DispatchQueue.main.async {
|
|
|
- NSLog("[KdanAuto]9");
|
|
|
self.view.window?.title = "KdanAuto:"+CPDFConvertKit.sharedInstance().versionString
|
|
|
|
|
|
self._isProcessing = false
|
|
@@ -208,7 +204,6 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
|
|
|
self.advanceBtn.isEnabled = true;
|
|
|
|
|
|
TestDegreeManager.shared().saveInfo()
|
|
|
- NSLog("[KdanAuto]10");
|
|
|
}
|
|
|
return
|
|
|
}
|
|
@@ -221,15 +216,12 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
|
|
|
var complention:(_ object:AutoTest, _ report:NSAttributedString?) -> () = {(object, inReport) in
|
|
|
};
|
|
|
complention = {(object, inReport) in
|
|
|
- NSLog("[KdanAuto]0");
|
|
|
if inReport != nil {
|
|
|
// 如果有自动化测试报告,则拼接在后面
|
|
|
report.append(inReport!)
|
|
|
}
|
|
|
|
|
|
- NSLog("[KdanAuto]1");
|
|
|
if (Thread.isMainThread) {
|
|
|
- NSLog("[KdanAuto]3");
|
|
|
// 更新当前自动化测试对象状态及相关 UI 状态
|
|
|
object.setStatus(.Finished)
|
|
|
|
|
@@ -239,10 +231,8 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
|
|
|
object.isEqual(to: self.advanceView.getAutoTestObj())) {
|
|
|
self.advanceView.setAutoTestObj(self.advanceView.getAutoTestObj());
|
|
|
}
|
|
|
- NSLog("[KdanAuto]4");
|
|
|
}else {
|
|
|
DispatchQueue.main.sync {
|
|
|
- NSLog("[KdanAuto]3");
|
|
|
// 更新当前自动化测试对象状态及相关 UI 状态
|
|
|
object.setStatus(.Finished)
|
|
|
|
|
@@ -252,17 +242,14 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
|
|
|
object.isEqual(to: self.advanceView.getAutoTestObj())) {
|
|
|
self.advanceView.setAutoTestObj(self.advanceView.getAutoTestObj());
|
|
|
}
|
|
|
- NSLog("[KdanAuto]4");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- NSLog("[KdanAuto]2");
|
|
|
DispatchQueue.global().asyncAfter(deadline: DispatchTime.init(uptimeNanoseconds: 300)) {
|
|
|
autoreleasepool {
|
|
|
// 触发下一个自动化测试对象进入自动化测试
|
|
|
objectIndex += 1
|
|
|
self.autotestBlock(objects)
|
|
|
- NSLog("[KdanAuto]5");
|
|
|
}
|
|
|
}
|
|
|
};
|