|
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 |
|
|
|
17 |
import sys
|
|
|
18 |
import os
|
|
|
19 |
import shutil
|
|
|
20 |
|
|
|
21 |
TC_NUM = sys.argv[1]
|
|
|
22 |
TC_FOLDER = os.getcwd()+os.sep+"TC"+os.sep+TC_NUM
|
|
|
23 |
|
|
|
24 |
TC_BASE_INC = TC_FOLDER+os.sep+"baseline_headers"+os.sep+"epoc32"+os.sep+"include"+os.sep
|
|
|
25 |
TC_CUR_INC = TC_FOLDER+os.sep+"current_headers"+os.sep+"epoc32"+os.sep+"include"+os.sep
|
|
|
26 |
TC_SCRIPT = TC_FOLDER+os.sep+"scripts"+os.sep
|
|
|
27 |
TC_RESULT = TC_FOLDER+os.sep+"results"+os.sep
|
|
|
28 |
|
|
|
29 |
TMP_BASE_INC = os.getcwd()+os.sep+"template"+os.sep+"baseline_headers"+os.sep+"epoc32"+os.sep+"include"+os.sep
|
|
|
30 |
TMP_CUR_INC = os.getcwd()+os.sep+"template"+os.sep+"current_headers"+os.sep+"epoc32"+os.sep+"include"+os.sep
|
|
|
31 |
TMP_SCRIPT = os.getcwd()+os.sep+"template"+os.sep+"scripts"+os.sep
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
if len(sys.argv) == 1:
|
|
|
35 |
print "Usage: hatestbuild testcase_name"
|
|
|
36 |
sys.exit()
|
|
|
37 |
|
|
|
38 |
if os.path.exists(TC_FOLDER):
|
|
|
39 |
print "Test case directory " + TC_FOLDER + " already exists."
|
|
|
40 |
sys.exit()
|
|
|
41 |
|
|
|
42 |
print "building test case directories... "
|
|
|
43 |
|
|
|
44 |
os.makedirs(TC_BASE_INC)
|
|
|
45 |
os.makedirs(TC_CUR_INC)
|
|
|
46 |
os.makedirs(TC_RESULT)
|
|
|
47 |
os.makedirs(TC_SCRIPT)
|
|
|
48 |
|
|
|
49 |
print "copying test case files..."
|
|
|
50 |
|
|
|
51 |
shutil.copyfile(TMP_BASE_INC+'forced.h',TC_BASE_INC+'forced.h')
|
|
|
52 |
shutil.copyfile(TMP_BASE_INC+'template.h',TC_BASE_INC+TC_NUM+'.h')
|
|
|
53 |
shutil.copyfile(TMP_CUR_INC+'forced.h',TC_CUR_INC+'forced.h')
|
|
|
54 |
shutil.copyfile(TMP_CUR_INC+'template.h',TC_CUR_INC+TC_NUM+'.h')
|
|
|
55 |
shutil.copyfile(TMP_SCRIPT+'prepare.txt',TC_SCRIPT+'prepare.txt')
|
|
|
56 |
shutil.copyfile(TMP_SCRIPT+'template_conf.txt',TC_SCRIPT+TC_NUM+'_conf.txt')
|
|
|
57 |
|
|
|
58 |
print "Test case directory created: " + TC_FOLDER |