-
Notifications
You must be signed in to change notification settings - Fork 0
/
reggie.py
61 lines (53 loc) · 4.22 KB
/
reggie.py
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
56
57
58
59
60
61
#==================================================================================================================================
# Copyright (c) 2017 - 2018 Stephen Copplestone and Matthias Sonntag
#
# This file is part of reggie2.0 (gitlab.com/reggie2.0/reggie2.0). reggie2.0 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# reggie2.0 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 General Public License v3.0 for more details.
#
# You should have received a copy of the GNU General Public License along with reggie2.0. If not, see <http://www.gnu.org/licenses/>.
#==================================================================================================================================
from timeit import default_timer as timer
import logging
import tools
import check
import args_parser
import summary
"""
General workflow:
1. get the command line arguments 'args' and all valid build combinations in the check directory from 'builds.ini'
2. set the logger 'log' with the debug level from 'args' to determine the level of logging which displays output to the user
3. perform the regression check by a) building executables
b) running the code
c) performing the defined analyzes
4. display the summary table with information for each build, run and analysis step
5. display if regression check was successful or not and return the corresponding error code
"""
print('')
print(tools.red(' oooooooo ====================')+tools.yellow('=====================================')+tools.green('==================== oooooooo '))
print(tools.red(' ooo oo ooo _____ ______ ')+tools.yellow(' _____ _____ _____ ______ ')+tools.green(' ___ ___ ooo oo ooo '))
print(tools.red(' oo oo oo | __ \ | ____| ')+tools.yellow(' / ____| / ____| |_ _| | ____| ')+tools.green('|__ \ / _ \ oo oo oo '))
print(tools.red(' oo oo oo | |__) | | |__ ')+tools.yellow('| | __ | | __ | | | |__ ')+tools.green(' ) | | | | | oo oo oo '))
print(tools.red(' oo oooo oo | _ / | __| ')+tools.yellow('| | |_ | | | |_ | | | | __| ')+tools.green(' / / | | | | oo oooo oo '))
print(tools.red(' oo oooooo oo | | \ \ | |____ ')+tools.yellow('| |__| | | |__| | _| |_ | |____ ')+tools.green(' / /_ _ | |_| | oo oooooo oo '))
print(tools.red(' oo oo oo oo oo |_| \_\ |______| ')+tools.yellow(' \_____| \_____| |_____| |______| ')+tools.green('|____| (_) \___/ oo oo oo oo oo '))
print(tools.red(' ooo oo ooo ')+tools.yellow(' ')+tools.green(' ooo oo ooo '))
print(tools.red(' oooooooo ====================')+tools.yellow('=====================================')+tools.green('==================== oooooooo '))
print('')
start = timer()
# 1. get the command line arguments 'args' and all valid build combinations in the check directory from 'builds.ini'
args, builds = args_parser.getArgsAndBuilds()
# 2. set the logger 'log' with the debug level from 'args' to determine the level of logging which displays output to the user
tools.setup_logger(args.debug)
log = logging.getLogger('logger')
# 3. perform the regression check by a) building executables
# b) running the code
# c) performing the defined analyzes
check.PerformCheck(start,builds,args,log)
# 4. display the summary table with information for each build, run and analysis step
summary.SummaryOfErrors(builds, args)
# 5. display if regression check was successful or not and return the corresponding error code
summary.finalize(start, 0, check.Run.total_errors, check.ExternalRun.total_errors, check.Analyze.total_errors, check.Analyze.total_infos)