Commit 28b71a00 authored by Jens Korinth's avatar Jens Korinth
Browse files

Move individual test outputs to own subdir

* each suite now has a subdir
* each test has subdir within suite dir
parent 6fc06386
......@@ -3,6 +3,7 @@ import org.scalatest.junit.JUnitSuite
import org.junit.Test
import org.junit.Assert._
import scala.math._
import java.nio.file.Paths
/**
* DataWidthConverterHarness: Attaches data source to DWC.
......@@ -114,7 +115,11 @@ class DataWidthConverterSuite extends JUnitSuite {
def resize(inWidth: Int, outWidth: Int, littleEndian: Boolean = true) = {
println("testing conversion of %d bit to %d bit, %s ..."
.format(inWidth, outWidth, if (littleEndian) "little-endian" else "big-endian"))
chiselMainTest(Array("--genHarness", "--backend", "c", "--vcd", "--targetDir", "test", "--compile", "--test"),
val dir = Paths.get("test")
.resolve("DataWidthConverterSuite")
.resolve("%dto%d%s".format(inWidth, outWidth, if (littleEndian) "le" else "be"))
.toString
chiselMainTest(Array("--genHarness", "--backend", "c", "--vcd", "--targetDir", dir, "--compile", "--test"),
() => Module(new DataWidthConverterHarness(inWidth, outWidth, littleEndian)))
{ m => new DataWidthConverter_OutputCheck(m) }
}
......
......@@ -44,7 +44,7 @@ class DecoupledDataSourceSuite extends JUnitSuite {
val width = Seq(1, (scala.math.random * 64).toInt).max
val repeat = scala.math.random > 0.5
println("testing cnt = %d, width = %d, repeat = %b ...".format(cnt, width, repeat))
chiselMainTest(Array("--genHarness", "--backend", "c", "--vcd", "--targetDir", "test", "--compile", "--test"),
chiselMainTest(Array("--genHarness", "--backend", "c", "--vcd", "--targetDir", "test/DecoupledDataSourceSuite/checkRandomOutputs", "--compile", "--test"),
() => Module(new DecoupledDataSource(UInt(width = width), cnt, i => UInt((scala.math.random * scala.math.pow(2, width)).toInt), repeat)))
{ m => new DecoupledDataSource_OutputCheck(m) }
}
......@@ -52,14 +52,14 @@ class DecoupledDataSourceSuite extends JUnitSuite {
/** Performs test for 8bit wide sequential data with repeat. **/
@Test def checkSequentialOutputsWithRepeat {
chiselMainTest(Array("--genHarness", "--backend", "c", "--vcd", "--targetDir", "test", "--compile", "--test"),
chiselMainTest(Array("--genHarness", "--backend", "c", "--vcd", "--targetDir", "test/DecoupledDataSourceSuite/checkSequentialOutputsWithRepeat", "--compile", "--test"),
() => Module(new DecoupledDataSource(UInt(width = 8), 256, i => UInt(i), true)))
{ m => new DecoupledDataSource_OutputCheck(m) }
}
/** Performs test for 8bit wide sequential data without repeat. **/
@Test def checkSequentialOutputsWithoutRepeat {
chiselMainTest(Array("--genHarness", "--backend", "c", "--vcd", "--targetDir", "test", "--compile", "--test"),
chiselMainTest(Array("--genHarness", "--backend", "c", "--vcd", "--targetDir", "test/DecoupledDataSourceSuite/checkSequentialOutputWithoutRepeat", "--compile", "--test"),
() => Module(new DecoupledDataSource(UInt(width = 8), 256, i => UInt(i), false)))
{ m => new DecoupledDataSource_OutputCheck(m) }
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment