@@ -477,14 +477,32 @@ object Build {
477477
478478 testCompilation := Def .inputTaskDyn {
479479 val args = spaceDelimited(" <arg>" ).parsed
480- val updateCheckfile = args.contains(" --update-checkfiles" )
481- val fromTasty = args.contains(" --from-tasty" )
482- val args1 = if (updateCheckfile | fromTasty) args.filter(x => x != " --update-checkfiles" && x != " --from-tasty" ) else args
483- val test = if (fromTasty) " dotty.tools.dotc.FromTastyTests" else " dotty.tools.dotc.*CompilationTests"
484- val cmd = s " $test -- --exclude-categories=dotty.SlowTests " +
485- (if (updateCheckfile) " -Ddotty.tests.updateCheckfiles=TRUE" else " " ) +
486- (if (args1.nonEmpty) " -Ddotty.tests.filter=" + args1.mkString(" " ) else " " )
487- (testOnly in Test ).toTask(cmd)
480+ if (args.contains(" --help" )) {
481+ println(
482+ s """
483+ |usage: testCompilation [--help] [--from-tasty] [--update-checkfiles] [<filter>]
484+ |
485+ |By default runs tests in dotty.tools.dotc.*CompilationTests excluding tests tagged with dotty.SlowTests.
486+ |
487+ | --help show this message
488+ | --from-tasty runs tests in dotty.tools.dotc.FromTastyTests
489+ | --update-checkfiles override the checkfiles that did not match with the current output
490+ | <filter> substring of the path of the tests file
491+ |
492+ """ .stripMargin
493+ )
494+ (testOnly in Test ).toTask(" not.a.test" )
495+ }
496+ else {
497+ val updateCheckfile = args.contains(" --update-checkfiles" )
498+ val fromTasty = args.contains(" --from-tasty" )
499+ val args1 = if (updateCheckfile | fromTasty) args.filter(x => x != " --update-checkfiles" && x != " --from-tasty" ) else args
500+ val test = if (fromTasty) " dotty.tools.dotc.FromTastyTests" else " dotty.tools.dotc.*CompilationTests"
501+ val cmd = s " $test -- --exclude-categories=dotty.SlowTests " +
502+ (if (updateCheckfile) " -Ddotty.tests.updateCheckfiles=TRUE" else " " ) +
503+ (if (args1.nonEmpty) " -Ddotty.tests.filter=" + args1.mkString(" " ) else " " )
504+ (testOnly in Test ).toTask(cmd)
505+ }
488506 }.evaluated,
489507
490508 dotr := {
0 commit comments