-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild_ut.py
executable file
·61 lines (52 loc) · 2.89 KB
/
build_ut.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
#!/usr/bin/env python3
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2022 Sky UK
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Entry script for running rialto unittests
import argparse
from scripts.gtest.build_and_run_tests import getGenericArguments, buildAndRunGTests
from scripts.gtest.utils import getSuitesToRun, getOutputFile
from scripts.gtest.generate_coverage import generateCoverageReport
# Rialto Component Tests & Paths
# {Component Name : {Test Suite, Test Path}}
suiteInfo = {
"servermain" : {"suite" : "RialtoServerMainUnitTests", "path" : "/tests/unittests/media/server/main/"},
"servergstplayer" : {"suite" : "RialtoServerGstPlayerUnitTests", "path" : "/tests/unittests/media/server/gstplayer/"},
"serveripc" : {"suite" : "RialtoServerIpcUnitTests", "path" : "/tests/unittests/media/server/ipc/"},
"serverservice" : {"suite" : "RialtoServerServiceUnitTests", "path" : "/tests/unittests/media/server/service/"},
"client" : {"suite" : "RialtoClientUnitTests", "path" : "/tests/unittests/media/client/main/"},
"clientipc" : {"suite" : "RialtoClientIpcUnitTests", "path" : "/tests/unittests/media/client/ipc/"},
"playercommon" : {"suite" : "RialtoPlayerCommonUnitTests", "path" : "/tests/unittests/media/common/"},
"common" : {"suite" : "RialtoCommonUnitTests", "path" : "/tests/unittests/common/unittests/"},
"logging" : {"suite" : "RialtoLoggingUnitTests", "path" : "/tests/unittests/logging/"},
"manager" : {"suite" : "RialtoServerManagerUnitTests", "path" : "/tests/unittests/serverManager/"},
"ipc" : {"suite" : "RialtoIpcUnitTests", "path" : "/tests/unittests/ipc/"},
}
if __name__ == "__main__":
# Parse arguments
argParser = argparse.ArgumentParser(description='Run the rialto Unittests.', formatter_class=argparse.RawTextHelpFormatter)
getGenericArguments(argParser, suiteInfo)
args = vars(argParser.parse_args())
# Get suites
suitesToRun = getSuitesToRun(args['suites'], suiteInfo)
# Get output file
outputFile = getOutputFile(args['file'], args['clean'])
# Build and run tests
buildDefines = ["-DCMAKE_BUILD_FLAG=UnitTests", "-DRIALTO_ENABLE_CONFIG_FILE=1", "-DRIALTO_BUILD_TYPE=Debug"]
buildAndRunGTests(args, outputFile, buildDefines, suitesToRun)
if args['coverage'] == True:
generateCoverageReport(args['output'], outputFile, suitesToRun)