env.py: TestEnv: Allow sharing target attribute
When LISA_TARGET_SINGLETON env var is defined to 1, TestEnv will only build the target once and will then reuse the same target in all following TestEnv instances. This works around the fact that nosetest does not allow passing arbitrary data down to test cases. TestEnv instances have to horizontally cooperate instead to avoid this reinitialization. Move TestEnv._installed_tools, TestEnv._calib and TestEnv.nrg_model to a storage dict attached to the target itself. That makes sure these values will stick to their target while limiting to the absolute minimum the number of TestEnv attributes directly shared. Having it as a dictionary instead of inheriting from devlib.Target makes it easier to pinpoint such shared data. TestEnv.nrg_model is still exposed as a TestEnv attribute but is initialized using that target storage dict.
Loading
Please register or sign in to comment