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