Refactored cmake file once again - exposing root exception.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user