@@ -145,23 +145,19 @@ cd $0.runfiles
145145 output = ctx .outputs .executable ,
146146 content = content )
147147
148- def _args_for_suites (suites ):
149- args = ["-o" ]
150- for suite in suites :
151- args .extend (["-s" , suite ])
152- return args
153-
154148def _write_test_launcher (ctx , jars ):
149+ if len (ctx .attr .suites ) != 0 :
150+ print ("suites attribute is deprecated. All scalatest test suites are run" )
151+
155152 content = """#!/bin/bash
156153cd $0.runfiles
157154{java} -cp {cp} {name} {args} "$@"
158155"""
159156 content = content .format (
160157 java = ctx .file ._java .path ,
158+ cp = ":" .join ([j .short_path for j in jars ]),
161159 name = ctx .attr .main_class ,
162- args = ' ' .join (_args_for_suites (ctx .attr .suites )),
163- deploy_jar = ctx .outputs .jar .path ,
164- cp = ":" .join ([j .short_path for j in jars ]))
160+ args = "-R \" {path}\" -oWDF" .format (path = ctx .outputs .jar .short_path ))
165161 ctx .file_action (
166162 output = ctx .outputs .executable ,
167163 content = content )
@@ -319,7 +315,7 @@ scala_test = rule(
319315 implementation = _scala_test_impl ,
320316 attrs = {
321317 "main_class" : attr .string (default = "org.scalatest.tools.Runner" ),
322- "suites" : attr .string_list (non_empty = True , mandatory = True ),
318+ "suites" : attr .string_list (),
323319 "_scalatest" : attr .label (executable = True , default = Label ("@scalatest//file" ), single_file = True , allow_files = True ),
324320 "_java" : attr .label (executable = True , default = Label ("@bazel_tools//tools/jdk:java" ), single_file = True , allow_files = True ),
325321 } + _implicit_deps + _common_attrs ,
0 commit comments