class pyctest.helpers.Conda[source]

Bases: object

Utility class for getting relevant conda environment variables

pyctest.helpers.FindExePath(name, path=None)[source]

Function for finding the path to an executable


Function for safely removing a folder

pyctest.helpers.Cleanup(path=None, extra=[], exclude=[])[source]

This function removes PyCTest files/folders that are copied into or generated in the given path during running PyCTest

  • path (str, optional) – alternative path (default=pyctest.SOURCE_DIRECTORY)
  • extra (list, optional) – any additional files/folders to remove
  • exclude (list, optional) – use this to exclude deleting files/folders

Get the user’s home drive for the operating system


Version info for operating system

class pyctest.helpers.ArgumentParser(project_name, source_dir, binary_dir, vcs_type=None, cleanup_extra=[], cleanup_exclude=[], drop_method='https', drop_site='', drop_location='/submit.php?project=${CTEST_PROJECT_NAME}', drop_site_user=None, drop_site_password=None, use_launchers=False, submit_retry_count=1, submit_retry_delay=30, curl_options=None, cdash_version=None, nightly_start_time='01:00:00 UTC', jobs=1, submit=False, stages=['Start', 'Update', 'Configure', 'Build', 'Test', 'Coverage', 'MemCheck'], trigger='None', site='build-8403268-project-257458-pyctest', ctest_args=['-V'], mode='Stages', checkout_command=None, update_command=None, configure_command=None, build_command=None, coverage_command=None, memcheck_command=None, python_exe='/home/docs/checkouts/', build_type=None, model='Continuous', build_choices=['Release', 'RelWithDebInfo', 'Debug', 'MinSizeRel'], prog=None, usage=None, description="PyCTest argparse. Arguments after first '--' are passed directly to CTest, arguments after second '--' are passed directly to CMake", epilog=None, parents=[], formatter_class=<class 'pyctest.helpers.LineWrapRawTextHelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='resolve', add_help=True)[source]

Bases: argparse.ArgumentParser

Adds common command-line options for PyCTest


Inherit from this class to create custom options

  • project_name (str) – Name of the project
  • source_dir (str) – relative path to the source code
  • binary_dir (str) – relative path to the binary (build) directory
  • mode (str=’Continuous’, optional) – Workflow setting Options: Start, Update, Configure, Build, Test, Coverage, MemCheck, Submit, Stages
  • stages (list=[‘Start’, ‘Update’, ‘Configure’, ‘Build’, ‘Test’, ‘Coverage’, ‘MemCheck’]) – In “Stages” mode, these are the workflow components to execute If a command for the stage is not set, e.g. CTEST_COVERAGE_COMMAND is not set, then the stage is skipped
  • trigger (str=’None’, optional) – Deprecated, has no effect
  • model (str=’Continuous’, optional) – Submission track. Common choices: Continuous, Nightly, Experimental
  • site (str = platform.node(), optional) – The ID of the submission site
  • jobs (int = 1, optional) – Number of tests to execute in parallel
  • submit (bool, optional) – Enable/disable submission by default
  • vcs_type (str, optional) – Version control type: bzr, cvs, git, hg, p4, svn
  • checkout_command (str, optional) – Define the default checkout command
  • update_command (str, optional) – Define the default update command
  • configure_command (str, optional) – Define the default configure command
  • build_command (str, optional) – Define the default configure command
  • coverage_command (str, optional) – Define the default coverage command
  • memcheck_command (str, optional) – Define the default memory check command
  • build_choices (str, optional) – If running CMake, define the build type [Release, RelWithDebInfo, Debug, MinSizeRel]
  • use_launchers (bool, optional) – For build trees generated by CMake using one of the Makefile Generators or the Ninja generator, specify whether the CTEST_USE_LAUNCHERS feature is enabled by the CTestUseLaunchers module (also included by the CTest module). When enabled, the generated build system wraps each invocation of the compiler, linker, or custom command line with a “launcher” that communicates with CTest via environment variables and files to report granular build warning and error information. Otherwise, CTest must “scrape” the build output log for diagnostics.
  • cleanup_extra (list, optional) – When –pyctest-cleanup or –pyctest-clean-first is invoked, these additional files/folders will be removed
  • cleanup_exclude (list, optional) – When –pyctest-cleanup or –pyctest-clean-first is invoked, these additional files/folders will be excluded from removal
  • cdash_version (str=None, optional) – Specify the version of CDash on the server
  • submit_retry_count (int=1, optional) – Specify a number of attempts to retry submission on network failure
  • submit_retry_delay (int=30, optional) – Specify a delay before retrying submission on network failure
  • curl_options (list=None, optional) – Curl options: ‘CURLOPT_SSL_VERIFYPEER_OFF’ and ‘CURLOPT_SSL_VERIFYHOST_OFF’
  • drop_location (str=”/submit.php?project={}”.format(project_name), optional) – The path on the dashboard server to send the submission
  • drop_method (str=”https”, optional) – Specify the method by which results should be submitted to the dashboard server. The value may be cp, ftp, http, https, scp, or xmlrpc (if CMake was built with support for it)
  • drop_site (str=””, optional) – The dashboard server name (for ftp, http, and https, scp, and xmlrpc)
  • drop_site_password (str=None, optional) – The dashboard server login password, if any (for ftp, http, and https).
  • drop_site_user (str=None, optional) – The dashboard server login user name, if any (for ftp, http, and https).
  • nightly_start_time (str=”01:00:00 UTC”, optional) – In the Nightly dashboard mode, specify the “nightly start time”. With centralized version control systems (cvs and svn), the Update step checks out the version of the software as of this time so that multiple clients choose a common version to test. This is not well-defined in distributed version-control systems so the setting is ignored.
parse_args(*args, **kwargs)[source]

Parse the arguments


Arguments following first double-dash (“–”) are passed directly to ctest


Arguments following second double-dash (“–”) are passed directly to cmake


Process PyCTest args