Skip to content

Commit 7807892

Browse files
authored
allows for custom AnnotatedTestInput (#862)
1 parent fd69751 commit 7807892

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/test/scala/AnnotationBasedTestSuite.scala

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ abstract class AnnotationBasedTestSuite extends ResourceBasedTestSuite {
2929
*/
3030
def systemsUnderTest: Seq[SystemUnderTest]
3131

32-
def buildTestInput(file: Path, prefix: String): DefaultAnnotatedTestInput =
32+
def buildTestInput(file: Path, prefix: String): AnnotatedTestInput =
3333
DefaultAnnotatedTestInput(file, prefix)
3434

3535
/** Registers a given test input for a given system under test. */
@@ -221,6 +221,8 @@ trait AnnotatedTestInput extends TestInput {
221221

222222
/** Create a test input that is specific to the given project. */
223223
def makeForProject(projectInfo: ProjectInfo): AnnotatedTestInput
224+
225+
def copyWithFiles(files: Seq[Path]): AnnotatedTestInput
224226
}
225227

226228
/** Test input that also includes test annotations. */
@@ -244,6 +246,8 @@ case class DefaultAnnotatedTestInput(
244246
tags = projectInfo.projectNames.map(Tag(_)) ++ tags.toList,
245247
annotations = annotations.filterByProject(projectInfo))
246248
}
249+
250+
def copyWithFiles(files: Seq[Path]): DefaultAnnotatedTestInput = copy(files = files)
247251
}
248252

249253
object DefaultAnnotatedTestInput extends TestAnnotationParser {

src/test/scala/SingleFileSilSuite.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ trait SingleFileSilSuite extends SilSuite {
2424
def frontend(verifier: Verifier, input: String): Frontend
2525

2626
override def buildTestInput(file: Path, prefix: String) =
27-
super.buildTestInput(file, prefix).copy(files = Seq(file))
27+
super.buildTestInput(file, prefix).copyWithFiles(files = Seq(file))
2828
}

0 commit comments

Comments
 (0)