From 5b9c600ae96e63f1f7a7f9487512c3c9d8a356e7 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 5 Oct 2015 21:43:17 +0200 Subject: Tests can now target system-wide or global MAT $ python test.py --local/--system --- test/test.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/test.py') diff --git a/test/test.py b/test/test.py index 40cbf0c..e45912e 100644 --- a/test/test.py +++ b/test/test.py @@ -15,6 +15,8 @@ import sys import tempfile import unittest +IS_LOCAL = True + VERBOSITY = 15 clean = glob.glob('clean*') @@ -72,6 +74,22 @@ class MATTest(unittest.TestCase): if __name__ == '__main__': import clitest import libtest + import argparse + + parser = argparse.ArgumentParser(description='MAT testsuite') + parser.add_argument('-l', '--local', action='store_true', + help='Test the local version of mat') + parser.add_argument('-s', '--system', action='store_true', + help='Test the system-wide version of mat') + + if parser.parse_args().local is True: + IS_LOCAL = True + elif parser.parse_args().system is True: + IS_LOCAL = False + else: + print('Please specify either --local or --system') + sys.exit(1) + SUITE = unittest.TestSuite() SUITE.addTests(clitest.get_tests()) -- cgit v1.3