1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

pactest: check for tests before environment setup

Setting up the temporary directory and environment is pointless if there
are no tests to run.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
This commit is contained in:
Andrew Gregory 2014-07-04 17:02:06 -04:00 committed by Allan McRae
parent 6650c43fca
commit 73717f89df

View File

@ -90,6 +90,10 @@ if __name__ == "__main__":
tap.bail("cannot locate pacman binary") tap.bail("cannot locate pacman binary")
sys.exit(2) sys.exit(2)
if args is None or len(args) == 0:
tap.bail("no tests defined, nothing to do")
sys.exit(2)
# instantiate env # instantiate env
root_path = tempfile.mkdtemp(prefix='pactest-') root_path = tempfile.mkdtemp(prefix='pactest-')
env = pmenv.pmenv(root=root_path) env = pmenv.pmenv(root=root_path)
@ -105,11 +109,6 @@ if __name__ == "__main__":
env.pacman["scriptlet-shell"] = opts.scriptletshell env.pacman["scriptlet-shell"] = opts.scriptletshell
env.pacman["ldconfig"] = opts.ldconfig env.pacman["ldconfig"] = opts.ldconfig
if args is None or len(args) == 0:
tap.bail("no tests defined, nothing to do")
os.rmdir(root_path)
sys.exit(2)
try: try:
for i in args: for i in args:
env.addtest(i) env.addtest(i)