diff options
| author | Schuyler Eldridge | 2020-06-22 19:59:44 -0400 |
|---|---|---|
| committer | Schuyler Eldridge | 2020-06-22 20:00:10 -0400 |
| commit | b5e59895e13550006fd8e951b7e9483de00f82dd (patch) | |
| tree | ac43010dd7fc2a14303497f95e12f2a40bb16d0e /src/test/scala/chiselTests | |
| parent | 5af61d80de763c846d3179d57506b064157605a0 (diff) | |
Clarify chiselTests.Utils.extractCause Scaladoc
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Diffstat (limited to 'src/test/scala/chiselTests')
| -rw-r--r-- | src/test/scala/chiselTests/ChiselSpec.scala | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/test/scala/chiselTests/ChiselSpec.scala b/src/test/scala/chiselTests/ChiselSpec.scala index 04c35f32..2ee6fbcf 100644 --- a/src/test/scala/chiselTests/ChiselSpec.scala +++ b/src/test/scala/chiselTests/ChiselSpec.scala @@ -270,11 +270,19 @@ trait Utils { } } - /** Run some code extracting an exception cause that matches a type parameter + /** Run some code and rethrow an exception with a specific type if an exception of that type occurs anywhere in the + * stack trace. + * + * This is useful for "extracting" one exception that may be wrapped by other exceptions. + * + * Example usage: + * {{{ + * a [ChiselException] should be thrownBy extractCause[ChiselException] { /* ... */ } + * }}} + * * @param thunk some code to run - * @tparam A the type of the exception to expect + * @tparam A the type of the exception to extract * @return nothing - * @throws the exception of type parameter A if it was found */ def extractCause[A <: Throwable : ClassTag](thunk: => Any): Unit = { def unrollCauses(a: Throwable): Seq[Throwable] = a match { |
