Merge pull request #1474 from firesim/fix-scala-test
Fix Scala test on machines with multiple simulators
This commit is contained in:
commit
5999fbec14
|
@ -114,8 +114,8 @@ class AutoCounterGlobalResetConditionF1Test
|
|||
simulationArgs = Seq("+autocounter-readrate=1000", "+autocounter-filename-base=autocounter"),
|
||||
) {
|
||||
|
||||
def assertCountsAreZero(filename: String, clockDivision: Int) {
|
||||
s"Counts reported in ${filename}" should "always be zero" in {
|
||||
def assertCountsAreZero(filename: String, clockDivision: Int, backend: String) {
|
||||
s"Counts reported in ${filename} in ${backend}" should "always be zero" in {
|
||||
val log = new File(genDir, s"/${filename}")
|
||||
val versionLine :: lines = extractLines(log, "", headerLines = 0).toList
|
||||
val sampleLines = lines.drop(AutoCounterVerificationConstants.headerLines - 1)
|
||||
|
@ -135,8 +135,8 @@ class AutoCounterGlobalResetConditionF1Test
|
|||
it should "run in the simulator" in {
|
||||
assert(run(backend, debug, args = simulationArgs) == 0)
|
||||
}
|
||||
assertCountsAreZero("autocounter0.csv", clockDivision = 1)
|
||||
assertCountsAreZero("autocounter1.csv", clockDivision = 2)
|
||||
assertCountsAreZero("autocounter0.csv", clockDivision = 1, backend)
|
||||
assertCountsAreZero("autocounter1.csv", clockDivision = 2, backend)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -155,8 +155,8 @@ class PrintfGlobalResetConditionTest
|
|||
simulationArgs = Seq("+print-no-cycle-prefix", "+print-file=synthprinttest.out"),
|
||||
) {
|
||||
|
||||
def assertSynthesizedLogEmpty(synthLog: String) {
|
||||
s"${synthLog}" should "be empty" in {
|
||||
def assertSynthesizedLogEmpty(synthLog: String, backend: String) {
|
||||
s"${synthLog} for ${backend}" should "be empty" in {
|
||||
val synthLogFile = new File(genDir, s"/${synthLog}")
|
||||
val lines = extractLines(synthLogFile, prefix = "")
|
||||
assert(lines.isEmpty)
|
||||
|
@ -164,12 +164,12 @@ class PrintfGlobalResetConditionTest
|
|||
}
|
||||
|
||||
override def defineTests(backend: String, debug: Boolean) {
|
||||
it should "run in the simulator" in {
|
||||
it should s"run in the ${backend} simulator" in {
|
||||
assert(run(backend, debug, args = simulationArgs) == 0)
|
||||
}
|
||||
// The log should be empty.
|
||||
assertSynthesizedLogEmpty("synthprinttest.out0")
|
||||
assertSynthesizedLogEmpty("synthprinttest.out1")
|
||||
assertSynthesizedLogEmpty("synthprinttest.out0", backend)
|
||||
assertSynthesizedLogEmpty("synthprinttest.out1", backend)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue