0
|
1 |
#
|
|
2 |
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
# All rights reserved.
|
|
4 |
# This component and the accompanying materials are made available
|
|
5 |
# under the terms of "Eclipse Public License v1.0"
|
|
6 |
# which accompanies this distribution, and is available
|
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
#
|
|
9 |
# Initial Contributors:
|
|
10 |
# Nokia Corporation - initial contribution.
|
|
11 |
#
|
|
12 |
# Contributors:
|
|
13 |
#
|
|
14 |
# Description:
|
|
15 |
#
|
|
16 |
|
3
|
17 |
import os
|
0
|
18 |
|
|
19 |
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
|
|
20 |
|
|
21 |
from testautomation.base_testcase import BaseTestCase
|
3
|
22 |
from cone.public import plugin, api
|
0
|
23 |
|
|
24 |
def abspath(path):
|
|
25 |
return os.path.normpath(os.path.join(ROOT_PATH, path))
|
|
26 |
|
|
27 |
class TestGenconfmlGeneration(BaseTestCase):
|
|
28 |
|
|
29 |
def test_generate_gcfml_layer1(self): self._run_gen_test(1)
|
|
30 |
def test_generate_gcfml_layer2(self): self._run_gen_test(2)
|
|
31 |
# Related to the ignored file, see ticket #160: Sequence items with extension policy prefix are reversed
|
|
32 |
def test_generate_gcfml_layer3(self): self._run_gen_test(3, ignores=['feature2.txt'])
|
|
33 |
def test_generate_gcfml_layer4(self): self._run_gen_test(4)
|
|
34 |
|
|
35 |
def _run_gen_test(self, layer, ignores=[]):
|
|
36 |
project_dir = abspath('project')
|
|
37 |
config = 'root%s.confml' % layer
|
|
38 |
output_dir = abspath('temp/gen_output%s' % layer)
|
|
39 |
expected_dir = abspath('expected/root%s' % layer)
|
|
40 |
|
|
41 |
self.remove_if_exists(output_dir)
|
|
42 |
|
|
43 |
prj = api.Project(api.Storage.open(project_dir))
|
|
44 |
config = prj.get_configuration(config)
|
3
|
45 |
context = plugin.GenerationContext(configuration=config,
|
|
46 |
output=output_dir)
|
|
47 |
context.filtering_disabled = True
|
0
|
48 |
impls = plugin.get_impl_set(config, 'gcfml$')
|
3
|
49 |
impls.generate(context)
|
0
|
50 |
|
|
51 |
self.assert_dir_contents_equal(output_dir, expected_dir, ['.svn'] + ignores)
|