Changeset 2405


Ignore:
Timestamp:
Jan 1, 2009 12:11:17 AM (15 years ago)
Author:
bennylp
Message:

Added Symbian test configurator

Location:
pjproject/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/build.symbian/00.bat

    r1405 r2405  
    44@rem set EPOCROOT=\Symbian\UIQ3SDK\ 
    55@rem set EPOCROOT=\symbian\UIQ3.1\ 
     6@rem set EPOCROOT=\symbian\9.2\S60_3rd_FP1\ 
    67bldmake bldfiles 
  • pjproject/trunk/tests/cdash/builder.py

    r2404 r2405  
    336336class MSVCTestBuilder(TestBuilder): 
    337337    """\ 
    338     This class creates list of tests suitable for Visual Studio builds. 
    339  
     338    This class creates list of tests suitable for Visual Studio builds.  
     339    You need to set the MSVC environment variables (typically by calling 
     340    vcvars32.bat) prior to running this class. 
     341     
    340342    """ 
    341     def __init__(self, config, vs_config="Release|Win32", build_config_name="",  
     343    def __init__(self, config, target="Release|Win32", build_config_name="",  
    342344                 config_site="", exclude=[], not_exclude=[]): 
    343345        """\ 
    344346        Parameters: 
    345347        config              - BaseConfig instance 
    346         vs_config           - Visual Studio build configuration to build. 
     348        target              - Visual Studio build configuration to build. 
    347349                              Sample: "Debug|Win32", "Release|Win32". 
    348350        build_config_name   - Optional name to be added as suffix to the build 
     
    359361                             config_site=config_site, exclude=exclude,  
    360362                             not_exclude=not_exclude) 
    361         self.vs_config = vs_config.lower() 
     363        self.target = target.lower() 
    362364 
    363365    def build_tests(self): 
    364366        
    365         (vsbuild,sys) = self.vs_config.split("|",2) 
     367        (vsbuild,sys) = self.target.split("|",2) 
    366368         
    367369        build_name = sys + "-" + vs_get_version() + "-" + vsbuild 
     
    371373 
    372374        vccmd = "vcbuild.exe /nologo /nohtmllog /nocolor /rebuild " + \ 
    373                 "pjproject-vs8.sln " + " \"" + self.vs_config + "\"" 
     375                "pjproject-vs8.sln " + " \"" + self.target + "\"" 
    374376         
    375377        suffix = "-i386-win32-vc8-" + vsbuild 
     
    397399 
    398400 
     401# 
     402# Symbian test configurator 
     403# 
     404class SymbianTestBuilder(TestBuilder): 
     405    """\ 
     406    This class creates list of tests suitable for Symbian builds. You need to 
     407    set the command line build settings prior to running this class (typically 
     408    that involves setting the EPOCROOT variable and current device). 
     409     
     410    """ 
     411    def __init__(self, config, target="gcce urel", build_config_name="",  
     412                 config_site="", exclude=[], not_exclude=[]): 
     413        """\ 
     414        Parameters: 
     415        config              - BaseConfig instance 
     416        target              - Symbian target to build. Default is "gcce urel". 
     417        build_config_name   - Optional name to be added as suffix to the build 
     418                              name. Sample: "APS", "VAS", etc. 
     419        config_site         - Contents to be put on config_site.h 
     420        exclude             - List of regular expression patterns for tests 
     421                              that will be excluded from the run 
     422        not_exclude         - List of regular expression patterns for tests 
     423                              that will be run regardless of whether they 
     424                              match the excluded pattern. 
     425 
     426        """ 
     427        TestBuilder.__init__(self, config, build_config_name=build_config_name, 
     428                             config_site=config_site, exclude=exclude,  
     429                             not_exclude=not_exclude) 
     430        self.target = target.lower() 
     431         
     432    def build_tests(self): 
     433        
     434        # Check that EPOCROOT is set 
     435        if not "EPOCROOT" in os.environ: 
     436            print "Error: EPOCROOT environment variable is not set" 
     437            sys.exit(1) 
     438        epocroot = os.environ["EPOCROOT"] 
     439        # EPOCROOT must have trailing backslash 
     440        if epocroot[-1] != "\\": 
     441            epocroot = epocroot + "\\" 
     442            os.environ["EPOCROOT"] = epocroot 
     443        sdk1 = epocroot.split("\\")[-2] 
     444 
     445        # Check that correct device is set 
     446        proc = subprocess.Popen("devices", stdout=subprocess.PIPE, 
     447                                stderr=subprocess.STDOUT, shell=True) 
     448        sdk2 = "" 
     449        while True: 
     450            line = proc.stdout.readline() 
     451            if line.find("- default") > 0: 
     452                sdk2 = line.split(":",1)[0] 
     453                break 
     454        proc.wait() 
     455 
     456        if sdk1 != sdk2: 
     457            print "Error: default SDK in device doesn't match EPOCROOT" 
     458            print "Default device SDK =", sdk2 
     459            print "EPOCROOT SDK =", sdk1 
     460            sys.exit(1) 
     461 
     462        build_name = sdk2.replace("_", "-") + "-" + \ 
     463                     self.target.replace(" ", "-") 
     464 
     465        if self.build_config_name: 
     466            build_name = build_name + "-" + self.build_config_name 
     467 
     468        cmdline = "cmd /C \"cd build.symbian && bldmake bldfiles && abld build %s\"" % (self.target) 
     469         
     470        cmds = [] 
     471        cmds.extend(update_ops) 
     472        cmds.extend([Operation(Operation.BUILD, cmdline)]) 
     473 
     474        self.ccdash_args = [] 
     475        suffix = "" 
     476        for c in cmds: 
     477            c.cmdline = c.cmdline.replace("$SUFFIX", suffix) 
     478            args = c.encode(self.config.base_dir) 
     479            args.extend(["-U", self.config.url,  
     480                         "-S", self.config.site,  
     481                         "-T", self.stamp(),  
     482                         "-B", build_name,  
     483                         "-G", self.config.group]) 
     484            args.extend(self.config.options) 
     485            self.ccdash_args.append(args) 
     486 
  • pjproject/trunk/tests/cdash/cfg_gnu.py

    r2401 r2405  
    2424# Each configurator must export this function 
    2525def create_builder(args): 
     26    usage = """\ 
     27Usage: 
     28  main.py cfg_gnu [-h|--help] [cfg_site] 
     29 
     30Arguments: 
     31  cfg_site:            site configuration module. If not specified, "cfg_site"  
     32                       is implied 
     33  -h, --help           Show this help screen 
     34 
     35""" 
    2636    # (optional) args format: 
    2737    #   site configuration module. If not specified, "cfg_site" is implied 
    2838 
    29     if len(args)>0: 
    30         file = args[0] 
    31     else: 
    32         file = "cfg_site" 
    33  
    34     if os.access(file+".py", os.F_OK) == False: 
    35         print "Error: file '%s.py' doesn't exist." % (file) 
     39    cfg_site = "cfg_site" 
     40     
     41    for arg in args: 
     42        if arg=="-h" or arg=="--help": 
     43            print usage 
     44            sys.exit(0) 
     45        elif arg[0]=="-": 
     46            print usage 
     47            sys.exit(1) 
     48        else: 
     49            cfg_site = arg 
     50         
     51    if os.access(cfg_site+".py", os.F_OK) == False: 
     52        print "Error: file '%s.py' doesn't exist." % (cfg_site) 
    3653        sys.exit(1) 
    3754 
    38     cfg_site = __import__(file) 
     55    cfg_site = __import__(cfg_site) 
    3956    test_cfg = builder.BaseConfig(cfg_site.BASE_DIR, \ 
    4057                                  cfg_site.URL, \ 
  • pjproject/trunk/tests/cdash/cfg_msvc.py

    r2404 r2405  
    2424# Each configurator must export this function 
    2525def create_builder(args): 
    26     # (optional) args format: 
    27     #   [cfg_site] [--vs-config VSCFG] 
    28     # 
    29     #   cfg_site:   site configuration module. If not specified, "cfg_site"  
    30     #               is implied 
    31     #   VSCFG:      Visual Studio build configuration to build. Sample values: 
    32     #               "Debug|Win32", "Release|Win32". If not specified then  
    33     #               "Release|Win32" is assumed 
     26    usage = """\ 
     27Usage: 
     28  main.py cfg_msvc [-h|--help] [-t|--target TARGET] [cfg_site] 
     29 
     30Arguments: 
     31  cfg_site:            site configuration module. If not specified, "cfg_site"  
     32                       is implied 
     33  -t,--target TARGET:  Visual Studio build configuration to build. Default is 
     34                       "Release|Win32". Sample values: "Debug|Win32" 
     35  -h, --help           Show this help screen 
     36 
     37""" 
    3438 
    3539    cfg_site = "cfg_site" 
    36     vs_cfg = "Release|Win32" 
     40    target = "Release|Win32" 
    3741    in_option = "" 
    3842     
    3943    for arg in args: 
    40         if in_option=="--vs-config": 
    41             vs_cfg = arg 
     44        if in_option=="-t": 
     45            target = arg 
    4246            in_option = "" 
    43         elif arg=="--vs-config": 
    44             in_option = arg 
     47        elif arg=="--target" or arg=="-t": 
     48            in_option = "-t" 
     49        elif arg=="-h" or arg=="--help": 
     50            print usage 
     51            sys.exit(0) 
     52        elif arg[0]=="-": 
     53            print usage 
     54            sys.exit(1) 
    4555        else: 
    4656            cfg_site = arg 
     
    5969    builders = [ 
    6070        builder.MSVCTestBuilder(test_cfg,  
    61                                 vs_config=vs_cfg, 
     71                                target=target, 
    6272                                build_config_name="default", 
    6373                                config_site="#define PJ_TODO(x)\n", 
Note: See TracChangeset for help on using the changeset viewer.