Isn't ```dependency injection``` (aka passing arguments) the big thing that's supposed to solve this?
Config config;
// production
config_from_file(&config, "config.json");
run_production_stuff(&config);
// unit tests
Config config;
config_from_memory(&config, &some_test_values);
run_tests(&config);