lib/actir/parallel_tests/cli.rb in actir-1.2.7 vs lib/actir/parallel_tests/cli.rb in actir-1.2.8
- old
+ new
@@ -258,10 +258,16 @@
#根据传入的测试文件/文件夹的路径,获取测试工程的路径
def get_project_path(argv)
testcode_path = ""
(argv || []).map do |file_or_folder|
- test_path = File.join(Dir.pwd , file_or_folder)
+ # 如果传入的路径是绝对路径,那么直接将传入的路径作为test_path
+ if file_or_folder =~ /^\//
+ test_path = file_or_folder
+ # 如果传入的路径是相对路径,那么将当前路径与传入的相对路径做拼接生成test_path
+ else
+ test_path = File.join(Dir.pwd , file_or_folder)
+ end
#获取testcode文件夹的path
if test_path =~ /(\/.*\/testcode)/
testcode_path = $1
break
end