diff options
Diffstat (limited to 'Programs/_testembed.c')
-rw-r--r-- | Programs/_testembed.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 9923f8d..70bf960 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -437,7 +437,7 @@ static int test_init_from_config(void) config.hash_seed = 123; putenv("PYTHONMALLOC=malloc"); - config.allocator = "malloc_debug"; + config.preconfig.allocator = "malloc_debug"; /* dev_mode=1 is tested in test_init_dev_mode() */ @@ -577,7 +577,6 @@ static void test_init_env_putenvs(void) putenv("PYTHONPYCACHEPREFIX=env_pycache_prefix"); putenv("PYTHONNOUSERSITE=1"); putenv("PYTHONFAULTHANDLER=1"); - putenv("PYTHONDEVMODE=1"); putenv("PYTHONIOENCODING=iso8859-1:replace"); /* FIXME: test PYTHONWARNINGS */ /* FIXME: test PYTHONEXECUTABLE */ @@ -589,6 +588,15 @@ static void test_init_env_putenvs(void) } +static void test_init_env_dev_mode_putenvs(void) +{ + test_init_env_putenvs(); + putenv("PYTHONMALLOC=malloc"); + putenv("PYTHONFAULTHANDLER="); + putenv("PYTHONDEVMODE=1"); +} + + static int test_init_env(void) { /* Test initialization from environment variables */ @@ -601,6 +609,18 @@ static int test_init_env(void) } +static int test_init_env_dev_mode(void) +{ + /* Test initialization from environment variables */ + Py_IgnoreEnvironmentFlag = 0; + test_init_env_dev_mode_putenvs(); + _testembed_Py_Initialize(); + dump_config(); + Py_Finalize(); + return 0; +} + + static int test_init_isolated(void) { /* Test _PyCoreConfig.isolated=1 */ @@ -615,7 +635,7 @@ static int test_init_isolated(void) /* Use path starting with "./" avoids a search along the PATH */ config.program_name = L"./_testembed"; - test_init_env_putenvs(); + test_init_env_dev_mode_putenvs(); _PyInitError err = _Py_InitializeFromConfig(&config); if (_Py_INIT_FAILED(err)) { _Py_ExitInitError(err); @@ -631,7 +651,7 @@ static int test_init_dev_mode(void) _PyCoreConfig config = _PyCoreConfig_INIT; putenv("PYTHONFAULTHANDLER="); putenv("PYTHONMALLOC="); - config.dev_mode = 1; + config.preconfig.dev_mode = 1; config.program_name = L"./_testembed"; _PyInitError err = _Py_InitializeFromConfig(&config); if (_Py_INIT_FAILED(err)) { @@ -673,6 +693,7 @@ static struct TestCase TestCases[] = { { "init_global_config", test_init_global_config }, { "init_from_config", test_init_from_config }, { "init_env", test_init_env }, + { "init_env_dev_mode", test_init_env_dev_mode }, { "init_dev_mode", test_init_dev_mode }, { "init_isolated", test_init_isolated }, { NULL, NULL } |