File: embedClara.py

package info (click to toggle)
log4cplus 2.0.5-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 10,560 kB
  • sloc: cpp: 46,669; sh: 10,310; ansic: 1,845; python: 1,114; perl: 258; makefile: 214; xml: 85; objc: 59
file content (27 lines) | stat: -rwxr-xr-x 923 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python

# Execute this script any time you import a new copy of Clara into the third_party area
import os
import sys
import embed

rootPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0])))

filename = os.path.join( rootPath, "third_party", "clara.hpp" )
outfilename = os.path.join( rootPath, "include", "external", "clara.hpp" )


# Mapping of pre-processor identifiers
idMap = {
   "CLARA_HPP_INCLUDED": "CATCH_CLARA_HPP_INCLUDED",
    "CLARA_CONFIG_CONSOLE_WIDTH": "CATCH_CLARA_CONFIG_CONSOLE_WIDTH",
    "CLARA_TEXTFLOW_HPP_INCLUDED": "CATCH_CLARA_TEXTFLOW_HPP_INCLUDED",
    "CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH": "CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH",
    "CLARA_PLATFORM_WINDOWS": "CATCH_PLATFORM_WINDOWS"
    }

# outer namespace to add
outerNamespace = { "clara": ("Catch", "clara") }

mapper = embed.LineMapper( idMap, outerNamespace )
mapper.mapFile( filename, outfilename )