Currently the script works on the poky/oe-core clone environment, this could cause problem when this environment is pre-modified for example when layers are added or configuration changes. To avoid a this kind of problems the script needs to setup an environment, clone bitbake/oe-core and source the new environment to work on it.
When making such changes, try to keep in mind that developers probably will have to analyze test failures. Having some option of easily changing into the exact environment in which something failed would be useful.
I created a wrapper to clone bitbake and oe-core for make script runs, http://lists.openembedded.org/pipermail/openembedded-core/2017-March/134884.html
Merge at, http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=704613b2ec5d61eeeaa96b4cfdf7d2475ffa48ec