Commit 2787bfa8 authored by Kunshan Wang's avatar Kunshan Wang

Making reader specs abstract.

parent 207c26b2
package uvm.ir.textinput
import org.scalatest._
import uvm._
trait AbstractReaderSpec extends FlatSpec with Matchers {
def parseFile(fileName: String): Bundle
def theSubject: String
behavior of theSubject
it should "read simple type definitions" in {
val b = parseFile("tests/uvm-parsing-test/types.uir")
}
it should "read simple constant definitions" in {
val b = parseFile("tests/uvm-parsing-test/constants.uir")
}
it should "read simple function definitions" in {
val b = parseFile("tests/uvm-parsing-test/functions.uir")
}
it should "read simple instruction definitions" in {
val b = parseFile("tests/uvm-parsing-test/instructions.uir")
}
}
\ No newline at end of file
package uvm.ir.textinput
import org.scalatest.FlatSpec
import org.scalatest.Matchers
import org.scalatest._
import uvm.Bundle
class UvmIRReaderSpec extends FlatSpec with Matchers {
class UvmIRReaderSpec extends AbstractReaderSpec {
override def theSubject = "UvmIRReader"
def parseFile(fileName: String): Bundle = {
override def parseFile(fileName: String): Bundle = {
UvmIRReader.read(new java.io.FileReader(fileName))
}
"The IRParser" should "parse simple type definitions" in {
parseFile("tests/uvm-parsing-test/types.uir")
}
it should "parse simple constant definitions" in {
parseFile("tests/uvm-parsing-test/constants.uir")
}
it should "parse simple function definitions" in {
parseFile("tests/uvm-parsing-test/functions.uir")
}
it should "parse simple instruction definitions" in {
parseFile("tests/uvm-parsing-test/instructions.uir")
}
}
\ No newline at end of file
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