2 # runTests.py -- Portage Unit Test Functionality
3 # Copyright 2006 Gentoo Foundation
4 # Distributed under the terms of the GNU General Public License v2
9 # Insert our parent dir so we can do shiny import "tests"
10 # This line courtesy of Marienz and Pkgcore ;)
11 sys.path.insert(0, osp.dirname(osp.dirname(osp.dirname(osp.abspath(__file__)))))
15 # Ensure that we don't instantiate portage.settings, so that tests should
16 # work the same regardless of global configuration file state/existence.
17 portage._disable_legacy_globals()
19 import portage.tests as tests
20 from portage.const import PORTAGE_BIN_PATH
21 path = os.environ.get("PATH", "").split(":")
22 path = [x for x in path if x]
23 if not path or not os.path.samefile(path[0], PORTAGE_BIN_PATH):
24 path.insert(0, PORTAGE_BIN_PATH)
25 os.environ["PATH"] = ":".join(path)
29 if __name__ == "__main__":
31 if not result.wasSuccessful():