PyXMake Developer Guide: src/PyXMake/VTL/coverage.py Source File

| PyXMake Developer Guide 1.0 PyXMake

Loading...
Searching...
No Matches
coverage.py
1# -*- coding: utf-8 -*-
2# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3# % PyXMake - Build environment for PyXMake %
4# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5"""
6Triple-use minimum working example for PyXMake. This script can be
7executed in three different ways in varying levels of accessibility
8
9@note: Run coverage inherited from pytest-cov with more meaningful default settings
10derived from Robot.
11
12Created on 31.01.2023
13
14@version: 1.0
15----------------------------------------------------------------------------------------------
16@requires:
17 - PyXMake
18
19@change:
20 -
21
22@author: garb_ma [DLR-FA,STM Braunschweig]
23----------------------------------------------------------------------------------------------
24"""
25import os, sys
26
27try:
28 import PyXMake as _ #@UnusedImport
29except ImportError:
30 # Script is executed as a plug-in
31 sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
32finally:
33 from PyXMake.Build.Make import Robot #@UnresolvedImport
34 from PyXMake import PyXMakePath #@UnresolvedImport
35
36 def main(
37 BuildID,
38 # Resource paths
39 source = PyXMakePath,
40 include = [
41 os.path.join(PyXMakePath,"VTL","examples",'pyx_api.py'),
42 os.path.join(PyXMakePath,"VTL","examples",'pyx_cxx.py'),
43 os.path.join(PyXMakePath,"VTL","examples",'pyx_py2x.py'),
44 os.path.join(PyXMakePath,"VTL","examples",'pyx_gfortran.py'),
45 os.path.join(PyXMakePath,"VTL","examples",'pyx_pyreq.py'),
46 os.path.join(PyXMakePath,"VTL","examples",'pyx_doxygen.py'),
47 os.path.join(PyXMakePath,"VTL","examples",'pyx_openapi.py')
48 ],
49 # Default output directory
50 output=os.getcwd(),
51 # Additional keyword arguments
52 **kwargs):
53 """
54 Main function to execute the script.
55 """
56 # Default command. Use settings to modify the documentation.
57 Coverage = Robot(BuildID, source);
58 Coverage.OutputPath(output);
59 if include: Coverage.AddIncludePath(include);
60 Coverage.create(**kwargs) ;
61
62if __name__ == "__main__":
63# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64# % Access command line inputs %
65# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66 # Execute CLI command
67 Robot.run()
68 # Finish
69 print("==================================")
70 print("Finished running test coverage")
71 print("==================================")
72 sys.exit()
PyXMake.Build.Make
Create a make object to define the building environment.
Definition Make.py:1
PyXMake.VTL.coverage.main
main(BuildID, source=PyXMakePath, include=[os.path.join(PyXMakePath,"VTL","examples", 'pyx_api.py'), os.path.join(PyXMakePath,"VTL","examples", 'pyx_cxx.py'), os.path.join(PyXMakePath,"VTL","examples", 'pyx_py2x.py'), os.path.join(PyXMakePath,"VTL","examples", 'pyx_gfortran.py'), os.path.join(PyXMakePath,"VTL","examples", 'pyx_pyreq.py'), os.path.join(PyXMakePath,"VTL","examples", 'pyx_doxygen.py'), os.path.join(PyXMakePath,"VTL","examples", 'pyx_openapi.py')], output=os.getcwd(), **kwargs)
Definition coverage.py:52