Fix duplicated testnames if running on machine with both VCS/Verilator

This commit is contained in:
abejgonzalez 2023-03-18 14:38:40 -07:00
parent f3bf5072bb
commit 66fce79be5
2 changed files with 9 additions and 9 deletions

View File

@ -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)
}
}

View File

@ -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)
}
}