File: Test.py

package info (click to toggle)
python-libpyvinyl 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,020 kB
  • sloc: python: 3,213; makefile: 11
file content (55 lines) | stat: -rw-r--r-- 2,627 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /usr/bin/env python3
"""
:module Test: Top level test module hosting all unittest suites.
"""

####################################################################################
#                                                                                  #
# This file is part of libpyvinyl - The APIs for Virtual Neutron and x-raY         #
# Laboratory.                                                                      #
#                                                                                  #
# Copyright (C) 2020  Carsten Fortmann-Grote                                       #
#                                                                                  #
# This program is free software: you can redistribute it and/or modify it under   #
# the terms of the GNU Lesser General Public License as published by the Free      #
# Software Foundation, either version 3 of the License, or (at your option) any    #
# later version.                                                                   #
#                                                                                  #
# This program is distributed in the hope that it will be useful, but WITHOUT ANY  #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A  #
# PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details. #
#                                                                                  #
# You should have received a copy of the GNU Lesser General Public License along   #
# with this program.  If not, see <https://www.gnu.org/licenses/                   #
#                                                                                  #
####################################################################################

import unittest
import sys

from test_BaseCalculator import BaseCalculatorTest
from test_Parameters import Test_Parameter, Test_Parameters, Test_Instruments
from test_Instrument import InstrumentTest


def suite():
    suites = [
        unittest.makeSuite(BaseCalculatorTest, "test"),
        unittest.makeSuite(Test_Parameter, "test"),
        unittest.makeSuite(Test_Parameters, "test"),
        unittest.makeSuite(Test_Instruments, "test"),
        unittest.makeSuite(InstrumentTest, "test"),
    ]

    return unittest.TestSuite(suites)


# Run the suite and return a success status code. This enables running an automated git-bisect.
if __name__ == "__main__":
    result = unittest.TextTestRunner(verbosity=2).run(suite())

    if result.wasSuccessful():
        print("---> OK <---")
        sys.exit(0)

    sys.exit(1)