1#!/usr/bin/env python3 2 3# Execute this script any time you import a new copy of Clara into the third_party area 4import os 5import sys 6import embed 7 8rootPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0]))) 9 10filename = os.path.join( rootPath, "third_party", "clara.hpp" ) 11outfilename = os.path.join( rootPath, "include", "external", "clara.hpp" ) 12 13 14# Mapping of pre-processor identifiers 15idMap = { 16 "CLARA_HPP_INCLUDED": "CATCH_CLARA_HPP_INCLUDED", 17 "CLARA_CONFIG_CONSOLE_WIDTH": "CATCH_CLARA_CONFIG_CONSOLE_WIDTH", 18 "CLARA_TEXTFLOW_HPP_INCLUDED": "CATCH_CLARA_TEXTFLOW_HPP_INCLUDED", 19 "CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH": "CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH", 20 "CLARA_PLATFORM_WINDOWS": "CATCH_PLATFORM_WINDOWS" 21 } 22 23# outer namespace to add 24outerNamespace = { "clara": ("Catch", "clara") } 25 26mapper = embed.LineMapper( idMap, outerNamespace ) 27mapper.mapFile( filename, outfilename )