Debian Codegraph @

cmake/tribits/ctest_driver/dump-cdash-deps-xml-file.py

raw
1 #!/usr/bin/env python3
2
3 # @HEADER
4 # *****************************************************************************
5 # TriBITS: Tribal Build, Integrate, and Test System
6 #
7 # Copyright 2013-2016 NTESS and the TriBITS contributors.
8 # SPDX-License-Identifier: BSD-3-Clause
9 # *****************************************************************************
10 # @HEADER
11
12
13 #
14 # Read in the commandline arguments
15 #
16
17 usageHelp = r"""dump-package-deps-table.py [OPTIONS]
18
19 Tool that dumps an XML file that can be read by CTest/CDash to specify the
20 TriBITS project packages in a way that is independent of TriBITS. In
21 CTest/CDash terminology, a TriBITS package is a "Subproject".
22
23 By default, if you just run:
24
25 $ <thisDir>/dump-cdash-deps-xml-file.py \
26 --input-xml-deps-file=<Project>PackageDependencies.xml \
27 --output-cdash-deps-xml-file=CDashSubprojectDependencies.xml
28
29 then the XML file CDashSubprojectDependencies.xml will get written.
30
31 You can also change what XML input file is used and what XML file is written.
32 This is mainly to facilitate unit testing of this script.
33
34 NOTE: Currently this script is gutted to only list out the parent packages
35 (subprojects) and their regression email addresses. It does not currently
36 list any dependent packages. Currently CDash does not do anything very useful
37 with that information anyway and actually makes it really hard to see the
38 actually subproject-specific test results if there are a lot of upstream
39 packages (because it lists summaries of all of the dependent packages above it
40 first).
41
42 """
43
44 from optparse import OptionParser
45
46 clp = OptionParser(usage=usageHelp)
47
48 clp.add_option(
49 "--input-xml-deps-file", dest="inputXmlDepsFile", type="string",
50 help="Input XML file giving the TriBITS Project Package dependencies.")
51
52 clp.add_option(
53 "--output-cdash-deps-xml-file", dest="outputCDashDepsXmlFile", type="string",
54 help="Output XML file giving the TriBITS project dependencies in XML form" \
55 + " that CDash understands.")
56
57 (options, args) = clp.parse_args()
58
59
60 #
61 # Execute the commands
62 #
63
64 import os
65 import sys
66
67 ciSupportDir = os.path.join(
68 os.path.dirname(os.path.abspath(__file__)),
69 "..", "ci_support" )
70 sys.path = [ciSupportDir] + sys.path
71
72 from TribitsDependencies import getProjectDependenciesFromXmlFile
73
74 tribitsDependencies = getProjectDependenciesFromXmlFile(
75 options.inputXmlDepsFile)
76
77 tribitsDependencies.writeCDashXmlDepsFile(
78 options.outputCDashDepsXmlFile)