forked from cristianstaicu/SecBench.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_file_format.py
43 lines (39 loc) · 1.36 KB
/
check_file_format.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# import glob
# import os
# folder_list = glob.glob("command-injection/*")
# # print(folder_list)
# for folder in folder_list:
# if os.path.isdir(folder):
# file_list = glob.glob(folder+"/*.test.js")
# if len(file_list)!=0:
# line_list=[]
# with open(file_list[0],"r+") as in_file:
# for line in in_file:
# line_list.append(line)
# # print(line_list)
# index_list = []
# # print(folder)
# for index in range(len(line_list)):
# if "file_exist = " in line_list[index]:
# index_list.append(index)
# # print(index_list)
# if len(index_list)==2:
# for i in range(index_list[0], index_list[1]+1):
# if "fs.unlinkSync" in line_list[i]:
# print(folder)
# print("Error!!!!")
line_list = []
with open("run_stat.txt") as in_file:
for line in in_file:
if(len(line.strip())>0):
line_list.append(line)
# print(line_list)
count = 0
for index in range(len(line_list)):
if "PASS" in line_list[index]:
if index+1<len(line_list):
if "PASS" not in line_list[index+1]:
print(line_list[index])
print(line_list[index+1])
count+=1
print(count)