From 013043b18c9ee63a70abbbee8022c76fec17dcc5 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Fri, 27 Jan 2017 22:39:53 -0800 Subject: [PATCH] Refactored cmake file once again - exposing root exception. --- src/Mod/Path/CMakeLists.txt | 12 ++++++++++-- src/Mod/Test/TestApp.py | 34 +++++++++++++++++----------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/Mod/Path/CMakeLists.txt b/src/Mod/Path/CMakeLists.txt index d2fda31d15..42b9dd98fb 100644 --- a/src/Mod/Path/CMakeLists.txt +++ b/src/Mod/Path/CMakeLists.txt @@ -97,20 +97,28 @@ SET(PathTests_SRCS PathTests/TestPathPost.py PathTests/__init__.py PathTests/test_linuxcnc_00.ngc - TestPathApp.py ) SET(all_files ${PathScripts_SRCS} ${PathScripts_NC_SRCS} - ${PathTests_SRCS} ) ADD_CUSTOM_TARGET(PathScripts ALL SOURCES ${all_files} ) +SET(test_files + TestPathApp.py + ${PathTests_SRCS} +) + +ADD_CUSTOM_TARGET(PathTests ALL + SOURCES ${test_files} +) + fc_copy_sources(PathScripts "${CMAKE_BINARY_DIR}/Mod/Path" ${all_files}) +fc_copy_sources(PathTests "${CMAKE_BINARY_DIR}/Mod/Path" ${test_files}) INSTALL( FILES diff --git a/src/Mod/Test/TestApp.py b/src/Mod/Test/TestApp.py index e4b5c8d440..e3dc7440d9 100644 --- a/src/Mod/Test/TestApp.py +++ b/src/Mod/Test/TestApp.py @@ -34,24 +34,24 @@ import unittest def tryLoadingTest(testName): "Loads and returns testName, or a failing TestCase if unsuccessful." - try: - return unittest.defaultTestLoader.loadTestsFromName(testName) +# try: + return unittest.defaultTestLoader.loadTestsFromName(testName) - except ImportError: - class LoadFailed(unittest.TestCase): - def __init__(self, testName): - # setattr() first, because TestCase ctor checks for methodName. - setattr(self, "failed_to_load_" + testName, self._runTest) - super(LoadFailed, self).__init__("failed_to_load_" + testName) - self.testName = testName - - def __name__(self): - return "Loading " + self.testName - - def _runTest(self): - self.fail("Couldn't load " + self.testName) - - return LoadFailed(testName) +# except ImportError: +# class LoadFailed(unittest.TestCase): +# def __init__(self, testName): +# # setattr() first, because TestCase ctor checks for methodName. +# setattr(self, "failed_to_load_" + testName, self._runTest) +# super(LoadFailed, self).__init__("failed_to_load_" + testName) +# self.testName = testName +# +# def __name__(self): +# return "Loading " + self.testName +# +# def _runTest(self): +# self.fail("Couldn't load " + self.testName) +# +# return LoadFailed(testName) def All(): # Base system tests