3 ==============================================================================
5 This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
7 The GNSSTk is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published
9 by the Free Software Foundation; either version 3.0 of the License, or
12 The GNSSTk is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with GNSSTk; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
21 This software was developed by Applied Research Laboratories at the
22 University of Texas at Austin.
23 Copyright 2004-2022, The Board of Regents of The University of Texas System
25 ==============================================================================
27 ==============================================================================
29 This software was developed by Applied Research Laboratories at the
30 University of Texas at Austin, under contract to an agency or agencies
31 within the U.S. Department of Defense. The U.S. Government retains all
32 rights to use, duplicate, distribute, disclose, or release this software.
34 Pursuant to DoD Directive 523024
36 DISTRIBUTION STATEMENT A: This software has been approved for public
37 release, distribution is unlimited.
39 ==============================================================================
52 """A function to run unit tests without using the argument parsing of
55 parser = argparse.ArgumentParser(description=
"Test app for ctest")
56 parser.add_argument(
'-v,--verbose', dest=
'verbose', action=
'count',
57 help=
"Increase the amount of output generated by the program")
58 parser.add_argument(
'-o,--output_dir', dest=
'output_dir', metavar=
'dir',
59 help=
"Path to output directory")
60 parser.add_argument(
'-i,--input_dir', dest=
'input_dir', metavar=
'dir',
61 help=
"Path to root of input data directory")
63 args=parser.parse_args()
65 runner=unittest.TextTestRunner()
68 script=os.path.basename(sys.argv[0])
69 dir=os.path.dirname(sys.argv[0])
70 isuite = unittest.TestLoader().discover(dir, pattern=script)
72 rc = runner.run(isuite)
73 sys.exit(len(rc.failures) + len(rc.errors))
78 Compare two lists of elements where the elements are almost equal to each other
80 Uses `assertAlmostEqual` to compare elements between `l1` and `l2`.
81 `l1` and `l2` must be equal in length.
83 test_case.assertEqual(len(l1), len(l2))
84 for l1_i, l2_i
in zip(l1, l2):
85 test_case.assertAlmostEqual(l1_i, l2_i, **kwargs)
90 A kludge since many swigged gnsstk objects are not properly iterable
92 return [s[i]
for i
in range(s.size())]