generate_test_macros Namespace Reference


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

Detailed Description

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 

Function Documentation

def generate_test_macros.main ( )

Definition at line 70 of file

References parse_tests(), and write_macros_to_output().

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


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

Referenced by main().

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

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

Referenced by main().