From 73717f89df6ebf3c03f00a70ca2728c04cebe7a0 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Fri, 4 Jul 2014 17:02:06 -0400 Subject: 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 --- test/pacman/pactest.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/pacman/pactest.py b/test/pacman/pactest.py index cba439c3..58c14f6d 100755 --- a/test/pacman/pactest.py +++ b/test/pacman/pactest.py @@ -90,6 +90,10 @@ def create_parser(): tap.bail("cannot locate pacman binary") sys.exit(2) + if args is None or len(args) == 0: + tap.bail("no tests defined, nothing to do") + sys.exit(2) + # instantiate env root_path = tempfile.mkdtemp(prefix='pactest-') env = pmenv.pmenv(root=root_path) @@ -105,11 +109,6 @@ def create_parser(): env.pacman["scriptlet-shell"] = opts.scriptletshell 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: for i in args: env.addtest(i) -- cgit v1.2.3-54-g00ecf