mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-03 18:27:59 -05:00
fix(test): keep embedded Python alive across slic3rutils cases (#16732)
* fix(test): keep embedded Python alive across slic3rutils cases * fix: clang-tidy
This commit is contained in:
1 parent
59e96b71d0
commit
4441bcc065
10 files changed
+96
-64
No files matched your search
@@ -26,7 +26,9 @@ using namespace Slic3r;
|
||||
namespace {
|
||||
|
||||
// Same idiom as ScopedPluginManager in test_plugin_lifecycle.cpp: the trampolines refuse to call
|
||||
// into Python unless PythonInterpreter::instance() reports initialized.
|
||||
// into Python unless PythonInterpreter::instance() reports initialized. Only the manager is torn
|
||||
// down here; the interpreter is finalized once per test process by PythonInterpreterRunEnd in
|
||||
// slic3rutils_tests_main.cpp.
|
||||
struct ScopedPluginManager
|
||||
{
|
||||
// Before initialize(): the interpreter creates {data_dir}/python/packages and {data_dir}/log,
|
||||
@@ -34,11 +36,7 @@ struct ScopedPluginManager
|
||||
ScopedDataDir python_data_dir{"plugin-python"};
|
||||
bool initialized = PluginManager::instance().initialize();
|
||||
|
||||
~ScopedPluginManager()
|
||||
{
|
||||
PluginManager::instance().shutdown();
|
||||
PythonInterpreter::instance().shutdown();
|
||||
}
|
||||
~ScopedPluginManager() { PluginManager::instance().shutdown(); }
|
||||
};
|
||||
|
||||
// The host reaches a printer agent plugin through IPrinterAgent, so the tests do too. The Python
|
||||
|
||||
Reference in new issue
Block a user