CYCAMORE
Functions
generate_test_macros Namespace Reference

Functions

def main ()
 
def parse_tests (test_lines)
 
def write_macros_to_output (tests, executable, reg_dir, output=None)
 

Detailed Description

generate_test_macros.py

A simple module and default main execution to generate a listing of 
ADD_TEST CMake macros for all non-disabled tests in a 
google-test-based executable.

The default main function writes a list of macros to the given output 
file. 

Function Documentation

◆ main()

def generate_test_macros.main ( )

Definition at line 70 of file generate_test_macros.py.

References parse_tests(), and write_macros_to_output().

Here is the call graph for this function:

◆ parse_tests()

def generate_test_macros.parse_tests (   test_lines)
Return a list of google test names.

Arguments: 

test_lines -- a list of the output of a google test exectuable 
using the --gtest_list_tests flag. If the output is in a file, 
test_lines are the result of file.readlines().

Definition at line 21 of file generate_test_macros.py.

Referenced by main().

◆ write_macros_to_output()

def generate_test_macros.write_macros_to_output (   tests,
  executable,
  reg_dir,
  output = None 
)
writes a list of test names as ADD_TEST cmake macros to an 
output file

Arguments
tests -- a list of all test names to be added as ADD_TEST macros 
to the output file
exectuable -- the name of the test executable
output -- the output file to write to, if output is not 
specified, the list of ADD_TEST macros will be written to stdout

Definition at line 42 of file generate_test_macros.py.

Referenced by main().