Browse Source

Demo - 内存优化、线程优化,转换特殊字符文件到 RTF Crash 排查;

zhudongyong 2 years ago
parent
commit
64c129616d

BIN
KdanAutoTest/KdanAuto.xcodeproj/project.xcworkspace/xcuserdata/zhudongyong.xcuserdatad/UserInterfaceState.xcuserstate


+ 10 - 26
KdanAutoTest/KdanAuto.xcodeproj/xcuserdata/zhudongyong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -14,8 +14,8 @@
             filePath = "KdanAuto/Class/AutoTestCase/AutoTest.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "325"
-            endingLineNumber = "325"
+            startingLineNumber = "346"
+            endingLineNumber = "346"
             landmarkName = "stringToImage(_:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -46,8 +46,8 @@
             filePath = "KdanAuto/ViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "196"
-            endingLineNumber = "196"
+            startingLineNumber = "204"
+            endingLineNumber = "204"
             landmarkName = "tableView(_:shouldSelect:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -116,22 +116,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "AA4BEFBE-8037-421E-A2DA-93A8D9A6669C"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "KdanAuto/Class/FileConveter/FileConverter.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "55"
-            endingLineNumber = "55"
-            landmarkName = "converter(_:desPath:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -142,9 +126,9 @@
             filePath = "KdanAuto/Class/FileConveter/FileConverter.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "118"
-            endingLineNumber = "118"
-            landmarkName = "converter(_:desPath:)"
+            startingLineNumber = "121"
+            endingLineNumber = "121"
+            landmarkName = "converter(_:inDesPath:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -158,9 +142,9 @@
             filePath = "KdanAuto/Class/FileConveter/FileConverter.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "79"
-            endingLineNumber = "79"
-            landmarkName = "converter(_:desPath:)"
+            startingLineNumber = "75"
+            endingLineNumber = "75"
+            landmarkName = "converter(_:inDesPath:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>

+ 34 - 13
KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTest.swift

@@ -147,9 +147,18 @@ class AutoTest : NSObject, AutoTestProtocal {
                                                                     attributes:[.foregroundColor : NSColor.blue]))
                 // ...
                 // 执行转换过程
-                let success = FileConverter.shared().converter(originPath, desPath: resultPath)
-                var isDirectory = ObjCBool(false)
+                let convertSemaphore = DispatchSemaphore(value: 0)
+                var success = false
+                let convertQueue = DispatchQueue.global()
+                convertQueue.async {
+                    success = FileConverter.shared().converter(originPath, inDesPath: resultPath)
+                    
+                    convertSemaphore.signal()
+                }
+                convertSemaphore.wait()
+                
                 
+                var isDirectory = ObjCBool(false)
                 if FileManager.default.fileExists(atPath: resultPath, isDirectory:&isDirectory) && success {
                     // compare screenshoot between result file with check file
                     if needCompare {
@@ -176,22 +185,34 @@ class AutoTest : NSObject, AutoTestProtocal {
                             let rComparePath = NSString(string: resultDirectory).appendingPathComponent(subFileName+"_\(DataModel.shared.latestReportID()!).jpg")
                             let cComparePath = NSString(string: checkDirectory).appendingPathComponent(subFileName+".jpg")
                             
-                            if (ProcessThumbnal.process(subResultPath, desPath: rComparePath, outputSize: CGSize.init(width: 2048, height: 2048)) &&
-                                FileManager.default.fileExists(atPath: rComparePath)) {
-                                
-                                let degree = compareJPEG(rComparePath, checkPath: cComparePath)
+                            
+                            let processThumbSemaphore = DispatchSemaphore(value: 0)
+                            var processSuccess = false
+                            let thumbnailQueue = DispatchQueue.global()
+                            thumbnailQueue.async {
+                                processSuccess = ProcessThumbnal.process(subResultPath, desPath: rComparePath, outputSize: CGSize.init(width: 2048, height: 2048))
                                 
-                                if degree == -1 {
-                                    reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath)\"快照对比失败,生成快照失败或无比对文件\n",
-                                                                                        attributes:[.foregroundColor : NSColor.red]))
+                                if ( processSuccess &&
+                                     FileManager.default.fileExists(atPath: rComparePath)) {
+                                    
+                                    let degree = self.compareJPEG(rComparePath, checkPath: cComparePath)
+                                    
+                                    if degree == -1 {
+                                        self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath)\"快照对比失败,生成快照失败或无比对文件\n",
+                                                                                            attributes:[.foregroundColor : NSColor.red]))
+                                    }else {
+                                        self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath)\"快照对比完成,图像相似度 \(degree)%\n",
+                                                                                            attributes:[.foregroundColor : NSColor.red]))
+                                    }
                                 }else {
-                                    reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath)\"快照对比完成,图像相似度 \(degree)%\n",
+                                    self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath)\"快照生成失败\n",
                                                                                         attributes:[.foregroundColor : NSColor.red]))
                                 }
-                            }else {
-                                reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath)\"快照生成失败\n",
-                                                                                    attributes:[.foregroundColor : NSColor.red]))
+                                
+                                processThumbSemaphore.signal()
                             }
+                            processThumbSemaphore.wait()
+                            
                         }
                     }
                 }else {

+ 1 - 1
KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTestProtocal.swift

@@ -22,7 +22,7 @@ enum AutoTestStatus : Int {
 
 protocol AutoTestProtocal : NSObjectProtocol {
     // 类型关键字
-    func fileType() -> String
+    func fileType() -> String // PPT/RTF/EXCEL/Word/....
     func type() -> String
     func name() -> String
     

+ 31 - 13
KdanAutoTest/KdanAuto/Class/AutoTestCase/StringAutoTest.swift

@@ -59,8 +59,17 @@ class CharacterAutoTest : AutoTest {
                                                                attributes:[.foregroundColor : NSColor.black]))
             // ...
             // 执行转换过程
+            let convertSemaphore = DispatchSemaphore(value: 0)
+            var success = false
+            let convertQueue = DispatchQueue.global()
+            convertQueue.async {
+                success = FileConverter.shared().converter(originPath, inDesPath: resultPath)
+                
+                convertSemaphore.signal()
+            }
+            convertSemaphore.wait()
             
-            if FileManager.default.fileExists(atPath: resultPath) {
+            if FileManager.default.fileExists(atPath: resultPath) && success {
                 if checkString {
                     // Load check file
                     let checkData = NSData.init(contentsOfFile: checkPath) as! Data
@@ -213,22 +222,31 @@ class CharacterAutoTest : AutoTest {
                         let rComparePath = NSString(string: resultDirectory).appendingPathComponent(fName+"_\(DataModel.shared.latestReportID()!).jpg")
                         let cComparePath = NSString(string: checkDirectory).appendingPathComponent(fName+".jpg")
                         
-                        if (ProcessThumbnal.process(resultPath, desPath: rComparePath, outputSize: CGSize.init(width: 2048, height: 2048)) &&
-                            FileManager.default.fileExists(atPath: rComparePath)) {
-                            
-                            let degree = compareJPEG(rComparePath, checkPath: cComparePath)
+                        let processThumbSemaphore = DispatchSemaphore(value: 0)
+                        var processSuccess = false
+                        let thumbnailQueue = DispatchQueue.global()
+                        thumbnailQueue.async {
+                            processSuccess = ProcessThumbnal.process(resultPath, desPath: rComparePath, outputSize: CGSize.init(width: 2048, height: 2048))
                             
-                            if degree == -1 {
-                                reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照对比失败,生成快照失败或无比对文件\n",
-                                                                                    attributes:[.foregroundColor : NSColor.red]))
+                            if (processSuccess &&
+                                FileManager.default.fileExists(atPath: rComparePath)) {
+                                
+                                let degree = self.compareJPEG(rComparePath, checkPath: cComparePath)
+                                
+                                if degree == -1 {
+                                    self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照对比失败,生成快照失败或无比对文件\n",
+                                                                                        attributes:[.foregroundColor : NSColor.red]))
+                                }else {
+                                    self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照对比完成,图像相似度 \(degree)%\n",
+                                                                                        attributes:[.foregroundColor : NSColor.red]))
+                                }
                             }else {
-                                reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照对比完成,图像相似度 \(degree)%\n",
+                                self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照生成失败\n",
                                                                                     attributes:[.foregroundColor : NSColor.red]))
                             }
-                        }else {
-                            reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照生成失败\n",
-                                                                                attributes:[.foregroundColor : NSColor.red]))
+                            processThumbSemaphore.signal()
                         }
+                        processThumbSemaphore.wait()
                     }
                 }
             }else {
@@ -257,7 +275,7 @@ class CharacterAutoTest : AutoTest {
         }
     }
     
-    func replaceUnicodeString(_ string:NSString) -> NSString {
+    func replaceUnicodeString(_ string:NSString) -> NSString {//中
         let items = string.components(separatedBy: "\\u") as [NSString]
         
         var resultString = NSString()

+ 33 - 12
KdanAutoTest/KdanAuto/Class/AutoTestCase/TextColorAutoTest.swift

@@ -72,12 +72,21 @@ class TextColorAutoTest : AutoTest {
                                                           attributes:[.foregroundColor : NSColor.blue]))
             // ...
             // 执行转换过程
+            let convertSemaphore = DispatchSemaphore(value: 0)
+            var success = false
+            let convertQueue = DispatchQueue.global()
+            convertQueue.async {
+                success = FileConverter.shared().converter(originPath, inDesPath: resultPath)
+                
+                convertSemaphore.signal()
+            }
+            convertSemaphore.wait()
             
             
             var maxCount = 0;
             var succCount = 0;
             
-            if FileManager.default.fileExists(atPath: resultPath) {
+            if FileManager.default.fileExists(atPath: resultPath) && success {
                 // 转换成功
                 
 #if true // 新文档框排形式
@@ -250,22 +259,34 @@ class TextColorAutoTest : AutoTest {
                     let rComparePath = NSString(string: resultDirectory).appendingPathComponent(fName+"_\(DataModel.shared.latestReportID()!).jpg")
                     let cComparePath = NSString(string: checkDirectory).appendingPathComponent(fName+".jpg")
                     
-                    if (ProcessThumbnal.process(resultPath, desPath: rComparePath, outputSize: CGSize.init(width: 2048, height: 2048)) &&
-                        FileManager.default.fileExists(atPath: rComparePath)) {
-                        
-                        let degree = compareJPEG(rComparePath, checkPath: cComparePath)
+                    let processThumbSemaphore = DispatchSemaphore(value: 0)
+//                    var processSuccess = false
+                    let thumbnailQueue = DispatchQueue.global()
+                    thumbnailQueue.async {
+//                        processSuccess =
+                        ProcessThumbnal.process(resultPath, desPath: rComparePath, outputSize: CGSize.init(width: 2048, height: 2048))
                         
-                        if degree == -1 {
-                            reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照对比失败,生成快照失败或无比对文件\n",
-                                                                                attributes:[.foregroundColor : NSColor.red]))
+                        if (ProcessThumbnal.process(resultPath, desPath: rComparePath, outputSize: CGSize.init(width: 2048, height: 2048)) &&
+                            FileManager.default.fileExists(atPath: rComparePath)) {
+                            
+                            let degree = self.compareJPEG(rComparePath, checkPath: cComparePath)
+                            
+                            if degree == -1 {
+                                self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照对比失败,生成快照失败或无比对文件\n",
+                                                                                    attributes:[.foregroundColor : NSColor.red]))
+                            }else {
+                                self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照对比完成,图像相似度 \(degree)%\n",
+                                                                                    attributes:[.foregroundColor : NSColor.red]))
+                            }
                         }else {
-                            reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照对比完成,图像相似度 \(degree)%\n",
+                            self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照生成失败\n",
                                                                                 attributes:[.foregroundColor : NSColor.red]))
                         }
-                    }else {
-                        reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"快照生成失败\n",
-                                                                            attributes:[.foregroundColor : NSColor.red]))
+                        
+                        processThumbSemaphore.signal()
                     }
+                    processThumbSemaphore.wait()
+                    
                 }
             }else {
                 reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(fName)\"转档失败!\n",

+ 53 - 40
KdanAutoTest/KdanAuto/Class/FileConveter/FileConverter.swift

@@ -24,8 +24,11 @@ class FileConverter : NSObject, CPDFConverterDelegate, CPDFConverterFPDelegate {
     var fpConverter:CPDFConverterFP?
     var options:CPDFConvertOptions?
     
-    var _srcPath:String = ""
-    var _desPath:String = ""
+    var srcPath:String = ""
+    var desPath:String = ""
+    var pages:[Int] = []
+    var pathExtension = ""
+    var convertQueue = DispatchQueue.main
     
     var semaphore:DispatchSemaphore? = DispatchSemaphore.init(value: 0)
     var accessSemaphore:DispatchSemaphore? = DispatchSemaphore.init(value: 1)
@@ -36,37 +39,30 @@ class FileConverter : NSObject, CPDFConverterDelegate, CPDFConverterFPDelegate {
         return instance
     }
     
-    func converter(_ srcPath: String, desPath: String) -> Bool {
-        _srcPath = srcPath
-        _desPath = desPath
+    func converter(_ inSrcPath: String, inDesPath: String) -> Bool {
+        self.srcPath = inSrcPath
+        self.desPath = inDesPath
         
-        if !FileManager.default.fileExists(atPath: _srcPath) {
+        if !FileManager.default.fileExists(atPath: srcPath) {
             return false
         }
          
         accessSemaphore?.wait()
-        if FileManager.default.fileExists(atPath: _desPath) {
-            try! FileManager.default.removeItem(atPath: _desPath)
+        if FileManager.default.fileExists(atPath: self.desPath) {
+            try! FileManager.default.removeItem(atPath: self.desPath)
         }
         
-        let url = URL.init(fileURLWithPath: _srcPath, isDirectory: false)
-        let pathExtension = NSString(string: _desPath).pathExtension
-        let outputPath = NSString(string: _desPath).deletingPathExtension
-        let output = _desPath
-        
-        DispatchQueue.global(qos:.default).async {
-            self.fpConverter?.setDelegate(nil)
-            self.fpConverter = nil
-            self.pdfConverter?.delegate = nil
-            self.pdfConverter = nil
+        let url = URL.init(fileURLWithPath: self.srcPath, isDirectory: false)
+        self.pathExtension = NSString(string: self.desPath).pathExtension
+//        let outputPath = NSString(string: self.desPath).deletingPathExtension
+//        let output = self.desPath
+        self.convertQueue.async {
             let document = PDFDocument.init(url: url)
-            let pages = document!.pageCount - 1
+            let pageCount = document!.pageCount
             
-            var pagesArray = []
-//            var i = 0
-            for i in 0...pages {
-                pagesArray.append(i)
-//                i = i+1
+            self.pages = []
+            for i in 1...pageCount {
+                self.pages.append(i)
             }
             
 //            if NSArray(array: ["ppt", "PPT", "PPTX", "pptx"]).contains(pathExtension) {
@@ -80,37 +76,44 @@ class FileConverter : NSObject, CPDFConverterDelegate, CPDFConverterFPDelegate {
 //                self.pdfConverter = CPDFConverterWord.init(url: url, password: nil)
 //                self.pdfConverter?.delegate = self
 //                self.options = CPDFConvertWordOptions()
-//                self.pdfConverter?.convert(toFilePath: self._desPath,
+//                self.pdfConverter?.convert(toFilePath: self.self.desPath,
 //                                           pageIndexs: pagesArray, options: nil)
 //            }else
 //            if NSArray(array: ["xls", "XLS", "xlsx", "XLSX"]).contains(pathExtension) {
 //                self.pdfConverter = CPDFConverterTable.init(url: url, password: nil)
 //                self.pdfConverter?.delegate = self
 //                self.options = CPDFConvertTableOptions()
-//                self.pdfConverter?.convert(toFilePath: self._desPath,
+//                self.pdfConverter?.convert(toFilePath: self.self.desPath,
 //                                           pageIndexs: pagesArray, options: nil)
 //            }else if NSArray(array: ["csv", "CSV"]).contains(pathExtension) {
 //                self.pdfConverter = CPDFConverterCsv.init(url: url, password: nil)
 //                self.pdfConverter?.delegate = self
 //                self.options = CPDFConvertCsvOptions()
-//                self.pdfConverter?.convert(toFilePath: self._desPath,
+//                self.pdfConverter?.convert(toFilePath: self.self.desPath,
 //                                           pageIndexs: pagesArray, options: nil)
 //            }else {
-                self.fpConverter = CPDFConverterFP.init()
-                self.fpConverter?.setDelegate(self)
+                if self.fpConverter == nil {
+                    self.fpConverter = CPDFConverterFP.init()
+                    self.fpConverter?.setDelegate(self)
+                }else {
+                    self.fpConverter?.stopConvertsionIfNeed()
+                }
+            
                     
-                let needMerge = NSArray(array: ["csv", "CSV"]).contains(pathExtension)
+            let needMerge = NSArray(array: ["csv", "CSV"]).contains(self.pathExtension)
 //                let allInOneSheetKey = String(CPDFConvertOptionsKey.allInOneSheet)
             
-                self.fpConverter?.convertPDF(atPath: self._srcPath,
-                                        pdfPassword: nil,
-                                        pdfPageIndexs: pagesArray,
-                                        destDocType: pathExtension,
-                                             destDocPath: self._desPath,
+//            Task.init {
+                self.fpConverter?.convertPDF(atPath: self.srcPath,
+                                             pdfPassword: nil,
+                                             pdfPageIndexs: self.pages,
+                                             destDocType: self.pathExtension,
+                                             destDocPath: self.desPath,
                                              moreOptions: [
-                                            "KMPDFConvertOptionsKeyImageDPI" : "72",
-                                            "CPDFConvertOptionsKeyAllInOneSheet":NSNumber(booleanLiteral: needMerge)
-                                        ])
+                                                "KMPDFConvertOptionsKeyImageDPI" : "72",
+                                                "CPDFConvertOptionsKeyAllInOneSheet":NSNumber(booleanLiteral: needMerge)
+                                             ])
+//            }
 //            }
         }
         
@@ -128,8 +131,13 @@ class FileConverter : NSObject, CPDFConverterDelegate, CPDFConverterFPDelegate {
     func converter(_ converter: CPDFConverter!, didEndConvert error: Error!) {
         didSuccess = nil == error
         
-        sleep(1)
+        sleep(2)
         
+        if self.pdfConverter?.isConverting == true {
+            self.pdfConverter?.cancel()
+        }
+        self.pdfConverter?.delegate = nil
+        self.pdfConverter = nil
         semaphore?.signal()
     }
     
@@ -140,9 +148,14 @@ class FileConverter : NSObject, CPDFConverterDelegate, CPDFConverterFPDelegate {
     /// CPDFConverterFPDelegate
     func fppdfConverter(_ converter: Any!, didEndConversion error: Error!) {
         didSuccess = nil == error
+        self.fpConverter?.stopConvertsionIfNeed()
         
-        sleep(1)
+        sleep(2)
         
+//        self.fpConverter?.stopConvertsionIfNeed()
+//        self.fpConverter?.setDelegate(nil)
+//        self.fpConverter = nil
+//        
         semaphore?.signal()
     }
     

+ 1 - 0
KdanAutoTest/KdanAuto/Class/Setting/SettingViewController.xib

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
+        <deployment identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>

+ 10 - 2
KdanAutoTest/KdanAuto/ViewController.swift

@@ -85,10 +85,13 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
         
         startBtn.isEnabled = false
         startBtn.title = "Doing"
+        
         DispatchQueue.global().async {
             var report = NSMutableAttributedString.init()
             DataModel.shared.generaNewReportID()
             
+            let testSemaphore = DispatchSemaphore(value: 0)
+            
             // Update For Waiting
             for fileType in testFileTypes {
                 let types = testTypeInfo[fileType] as! NSArray
@@ -115,9 +118,14 @@ class ViewController : NSViewController, SettingViewControllerDelegate, AutoTest
                     DispatchQueue.main.sync {
                         self.reloadListData()
                     }
-                    
                     if nil != testObject {
-                        testObject?.autoTest()
+                        let queue = DispatchQueue.global()
+                        queue.async {
+                            testObject?.autoTest()
+                            
+                            testSemaphore.signal()
+                        }
+                        testSemaphore.wait()
                         
                         if let cReport = testObject?.testReport() {
                             report.append(cReport)