for suite in suites:
#load all the modules of this suite in tcs
- tcs = os.listdir("src/"+suite)
+ tcs = os.listdir("src/"+suite)
for tc in tcs:
#check to handle only one module, input given from command line
if module_check == 1:
if (cmake_check_1 not in line and (cmake_check_2 in line or cmake_check_3 in line or cmake_check_4 in line)):
escape_line = 1
if "ENDIF()" in line:
- escape_line = 0
+ escape_line = 0
if '.' in line and "}" not in line and escape_line == 0:
#print line
#check for .c and .cpp file
flag_inside_function = 0
else:
flag_inside_function = 1
-
+
#print str(brace) + str(flag_inside_function)
#check whether somes tcs are not for a particular profile
#if "utc_image_util_decode_jpeg_n2" in tc_line:
continu = 0
#print "continu" + str(continu)
pat = r'([\w]+)\s+([\S]+)\(([\w+\s+\w+])+\)'
-
+
if re.search(pat,tc_line) and "actorSource.GetProperty" not in tc_line and tc_line is not "" and (("int " in tc_line and "(void)" in tc_line) or ("void " in tc_line and "(void)" in tc_line and ("startup" in tc_line or "cleanup" in tc_line))):
if continu == 1:
continue;
testcase_cleanup[function_name] = cleanup
if startup_counter < cleanup_counter:
startup_list.append("NULL")
- startup_counter+=1
+ startup_counter+=1
elif startup_counter > cleanup_counter:
cleanup_list.append("NULL")
cleanup_counter+=1
-
-
-
+
+
+
#print startup_counter
#print cleanup_counter
#header_file = suite+'/' + tc +"/tct-" + tc + "-_" + profile + ".h"
f.write('extern int '+testcase_list[i]+'(void);\n')
f.write('\n')
f.write('testcase tc_array[] = {\n')
-
+
for i in range(testcase_counter):
f.write(' {"'+testcase_list[i]+'"' + ','+testcase_list[i]+','+testcase_startup[testcase_list[i]] + ',' + testcase_cleanup[testcase_list[i]] + '},\n')
f.write(' {NULL, NULL}\n')
if ( len(sys.argv) == 1):
profiles = ['mobile','wearable']
suites = ['itc','ctc','utc']
-
+
elif ( len(sys.argv) == 2):
if sys.argv[1] == "itc" or sys.argv[1] == "ctc" or sys.argv[1] == "utc":
suites = [sys.argv[1]]
tf=open(TFILE)
f=open(FILE, 'w')
-
+
f.write('//\n// Copyright (c) 2022 Samsung Electronics Co., Ltd.\n//\n// Licensed under the Apache License, Version 2.0 (the License);\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an "AS IS" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n')
f.write('#ifndef __'+HEADER_NAME+'__\n')
f.write('#define __'+HEADER_NAME+'__\n')
fields=line.strip('\n').split(',')
testcase_list.append(fields[0])
testcase_counter+=1
-
+
if ( (startup_counter == 0) or (startup_list[startup_counter-1] != fields[1]) ):
startup_list.append(fields[1])
startup_counter+=1
-
+
if ( (cleanup_counter == 0) or (cleanup_list[cleanup_counter-1] != fields[2]) ):
cleanup_list.append(fields[2])
cleanup_counter+=1