Source code for pyctest

#!/home/docs/checkouts/readthedocs.org/user_builds/pyctest/conda/latest/bin/python
# MIT License
#
# Copyright (c) 2018, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S. Dept. of Energy).  All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

'''
PyCTest is an extension that directly hooks into the CMake/CTest libraries.
Instead of generating CMake/CTest files, it use the library itself. Since
the CMake version is directly controlled as a git submodule, there are no
external compatibility issues.
'''

from __future__ import absolute_import

import os
import sys
import imp
import ctypes
import platform
import warnings

__author__ = "Jonathan Madsen"
__copyright__ = "Copyright 2018, The Regents of the University of California"
__credits__ = ["Jonathan Madsen"]
__license__ = "MIT"
__version__ = "0.0.12"
__maintainer__ = "Jonathan Madsen"
__email__ = "jonrobm.programming@gmail.com"
__status__ = "Development"
__all__ = ['pyctest', 'pycmake', 'helpers',
           'ctest',   'cmake',   'cpack',
           'version_info', 'build_info', 'version',
           'cmake_executable', 'ctest_executable', 'cpack_executable']
__dir__ = os.path.realpath(os.path.dirname(__file__))


from . import pyctest
from . import pycmake
from . import ctest
from . import cmake
from . import cpack
from . import helpers


#-----------------------------------------------------------------------------#
# versioning
#
sys.modules[__name__].__setattr__("version_info",
                                  (0,
                                   0,
                                   12) )
sys.modules[__name__].__setattr__("version", "0.0.12" )
sys.modules[__name__].__setattr__(
    "build_info",
    { "date" : "Fri Dec 28 20:09:42 2018 UTC",
      "library_architecture" : "x86_64",
      "system_name" : "Linux",
      "system_version" : "4.4.0-96-generic",
      "build_type" : "MinSizeRel",
      "compiler" : "/home/conda/feedstock_root/build_artifacts/pyctest_1546027739524/_build_env/bin/x86_64-conda_cos6-linux-gnu-c++",
      "compiler_id" : "GNU",
      "compiler_version" : "7.3.0"
    } )

version_info = sys.modules[__name__].__getattribute__("version_info")
'''List of version fields'''

build_info = sys.modules[__name__].__getattribute__("build_info")
'''Build information'''

version = sys.modules[__name__].__getattribute__("version")
'''Version string'''


#-----------------------------------------------------------------------------#
# executables
#
cmake_executable = os.path.join(__dir__, "bin", "cmake")
'''Path to CMake executable'''

ctest_executable = os.path.join(__dir__, "bin", "ctest")
'''Path to CTest executable'''

cpack_executable = os.path.join(__dir__, "bin", "cpack")
'''Path to CPack executable'''


#-----------------------------------------------------------------------------#
# display function
#
banner = '''
#############################################
#  ____  _  _  ___  ____  ____  ____  ____  #
# (  _ \( \/ )/ __)(_  _)(  __)/ ___)(_  _) #
#  ) __/ )  /( (__   )(   ) _) \___ \  )(   #
# (__)  (__/  \___) (__) (____)(____/ (__)  #
#                                           #
#############################################
'''



if os.environ.get("PYCTEST_NO_DISPLAY") is None:
    print_display()