| VersionId | = | ::Version.parse("dev-util/uttk-0.4_p2#Teenager") | ||
| UTTK_MODULES | = | [] | ||
| S | = | Strategies | Modules shortcuts | |
| L | = | Loaders | ||
| D | = | Dumpers | ||
| F | = | Filters | ||
| W | = | Weights | ||
| DEFAULT_OPTIONS | = | { :observers => [], :backend => STDOUT.tty? ? 'DefaultColor' : 'Default', :loader => Loaders::Yaml, :wclass => Weights::Default, :attributes => {}, #FIXME: freeze :symbols => {}, #FIXME: freeze :log_severity => Logger::Severity::INFO, :log_verbosity => 0, :log_section => [], #FIXME: freeze :benchmark => false, :profile => false, :dump_status => false, :cache_mode => false, :cache_proc => DumpableProc.new('|test, status| status.pass? or (status.is_a? Uttk::SkipStatus and status.weight.pass?)' | Set default options |
| my_data | [R] | Contains the OCmd::Datas::Data object, the result of the command running. |
# File lib/uttk.rb, line 278 def self.bin Config::CONFIG["RUBY_INSTALL_NAME"].to_ocmd[dir.parent.parent + 'bin/uttk'] end
Return the default logger factory
# File lib/uttk.rb, line 256 def self.default_log ( options=default_options, log_factory=default_log_factory(options) ) log = log_factory.create options[:observers] << options[:backend] if options[:observers].empty? options[:observers].each do |backend| Filters[backend].each do |obsv| raise ObserverError, obsv unless obsv.respond_to? :update log.add_observer(obsv) end end log.info_basicObserver do log.add_observer(Uttk::Dumpers::Basic.new(STDERR)) nil end log end
Return the default logger factory
# File lib/uttk.rb, line 242 def self.default_log_factory ( options=default_options ) log_factory = LoggerFactory.new if ENV.has_key?('UTTK_SEVERITY') log_factory.severity_level = ENV['UTTK_SEVERITY'] else log_factory.severity_level = options[:log_severity] end log_factory.verbosity_level = options[:log_verbosity] log_factory.section_tree << Logger::SectionNode.new('basicObserver') log_factory.active_section = options[:log_section] log_factory end
Return the default symbol table
# File lib/uttk.rb, line 221 def self.default_symtbl ( options=default_options, log_factory=default_log_factory(options), log=default_log(options, log_factory)) symtbl = SymTbl.new(options) symtbl[:uttk] = Pathname.new($0).expand_path symtbl[:ruby] = Config::CONFIG['RUBY_INSTALL_PATH'] symtbl['uttk-unit''uttk-unit'] = symtbl[:uttk_unit] = (Uttk.dir.parent.parent/'bin'/'uttk-unit').expand_path.cleanpath symtbl[:core_ex] = CoreEx.dir symtbl[:symtbl_class] = symtbl.class symtbl[:pwd] = Pathname.pwd.expand_path symtbl[:loader] = options[:loader].new symtbl[:log_factory] = log_factory symtbl[:log] = log symtbl[:cache] = {} symtbl[:cache_proc] = options[:cache_proc] symtbl[:suite_name] = 'root' symtbl end
# File lib/uttk.rb, line 144 def self.setup_autoload_all UTTK_MODULES.each do |uttk_module| uttk_module.setup_autoload end end
Autoload modules
# File lib/uttk.rb, line 88 def pathname_to_class(p) const = p.basename.to_s.sub(/\.rb$/, '') if const =~ ConstRegexp::RB_CONST const else raise(ArgumentError, "`#{p.to_s}' - your file doesn't follow our convention, " + "the filename must be equal to the class name you declared into.") nil end end
# File lib/uttk/generators/templates/strategy-command.rb, line 44 def abort_hook @runner.abort @my_data if @runner and defined? @my_data super end
# File lib/uttk/generators/templates/strategy-command.rb, line 33 def assertion assert_cmd UM::StreamMatcher, @my_data, :output => ..., :error => ..., :exit => ... # ... pass end
# File lib/uttk/generators/templates/strategy-command.rb, line 51 def epilogue @my_data.clean if defined? @my_data super end