projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
803cf3b
)
ruby: added unified assert script
author
Derek Hower
<drh5@cs.wisc.edu>
Tue, 15 Sep 2009 16:32:11 +0000
(11:32 -0500)
committer
Derek Hower
<drh5@cs.wisc.edu>
Tue, 15 Sep 2009 16:32:11 +0000
(11:32 -0500)
src/mem/ruby/config/assert.rb
[new file with mode: 0644]
patch
|
blob
diff --git a/src/mem/ruby/config/assert.rb
b/src/mem/ruby/config/assert.rb
new file mode 100644
(file)
index 0000000..
cc3e432
--- /dev/null
+++ b/
src/mem/ruby/config/assert.rb
@@ -0,0
+1,18
@@
+#!/usr/bin/env ruby
+
+class AssertionFailure < RuntimeError
+ attr_reader :msg, :output
+ def initialize(message, out=nil)
+ @msg = message
+ @output = out
+ end
+end
+
+class NotImplementedException < Exception
+end
+
+def assert(condition,message)
+ unless condition
+ raise AssertionFailure.new(message), "\n\nAssertion failed: \n\n #{message}\n\n"
+ end
+end