config/commands.rb in origen_ahb-0.2.2 vs config/commands.rb in origen_ahb-0.2.3
- old
+ new
@@ -23,11 +23,11 @@
when 'specs'
require 'rspec'
exit RSpec::Core::Runner.run(['spec'])
-when 'examples'
+when 'examples', 'test'
Origen.load_application
status = 0
# Pattern generator tests
ARGV = %w(example -t dev -r approved)
@@ -42,16 +42,23 @@
else
Origen.app.stats.report_fail
status = 1
end
puts
+ if @command == 'test'
+ Origen.app.unload_target!
+ require 'rspec'
+ result = RSpec::Core::Runner.run(['spec'])
+ status = status == 1 ? 1 : result
+ end
exit status # Exit with a 1 on the event of a failure per std unix result codes
# Always leave an else clause to allow control to fall back through to the
# RGen command handler.
else
@application_commands = <<-EOT
specs Run the specs (tests), -c will enable coverage
examples Run the examples (tests), -c will enable coverage
+ test Run both specs and examples, -c will enable coverage
EOT
end