From e951966eddb81d6cc895abb51f2981327494ab12 Mon Sep 17 00:00:00 2001 From: Jiuyang Liu Date: Sun, 22 Oct 2023 02:48:29 +0800 Subject: [PATCH] add tests.sc to split tests from common.sc --- build.sc | 1 + tests.sc | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 tests.sc diff --git a/build.sc b/build.sc index 825c1907d57..2c64d604685 100644 --- a/build.sc +++ b/build.sc @@ -6,6 +6,7 @@ import mill.scalalib.scalafmt._ import coursier.maven.MavenRepository import mill.scalalib.api.ZincWorkerUtil.matchingVersions import $file.common +import $file.tests import $file.project.Boilerplate object v { diff --git a/tests.sc b/tests.sc new file mode 100644 index 00000000000..915c312d02f --- /dev/null +++ b/tests.sc @@ -0,0 +1,79 @@ +import mill._ +import mill.scalalib._ +import $file.common + +trait SvsimUnitTestModule + extends TestModule + with ScalaModule + with TestModule.ScalaTest { + def svsimModule: common.SvsimModule + + def scalatestIvy: Dep + + def scalacheckIvy: Dep + + override def moduleDeps = Seq(svsimModule) + + override def defaultCommandName() = "test" + + override def ivyDeps = super.ivyDeps() ++ Agg( + scalatestIvy, + scalacheckIvy + ) +} + +trait FirrtlUnitTestModule + extends TestModule + with ScalaModule + with TestModule.ScalaTest { + def firrtlModule: common.FirrtlModule + + def scalatestIvy: Dep + + def scalacheckIvy: Dep + + override def moduleDeps = Seq(firrtlModule) + + override def defaultCommandName() = "test" + + override def ivyDeps = super.ivyDeps() ++ Agg( + scalatestIvy, + scalacheckIvy + ) +} + +trait ChiselUnitTestModule + extends TestModule + with ScalaModule + with common.HasChisel + with common.HasMacroAnnotations + with TestModule.ScalaTest { + def scalatestIvy: Dep + + def scalacheckIvy: Dep + + override def defaultCommandName() = "test" + + override def ivyDeps = super.ivyDeps() ++ Agg( + scalatestIvy, + scalacheckIvy + ) +} + +trait CIRCTPanamaBinderModuleTestModule + extends TestModule + with ScalaModule + with common.HasCIRCTPanamaBinderModule + with common.HasMacroAnnotations + with TestModule.ScalaTest { + def scalatestIvy: Dep + + def scalacheckIvy: Dep + + override def defaultCommandName() = "test" + + override def ivyDeps = super.ivyDeps() ++ Agg( + scalatestIvy, + scalacheckIvy + ) +}