COMMAND ${PYTHON_EXECUTABLE} ${aTestFileName})
if (WIN32) # different path to libraries variable name
SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
- ENVIRONMENT "PATH=${_JUSTPATH};PYTHONPATH=${_PYTHONPATH}"
+ ENVIRONMENT "PATH=${_JUSTPATH};PYTHONPATH=${_PYTHONPATH};SHAPER_UNIT_TEST_IN_PROGRESS=1"
LABELS "${aSubprojectName}")
else()
SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
- ENVIRONMENT "LD_LIBRARY_PATH=${_LD_LIBRARY_PATH};PYTHONPATH=${_PYTHONPATH}"
+ ENVIRONMENT "LD_LIBRARY_PATH=${_LD_LIBRARY_PATH};PYTHONPATH=${_PYTHONPATH};SHAPER_UNIT_TEST_IN_PROGRESS=1"
LABELS "${aSubprojectName}")
endif()
# Debug output...
COMMAND ${PYTHON_EXECUTABLE} ${aTestFileName})
if (WIN32) # different path to libraries variable name
SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
- ENVIRONMENT "PATH=${_JUSTPATH};PYTHONPATH=${_PYTHONPATH}"
+ ENVIRONMENT "PATH=${_JUSTPATH};PYTHONPATH=${_PYTHONPATH};SHAPER_UNIT_TEST_IN_PROGRESS=1"
LABELS "${aSubprojectName}")
else()
SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
- ENVIRONMENT "LD_LIBRARY_PATH=${_LD_LIBRARY_PATH};PYTHONPATH=${_PYTHONPATH}"
+ ENVIRONMENT "LD_LIBRARY_PATH=${_LD_LIBRARY_PATH};PYTHONPATH=${_PYTHONPATH};SHAPER_UNIT_TEST_IN_PROGRESS=1"
LABELS "${aSubprojectName}")
endif()
# Debug output...
InitializationPlugin_Plugin::InitializationPlugin_Plugin()
{
+ char* isUnitTest = getenv("SHAPER_UNIT_TEST_IN_PROGRESS");
+ myInitDataModel = (!isUnitTest || isUnitTest[0] != '1');
+
Events_Loop* aLoop = Events_Loop::loop();
const Events_ID kDocCreatedEvent = ModelAPI_DocumentCreatedMessage::eventId();
aLoop->registerListener(this, kDocCreatedEvent, NULL, true);
if (aDoc != ModelAPI_Session::get()->moduleDocument())
return;
- myEvalListener->initDataModel();
+ if (myInitDataModel)
+ myEvalListener->initDataModel();
std::list<FeaturePtr> aFeatures;