summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2011-12-07 00:57:52 +0200
committerZahary Karadjov <zahary@gmail.com>2011-12-07 00:57:52 +0200
commite13a610ad42ef4d5d0222a2a942682d35e405dc7 (patch)
tree7d277754c6d31c85698445d2db0a7d8ee068602f
parent0e609d2101535b4ca2640b68890b2c575ed3678d (diff)
downloadNim-e13a610ad42ef4d5d0222a2a942682d35e405dc7.tar.gz
The test runner will print out encountered exceptions
-rw-r--r--lib/pure/unittest.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim
index e2906dd1a..f9981195c 100644
--- a/lib/pure/unittest.nim
+++ b/lib/pure/unittest.nim
@@ -70,6 +70,10 @@ template test*(name: expr, body: stmt): stmt =
       TestSetupIMPL()

       body

 

+    except:

+      checkpoint("Unhandled exception: " & getCurrentExceptionMsg())

+      fail()

+

     finally:

       TestTeardownIMPL()

       testDone name, TestStatusIMPL

='n4' href='#n4'>4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48