-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest.py
27 lines (23 loc) · 917 Bytes
/
test.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
# -*- coding: utf-8 -*-
# @Author: Yo Ka
import os
VM = 'd:/code/cabin/build/cabin.exe -cp "d:/code/cabin/test-classes/out/production/test-classes" '
if __name__ == '__main__':
for e in os.walk('./test-classes/src'):
# e[0] # 目录名
# e[1] # 此目录下的所有子目录
# e[2] # 此目录下的所有文件
for f in e[2]:
class_name = e[0].replace('/', '.')
class_name = class_name.replace('\\', '.')
i = class_name.find('src.')
if i == -1: # 根目录
class_name = f
else:
class_name = class_name[i+4:] # jump 'src.'
class_name = class_name + "." + f
i = class_name.rfind('.java')
if i != -1:
class_name = class_name[:i]
print("---Test: " + class_name)
os.system(VM + class_name)