buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_parsers.py
author wbernard
Thu, 22 Jul 2010 17:08:43 +0300
branchhelium-9.0
changeset 618 df88fead2976
parent 587 85df38eb4012
permissions -rw-r--r--
helium_9.0.5-4399343f4f50
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
# -*- encoding: latin-1 -*-
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
#============================================================================ 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
#Name        : test_parsers.py 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     5
#Part of     : Helium 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     6
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     7
#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     8
#All rights reserved.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     9
#This component and the accompanying materials are made available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    10
#under the terms of the License "Eclipse Public License v1.0"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    11
#which accompanies this distribution, and is available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    12
#at the URL "http://www.eclipse.org/legal/epl-v10.html".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    13
#
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    14
#Initial Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    15
#Nokia Corporation - initial contribution.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    16
#
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
#Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
#
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
#Description:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
#===============================================================================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    21
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    22
import os
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
import tempfile
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
import mocker
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
from path import path
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
import StringIO
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
import ats3.parsers
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
import ats3.testconfigurator
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
import logging
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
logging.getLogger().setLevel(logging.ERROR)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
TSRC_DIR = None
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
def setup_module():
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
    """Setup the test environment. The testing of the test parser script requires spesific
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
    structure to be available with bld.inf files (with the content written into those)."""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
    global TSRC_DIR
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
    TSRC_DIR = path(tempfile.mkdtemp()).normpath()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
    test_component = TSRC_DIR
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    42
    for path_parts in (("tsrc", "group"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
                       ("tsrc", "tc1", "group"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
                       ("tsrc", "tc1", "data"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
                       ("tsrc", "tc1", "dependent_1", "group"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
                       ("tsrc", "tc1", "dependent_2", "group"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
                       ("tsrc", "tc1", "subtest", "group"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
                       ("tsrc", "tc1", "subtest", "data"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
                       ("tsrc", "tc1", "subtest", "if_test", "group"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
                       ("tsrc", "tc2", "group"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    51
                       ("tsrc", "tc2", "data"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
                       ("tsrc", "tc3", "group"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
                       ("tsrc", "tc3", "data"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
                       ("tmp", "macros"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
                       ):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
        filepath = path.joinpath(test_component, *path_parts).normpath()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
        if not filepath.exists():
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
            os.makedirs(filepath)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
    tsrc = open(path.joinpath(TSRC_DIR, "tsrc", "group", "bld.inf"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
    tsrc.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
#include "../tc1/group/bld.inf"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
#include "../tc2/group/bld.inf"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    66
#include "../tc3/group/bld.inf" 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    67
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
    tsrc.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    72
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    73
    tc1 = open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "group", "bld.inf"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
    tc1.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    75
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    76
#include "../dependent_1/group/bld.inf"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    77
#include "../dependent_2/group/bld.inf"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    78
#include "../subtest/group/bld.inf"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    79
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    81
tc1.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
PRJ_MMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    84
not_included.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    85
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    86
    tc1.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    87
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    88
    tc1_mmp = open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "group", "tc1.mmp"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    89
    tc1_mmp.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    90
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
TARGET          tc1.dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
TARGETTYPE      dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    93
LIBRARY         stiftestinterface.lib
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    94
LIBRARY         user.lib
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    95
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    96
    tc1_mmp.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    97
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    98
    tc1_sub = open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "subtest", "group", "bld.inf"), "w")
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    99
    tc1_sub.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   100
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   101
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   102
sub_test.mmp    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   103
#ifndef RD_TEST1
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   104
#include "../if_test/group/bld.inf"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   105
#endif
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   106
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   107
    tc1_sub.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   108
    tc1_sub_mmp = open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "subtest", "group", "sub_test.mmp"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   109
    tc1_sub_mmp.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   110
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   111
TARGET          sub_test.dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   112
TARGETTYPE      dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   113
LIBRARY         stiftestinterface.lib
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   114
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   115
    tc1_sub_mmp.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   116
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   117
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   118
    tc1_if = open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "subtest", "if_test", "group", "bld.inf"), "w")
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   119
    tc1_if.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   120
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   121
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   122
if_test.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   123
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   124
    tc1_if.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   125
    tc1_if_mmp = open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "subtest", "if_test", "group", "if_test.mmp"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   126
    tc1_if_mmp.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   127
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   128
TARGET          tc1_if.dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   129
TARGETTYPE      dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   130
LIBRARY         stifunit.lib
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   131
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   132
    tc1_if_mmp.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   133
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   134
    tc1_dep1 = open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "dependent_1", "group", "bld.inf"), "w")
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   135
    tc1_dep1.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   136
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   137
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   138
dependent_1.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   139
onemore.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   140
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   141
    tc1_dep1.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   142
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   143
    tc1_dep1_mmp = open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "dependent_1", "group", "dependent_1.mmp"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   144
    tc1_dep1_mmp.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   145
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   146
TARGET          dependent_1.dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   147
TARGETTYPE      PLUGIN
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   148
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   149
    tc1_dep1_mmp.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   150
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   151
    tc1_dep2 = open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "dependent_2", "group", "bld.inf"), "w")
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   152
    tc1_dep2.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   153
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   154
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   155
dependent_2.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   156
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   157
    tc1_dep2.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   158
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   159
    tc1_dep2_mmp = open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "dependent_2", "group", "dependent_2.mmp"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   160
    tc1_dep2_mmp.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   161
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   162
TARGET          dependent_2.dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   163
TARGETTYPE      PLUGIN
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   164
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   165
    tc1_dep2_mmp.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   166
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   167
    tc1_pkg = open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "group", "tc1.pkg"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   168
    tc1_pkg.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   169
                  r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   170
;Language - standard language definitions
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   171
&EN
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   172
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   173
; standard SIS file header
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   174
#{"BTEngTestApp"},(0x04DA27D5),1,0,0
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   175
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   176
;Supports Series 60 v 3.0
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   177
(0x101F7961), 0, 0, 0, {"Series60ProductID"}
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   178
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   179
;Localized Vendor Name
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   180
%{"BTEngTestApp"}
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   181
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   182
;Unique Vendor name
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   183
:"Nokia"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   184
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   185
; Files to copy
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   186
"..\data\file1.dll"-"c:\sys\bin\file1.dll"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   187
"..\data\file1.txt"-"e:\sys\bin\file1.txt" , FF   ; FF stands for Normal file
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   188
"..\data\file2.mp3"-"e:\sys\bin\file2.mp3"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   189
"..\data\TestFramework.ini"-"c:\sys\bin\TestFramework.ini"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   190
;"..\xyz\TestFramework.ini"-"!:\sys\bin\TestFramework.ini" (commented line)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   191
"../data/temp.ini"-"!:/sys/bin/temp.ini" , FF ; "something here"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   192
"..\data\tc1.cfg"-"e:\sys\bin\tc1.cfg"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   193
"..\data\tc1.sisx"-"e:\sys\bin\tc1.sisx"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   194
"..\data\DUMP.xyz"-"e:\sys\bin\DUMP.xyz"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   195
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   196
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   197
        """.replace('\\', os.sep))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   198
    tc1_pkg.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   199
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   200
    open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "data", "file1.dll"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   201
    open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "data", "file1.txt"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   202
    open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "data", "file2.mp3"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   203
    open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "data", "TestFramework.ini"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   204
    open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "data", "temp.ini"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   205
    open(path.joinpath(TSRC_DIR, "tsrc", "tc1", "data", "DUMP.xyz"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   206
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   207
    tc2 = open(path.joinpath(TSRC_DIR, "tsrc", "tc2", "group", "bld.inf"), "w")
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   208
    tc2.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   209
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   210
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   211
tc2.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   212
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   213
    tc2.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   214
    tc2_mmp = open(path.joinpath(TSRC_DIR, "tsrc", "tc2", "group", "tc2.mmp"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   215
    tc2_mmp.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   216
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   217
TARGET          tc2.dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   218
TARGETTYPE      dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   219
LIBRARY         EUnit.lib
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   220
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   221
    tc2_mmp.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   222
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   223
    tc2_pkg = open(path.joinpath(TSRC_DIR, "tsrc", "tc2", "group", "tc2.pkg"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   224
    tc2_pkg.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   225
                  r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   226
;Language - standard language definitions
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   227
&EN
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   228
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   229
; standard SIS file header
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   230
#{"BTEngTestApp"},(0x04DA27D5),1,0,0
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   231
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   232
;Supports Series 60 v 3.0
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   233
(0x101F7961), 0, 0, 0, {"Series60ProductID"}
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   234
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   235
;Localized Vendor Name
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   236
%{"BTEngTestApp"}
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   237
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   238
;Unique Vendor name
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   239
:"Nokia"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   240
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   241
; Files to copy
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   242
"..\data\file1.dll"-"c:\sys\bin\file1.dll"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   243
"..\data\file1.txt"-"e:\sys\bin\file1.txt"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   244
"..\data\file2.mp3"-"e:\sys\bin\file2.mp3"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   245
"..\data\TestFramework.ini"-"!:\sys\bin\TestFramework.ini" , FF   ; FF stands for Normal file
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   246
"..\data\tc2.cfg"-"!:\sys\bin\tc2.cfg"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   247
        """.replace('\\', os.sep))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   248
    tc2_pkg.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   249
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   250
    open(path.joinpath(TSRC_DIR, "tsrc", "tc2", "data", "file1.dll"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   251
    open(path.joinpath(TSRC_DIR, "tsrc", "tc2", "data", "file1.txt"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   252
    open(path.joinpath(TSRC_DIR, "tsrc", "tc2", "data", "file2.mp3"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   253
    open(path.joinpath(TSRC_DIR, "tsrc", "tc2", "data", "TestFramework.ini"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   254
    open(path.joinpath(TSRC_DIR, "tsrc", "tc2", "data", "tc2.cfg"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   255
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   256
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   257
    tc3 = open(path.joinpath(TSRC_DIR, "tsrc", "tc3", "group", "bld.inf"), "w")
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   258
    tc3.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   259
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   260
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   261
tc3.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   262
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   263
    tc3.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   264
    tc3_mmp = open(path.joinpath(TSRC_DIR, "tsrc", "tc3", "group", "tc3.mmp"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   265
    tc3_mmp.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   266
            r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   267
TARGET          tc3.dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   268
TARGETTYPE      dll
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   269
LIBRARY         EUnit.lib
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   270
            """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   271
    tc3_mmp.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   272
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   273
    tc3_pkg = open(path.joinpath(TSRC_DIR, "tsrc", "tc2", "group", "tc2.pkg"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   274
    tc3_pkg.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   275
                  r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   276
;Language - standard language definitions
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   277
&EN
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   278
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   279
; standard SIS file header
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   280
#{"BTEngTestApp"},(0x04DA27D5),1,0,0
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   281
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   282
;Supports Series 60 v 3.0
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   283
(0x101F7961), 0, 0, 0, {"Series60ProductID"}
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   284
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   285
;Localized Vendor Name
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   286
%{"BTEngTestApp"}
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   287
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   288
;Unique Vendor name
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   289
:"Nokia"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   290
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   291
; Files to copy
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   292
"..\data\file1.dll"-"c:\sys\bin\file1.dll"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   293
"..\data\file1.txt"-"e:\sys\bin\file1.txt"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   294
"..\data\file2.mp3"-"e:\sys\bin\file2.mp3" , FF   ; FF stands for Normal file
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   295
"..\data\TestFramework.ini"-"!:\sys\bin\TestFramework.ini"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   296
"..\data\temp.ini"-"!:\sys\bin\temp.ini"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   297
"..\data\tc2.cfg"-"!:\sys\bin\tc2.cfg"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   298
        """.replace('\\', os.sep))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   299
    tc3_pkg.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   300
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   301
    open(path.joinpath(TSRC_DIR, "tsrc", "tc3", "data", "file1.dll"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   302
    open(path.joinpath(TSRC_DIR, "tsrc", "tc3", "data", "file1.txt"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   303
    open(path.joinpath(TSRC_DIR, "tsrc", "tc3", "data", "file2.mp3"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   304
    open(path.joinpath(TSRC_DIR, "tsrc", "tc3", "data", "TestFramework.ini"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   305
    open(path.joinpath(TSRC_DIR, "tsrc", "tc3", "data", "temp.ini"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   306
    open(path.joinpath(TSRC_DIR, "tsrc", "tc3", "data", "tc2.cfg"), 'w').close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   307
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   308
    macros = open(path.joinpath(TSRC_DIR, "tmp", "macros", "bldcodeline.hrh"), 'w')
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   309
    macros.write(
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   310
              r"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   311
#ifndef __BLDCODELINE_HRH
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   312
#define __BLDCODELINE_HRH
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   313
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   314
/** #RD_TEST */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   315
#define RD_TEST1
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   316
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   317
/** #RD_TEST2 */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   318
#define RD_TEST2
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   319
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   320
/** #RD_TEST3 */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   321
#define RD_TEST3
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   322
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   323
#endif  // __BLDCODELINE_HRH
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   324
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   325
    """)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   326
    macros.close()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   327
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   328
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   329
def teardown_module():
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   330
    """ Cleanup environment after testing. """    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   331
    def __init__():
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   332
        TSRC_DIR.rmtree()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   333
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   334
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   335
#        list_of_paths = []
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   336
#        list_of_paths = path.walk(TSRC_DIR)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   337
#        for file in list_of_paths[2]:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   338
#            continue
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   339
#        for dir in list_of_paths[1]:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   340
#            continue
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   341
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   342
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   343
class TestPkgFileParser(mocker.MockerTestCase):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   344
    """Testing Package file parser"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   345
    def __init__(self, methodName="runTest"):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   346
        mocker.MockerTestCase.__init__(self, methodName)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   347
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   348
    def setUp(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   349
        """Setup for PkgFile parser"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   350
        self.pkg_file_path1 = os.path.normpath(os.path.join(TSRC_DIR, "tsrc", "tc1", "group"))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   351
        self.pkg_file_path2 = os.path.normpath(os.path.join(TSRC_DIR, "tsrc", "tc2", "group"))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   352
        self.pkg_file_path3 = os.path.normpath(os.path.join(TSRC_DIR, "tsrc", "tc3", "group"))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   353
        self.tcp = ats3.parsers.PkgFileParser("tc1.pkg")        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   354
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   355
        self.data_files = [
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   356
            (path(TSRC_DIR+r"" + os.sep + "tsrc" + os.sep + "tc1" + os.sep + "data" + os.sep + "file1.dll").normpath(), path(r"c:" + os.sep + "sys" + os.sep + "bin" + os.sep + "file1.dll").normpath(), "testmodule", 'tc1.pkg'),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   357
            (path(TSRC_DIR+r"" + os.sep + "tsrc" + os.sep + "tc1" + os.sep + "data" + os.sep + "file1.txt").normpath(), path(r"e:" + os.sep + "sys" + os.sep + "bin" + os.sep + "file1.txt").normpath(), "data", 'tc1.pkg'),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   358
            (path(TSRC_DIR+r"" + os.sep + "tsrc" + os.sep + "tc1" + os.sep + "data" + os.sep + "file2.mp3").normpath(), path(r"e:" + os.sep + "sys" + os.sep + "bin" + os.sep + "file2.mp3").normpath(), "data", 'tc1.pkg'),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   359
            (path(TSRC_DIR+r"" + os.sep + "tsrc" + os.sep + "tc1" + os.sep + "data" + os.sep + "TestFramework.ini").normpath(), path(r"c:" + os.sep + "sys" + os.sep + "bin" + os.sep + "TestFramework.ini").normpath(), "engine_ini", 'tc1.pkg'),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   360
            (path(TSRC_DIR+r"" + os.sep + "tsrc" + os.sep + "tc1" + os.sep + "data" + os.sep + "temp.ini").normpath(), path(r"c:" + os.sep + "sys" + os.sep + "bin" + os.sep + "temp.ini").normpath(), "engine_ini", 'tc1.pkg'),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   361
            (path(TSRC_DIR+r"" + os.sep + "tsrc" + os.sep + "tc1" + os.sep + "data" + os.sep + "tc1.cfg").normpath(), path(r"e:" + os.sep + "sys" + os.sep + "bin" + os.sep + "tc1.cfg").normpath(), "conf", 'tc1.pkg'),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   362
            (path(TSRC_DIR+r"" + os.sep + "tsrc" + os.sep + "tc1" + os.sep + "data" + os.sep + "tc1.sisx").normpath(), path(r"e:" + os.sep + "sys" + os.sep + "bin" + os.sep + "tc1.sisx").normpath(), "", 'tc1.pkg'),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   363
            (path(TSRC_DIR+r"" + os.sep + "tsrc" + os.sep + "tc1" + os.sep + "data" + os.sep + "DUMP.xyz").normpath(), path(r"e:" + os.sep + "sys" + os.sep + "bin" + os.sep + "DUMP.xyz").normpath(), "data", 'tc1.pkg'),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   364
            ]
618
df88fead2976 helium_9.0.5-4399343f4f50
wbernard
parents: 587
diff changeset
   365
        for p, _, _, _ in self.data_files:
df88fead2976 helium_9.0.5-4399343f4f50
wbernard
parents: 587
diff changeset
   366
            open(p, 'w').close()
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   367
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   368
    def test_get_pkg_files(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   369
        """Test if pkg files are returned from a specified location"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   370
        assert self.tcp.get_pkg_files(self.pkg_file_path1, False) == ["tc1.pkg"]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   371
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   372
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   373
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   374
    def test_parser_receives_path(self):      
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   375
        """Test if None is returned when a path to PKG file is incorrect"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   376
        assert self.tcp.get_data_files("string") == []
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   377
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   378
    def test_data_files_creation_without_exclude(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   379
        """ Tests if PKG file parser creates data files list as expected without exclude"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   380
        assert self.tcp.get_data_files(self.pkg_file_path1, "d:") == self.data_files
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   381
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   382
    def test_data_files_creation_with_exclude(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   383
        """ Tests if PKG file parser creates data files list as expected with exclude"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   384
        self.data_files.pop()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   385
        assert self.tcp.get_data_files(self.pkg_file_path1, "d:", "\.xyz") == self.data_files
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   386
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   387
    def test_data_files_creation_without_drive_with_exclude(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   388
        """ Tests if PKG file parser creates data files list as expected without drive with exclude"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   389
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   390
        self.data_files.pop()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   391
        assert self.tcp.get_data_files(self.pkg_file_path1, "", "\.xyz") == self.data_files
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   392
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   393
    def test_data_files_creation_without_drive_without_exclude(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   394
        """ Tests if PKG file parser creates data files list as expected without drive without exclude"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   395
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   396
        assert self.tcp.get_data_files(self.pkg_file_path1, "") == self.data_files
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   397
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   398
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   399
class TestCppParser(mocker.MockerTestCase):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   400
    """Testing CPP parser"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   401
    def __init__(self, methodName="runTest"):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   402
        mocker.MockerTestCase.__init__(self, methodName)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   403
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   404
    def setUp(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   405
        self.bld_path = os.path.normpath(os.path.join(TSRC_DIR, "tsrc", "group"))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   406
        self.bld_path_comp1 = os.path.normpath(os.path.join(TSRC_DIR, "tsrc", "tc1", "group"))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   407
        self.tcp = ats3.parsers.CppParser()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   408
        upper_bld_path = os.path.dirname(self.bld_path)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   409
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   410
        self.dependent_paths_dictionary = {(os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/subtest/if_test/group"))): {'content': {(os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/subtest/if_test/group"))): {'pkg_files': [], 'mmp_files': ['if_test.mmp'], 'harness': 'STIFUNIT', 'type': ''}}},
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   411
                                            (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc2//group"))): {'content': {(os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc2/group"))): {'pkg_files': ['tc2.pkg'], 'mmp_files': ['tc2.mmp'], 'harness': 'EUNIT', 'type': 'executable'}}}, 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   412
                                            (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc3/group"))): {'content': {(os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc3/group"))): {'pkg_files':[], 'mmp_files': ['tc3.mmp'], 'harness': 'EUNIT', 'type': 'executable'}}},
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   413
                                            (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group"))): {'content': {(os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/subtest/group"))): {'pkg_files': [], 'mmp_files': ['sub_test.mmp'], 'harness': 'STIF', 'type': 'executable'}, 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   414
                                                                                                                                (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/dependent_1/group"))): {'pkg_files': [], 'mmp_files': ['dependent_1.mmp', 'onemore.mmp'], 'harness': "", 'type':''}, 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   415
                                                                                                                                (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/dependent_2/group"))): {'pkg_files': [], 'mmp_files': ['dependent_2.mmp'], 'harness': "", 'type': 'dependent'}, 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   416
                                                                                                                                (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group"))): {'pkg_files': ['tc1.pkg'], 'mmp_files': ['tc1.mmp'],'harness': 'STIF', 'type': 'executable'}}}} 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   417
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   418
        self.extended_path_list = [(os.path.normpath(upper_bld_path), upper_bld_path),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   419
                           (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group")), upper_bld_path),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   420
                           (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group/../dependent_1/group")), os.path.normpath(os.path.join(upper_bld_path, "../tc1/group"))),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   421
                           (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group/../dependent_2/group")), os.path.normpath(os.path.join(upper_bld_path, "../tc1/group"))),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   422
                           (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group/../subtest/group")), os.path.normpath(os.path.join(upper_bld_path, "../tc1/group"))),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   423
                           (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group/../subtest/group/../if_test/group")), os.path.normpath(os.path.join(upper_bld_path, "../tc1/group/../subtest/group"))),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   424
                           (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc2/group")), upper_bld_path),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   425
                           (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc3/group")), upper_bld_path),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   426
                           (os.path.normpath(os.path.join(upper_bld_path, "../tsrc/group/group")), upper_bld_path),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   427
                           ]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   428
        self.path_list = [os.path.normpath(os.path.join(upper_bld_path, "group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   429
                           os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   430
                           os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group/../dependent_1/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   431
                           os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group/../dependent_2/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   432
                           os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group/../subtest/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   433
                           os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc1/group/../subtest/group/../if_test/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   434
                           os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc2/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   435
                           os.path.normpath(os.path.join(upper_bld_path, "../tsrc/tc3/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   436
                           ]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   437
        self.path_list_without_undefined = [os.path.normpath(upper_bld_path),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   438
                           os.path.normpath(os.path.join(upper_bld_path, "../tc1/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   439
                           os.path.normpath(os.path.join(upper_bld_path, "../tc1/group/../dependent_1/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   440
                           os.path.normpath(os.path.join(upper_bld_path, "../tc1/group/../dependent_2/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   441
                           os.path.normpath(os.path.join(upper_bld_path, "../tc1/group/../subtest/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   442
                           os.path.normpath(os.path.join(upper_bld_path, "../tc2/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   443
                           os.path.normpath(os.path.join(upper_bld_path, "../tc3/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   444
                           ]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   445
        self.cpp_output = ['# 1 "bld.inf"', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   446
                           '# 1 "../tc1/group/bld.inf" 1', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   447
                           '# 1 "../tc1/group/../dependent_1/group/bld.inf" 1', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   448
                           '# 4 "../tc1/group/bld.inf" 2', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   449
                           '# 1 "../tc1/group/../dependent_2/group/bld.inf" 1', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   450
                           '# 5 "../tc1/group/bld.inf" 2', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   451
                           '# 1 "../tc1/group/../subtest/group/bld.inf" 1', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   452
                           '# 1 "../tc1/group/../subtest/group/../if_test/group/bld.inf" 1', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   453
                           '# 4 "../tc1/group/../subtest/group/bld.inf" 2', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   454
                           '# 6 "../tc1/group/bld.inf" 2', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   455
                           '# 3 "bld.inf" 2', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   456
                           '# 1 "../tc2/group/bld.inf" 1', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   457
                           '# 4 "bld.inf" 2', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   458
                           '# 1 "../tc3/group/bld.inf" 1', 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   459
                           '# 5 "bld.inf" 2']
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   460
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   461
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   462
         
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   463
    def test_pathlist_output(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   464
        """Test get_cpp_output-method using "n" -parameter"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   465
        assert self.path_list.sort() == self.tcp.get_cpp_output(self.bld_path, "n").sort()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   466
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   467
    def test_extended_pathlist_output(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   468
        """Test get_cpp_output-method using "e" -parameter"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   469
        assert self.extended_path_list.sort() == self.tcp.get_cpp_output(self.bld_path, "e").sort()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   470
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   471
    def test_dictionary_pathlist_output(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   472
        """Test get_cpp_output-method using "d" -parameter (dependent paths)"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   473
        output = """# 1 "bld.inf"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   474
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   475
# 1 "../tc1/group/bld.inf" 1
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   476
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   477
# 1 "../tc1/group/../dependent_1/group/bld.inf" 1
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   478
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   479
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   480
dependent_1.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   481
onemore.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   482
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   483
# 2 "../tc1/group/bld.inf" 2
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   484
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   485
# 1 "../tc1/group/../dependent_2/group/bld.inf" 1
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   486
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   487
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   488
dependent_2.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   489
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   490
# 3 "../tc1/group/bld.inf" 2
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   491
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   492
# 1 "../tc1/group/../subtest/group/bld.inf" 1
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   493
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   494
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   495
sub_test.mmp    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   496
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   497
# 1 "../tc1/group/../subtest/group/../if_test/group/bld.inf" 1
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   498
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   499
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   500
if_test.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   501
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   502
# 5 "../tc1/group/../subtest/group/bld.inf" 2
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   503
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   504
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   505
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   506
# 4 "../tc1/group/bld.inf" 2
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   507
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   508
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   509
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   510
tc1.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   511
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   512
PRJ_MMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   513
not_included.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   514
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   515
# 2 "bld.inf" 2
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   516
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   517
# 1 "../tc2/group/bld.inf" 1
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   518
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   519
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   520
tc2.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   521
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   522
# 3 "bld.inf" 2
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   523
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   524
# 1 "../tc3/group/bld.inf" 1
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   525
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   526
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   527
tc3.mmp
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   528
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   529
# 4 "bld.inf" 2
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   530
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   531
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   532
PRJ_TESTMMPFILES
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   533
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   534
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   535
"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   536
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   537
        result = self.tcp.create_dependency_dictionary(StringIO.StringIO(output), self.bld_path)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   538
        print "INPUT :", self.dependent_paths_dictionary
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   539
        print "OUTPUT:", result 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   540
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   541
        assert self.dependent_paths_dictionary == result
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   542
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   543
    def test_conditional_cpp_parsing(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   544
        """Test functionality of cpp parser when removing conditionals"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   545
        assert self.path_list_without_undefined.sort() == self.tcp.get_cpp_output(bld_path=self.bld_path, output_parameter="n", imacros=os.path.normpath(os.path.join(TSRC_DIR, "tmp", "macros", "bldcodeline.hrh"))).sort()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   546
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   547
class TestBldFileParser(mocker.MockerTestCase):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   548
    """Testing BldFileParser Class"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   549
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   550
    def __init__(self, methodName="runTest"):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   551
        mocker.MockerTestCase.__init__(self, methodName)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   552
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   553
    def setUp(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   554
        """Setup for BldFile parser"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   555
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   556
        self.bld_path = path.joinpath(TSRC_DIR, "tsrc", "group", "bld.inf").normpath()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   557
        upper_bld_path = self.bld_path.dirname()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   558
        self.tcp = ats3.parsers.BldFileParser()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   559
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   560
        self.test_mmp_files = [
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   561
                               ['tc1.mmp'], 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   562
                               ['dependent_1.mmp', 'onemore.mmp'], 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   563
                               ['dependent_2.mmp'], 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   564
                               ['sub_test.mmp'], 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   565
                               ['if_test.mmp'], 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   566
                               ['tc2.mmp'], 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   567
                               ["tc3.mmp"],
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   568
                               ]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   569
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   570
        self.path_list = [path.joinpath(upper_bld_path, "../tc1/group").normpath(),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   571
                           path.joinpath(upper_bld_path, "../tc1/group/../dependent_1/group").normpath(),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   572
                           path.joinpath(upper_bld_path, "../tc1/group/../dependent_2/group").normpath(),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   573
                           path.joinpath(upper_bld_path, "../tc1/group/../subtest/group").normpath(),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   574
                           path.joinpath(upper_bld_path, "../tc1/group/../subtest/group/../if_test/group").normpath(),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   575
                           path.joinpath(upper_bld_path, "../tc2/group").normpath(),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   576
                           path.joinpath(upper_bld_path, "../tc3/group").normpath(),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   577
                           ]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   578
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   579
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   580
    def test_testmmp_files_with_full_path(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   581
        """Test if mmp file is returned with its full path"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   582
        self.mmp_file_path = [path.joinpath(TSRC_DIR, "tsrc", "tc1", "group", "tc1.mmp").normpath()]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   583
        assert self.tcp.get_test_mmp_files(os.path.normpath(os.path.join(self.path_list[0], "bld.inf"))) == self.mmp_file_path
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   584
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   585
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   586
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   587
    def test_testmmp_files(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   588
        """Tests if test mmp files are included"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   589
        self.lst_test_mmp = []
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   590
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   591
        for p in self.path_list:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   592
            self.lst_test_mmp.append(self.tcp.get_test_mmp_files(os.path.normpath(os.path.join(p, "bld.inf")), False))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   593
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   594
        assert self.lst_test_mmp == self.test_mmp_files
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   595
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   596
    def test_ignore_comments(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   597
        """ Test if comments are ignored correctly. """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   598
        for input_, output in [
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   599
            ("abc.mmp /* apuva.mmp */ xyz.mmp", ("abc.mmp xyz.mmp")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   600
            ("abc.mmp /* apuva.mmp */", ("abc.mmp")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   601
            ("/* apuva.mmp */", ""),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   602
            ("  // apuva.mmp", ""),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   603
            ("   apuva.mmp", "apuva.mmp"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   604
            ("xyz.mmp // apuva.mmp", "xyz.mmp"),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   605
            ("abc.mmp /* apuva.mmp */ xyz.mmp //rst.mmp", ("abc.mmp xyz.mmp")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   606
            ]:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   607
            assert self.tcp.ignore_comments_from_input(input_) == output
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   608
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   609
    def test_broken_path(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   610
        """Tests if 'None' is returned when path is broken"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   611
        upper_bld_path = os.path.dirname(self.bld_path)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   612
        assert self.tcp.get_test_mmp_files(os.path.normpath(os.path.join(upper_bld_path, "../tc99/group"))) == None
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   613
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   614
    def test_empty_parameter(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   615
        """Tests if 'None' is returned when bld file path is empty"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   616
        upper_bld_path = os.path.dirname(self.bld_path)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   617
        assert self.tcp.get_test_mmp_files("") == None
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   618
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   619
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   620
class TestMmpFileParser(mocker.MockerTestCase):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   621
    """Testing MmpFileParser Class"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   622
    def __init__(self, methodName="runTest"):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   623
        mocker.MockerTestCase.__init__(self, methodName)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   624
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   625
    def setUp(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   626
        self.bld_path = os.path.normpath(os.path.join(TSRC_DIR, "tsrc", "group", "bld.inf"))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   627
        upper_bld_path = os.path.dirname(self.bld_path)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   628
        self.tcp = ats3.parsers.MmpFileParser()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   629
        self.tc1_type = "dll"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   630
        self.tc1_name = "tc1.dll"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   631
        self.tc1_dll_type = "executable"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   632
        self.tc1_harness = "STIF"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   633
        self.tc1_libraries = ['stiftestinterface.lib', 'user.lib']
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   634
        self.tc1_all = (self.tc1_name, self.tc1_type, self.tc1_libraries, self.tc1_harness)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   635
        self.tc1_no_harness = (self.tc1_name, self.tc1_type, self.tc1_libraries)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   636
        self.tc1_name_type = (self.tc1_name, self.tc1_type) 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   637
        self.tc1_iftest_harness = "STIFUNIT"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   638
        self.tc1_iftest_name = "tc1_if.dll"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   639
        self.tc1_iftest_type = "dll"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   640
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   641
        self.test_mmp_files = [['tc1.mmp'], ['dependent_1.mmp', 'onemore.mmp'], ['dependent_2.mmp'], ['sub_test.mmp'], ['if_test.mmp'], 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   642
                               ['tc2.mmp'], ["tc3.mmp"]]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   643
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   644
        self.path_list = [os.path.normpath(os.path.join(upper_bld_path, "../tc1/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   645
                           os.path.normpath(os.path.join(upper_bld_path, "../tc1/group/../dependent_1/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   646
                           os.path.normpath(os.path.join(upper_bld_path, "../tc1/group/../dependent_2/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   647
                           os.path.normpath(os.path.join(upper_bld_path, "../tc1/group/../subtest/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   648
                           os.path.normpath(os.path.join(upper_bld_path, "../tc1/group/../subtest/group/../if_test/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   649
                           os.path.normpath(os.path.join(upper_bld_path, "../tc2/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   650
                           os.path.normpath(os.path.join(upper_bld_path, "../tc3/group")),
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   651
                           ]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   652
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   653
    def test_get_dlltype(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   654
        """Test if get_filetype returns right type for given mmp"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   655
        assert self.tc1_dll_type == self.tcp.get_dll_type(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp'))) 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   656
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   657
    def test_get_target_filename(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   658
        """Test if get_filename returns right name for dll for given mmp"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   659
        assert self.tc1_name == self.tcp.get_target_filename(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp')))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   660
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   661
    def test_get_libraries(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   662
        """Test if get_harness returns right harness for given mmp"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   663
        assert self.tc1_libraries == self.tcp.get_libraries(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp')))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   664
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   665
    def test_get_harness(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   666
        """Test if get_harness returns right harness for given mmp"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   667
        assert self.tc1_harness == self.tcp.get_harness(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp')))
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   668
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   669
    def test_read_information_method(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   670
        """Test if read_information_from_mmp returns wanted output for given parameter and mmp-file"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   671
        assert self.tc1_all == self.tcp.read_information_from_mmp(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp')), 0)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   672
        assert self.tc1_no_harness == self.tcp.read_information_from_mmp(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp')), 1)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   673
        assert self.tc1_name_type == self.tcp.read_information_from_mmp(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp')), 2)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   674
        assert self.tc1_name == self.tcp.read_information_from_mmp(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp')), 3)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   675
        assert self.tc1_type == self.tcp.read_information_from_mmp(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp')), 4) 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   676
        assert self.tc1_libraries == self.tcp.read_information_from_mmp(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp')), 5)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   677
        assert self.tc1_harness == self.tcp.read_information_from_mmp(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp')), 6)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   678
        assert self.tc1_iftest_name == self.tcp.read_information_from_mmp(os.path.normpath(os.path.join(self.path_list[4], 'if_test.mmp')), 3)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   679
        assert self.tc1_iftest_type == self.tcp.read_information_from_mmp(os.path.normpath(os.path.join(self.path_list[4], 'if_test.mmp')), 4) 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   680
        assert self.tc1_iftest_harness == self.tcp.read_information_from_mmp(os.path.normpath(os.path.join(self.path_list[4], 'if_test.mmp')), 6)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   681
        assert self.tc1_dll_type == self.tcp.read_information_from_mmp(os.path.normpath(os.path.join(self.path_list[0], 'tc1.mmp')), 7)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   682
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   683
class TestParsers(mocker.MockerTestCase):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   684
    """Testing Parsers functionality"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   685
    def __init__(self, methodName="runTest"):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   686
        mocker.MockerTestCase.__init__(self, methodName)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   687
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   688
    def setUp(self):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   689
        pass