Class: CIAT::RakeTask

Inherits:
Object
  • Object
show all
Defined in:
lib/ciat/rake_task.rb

Overview

A Rake Task for a Suite of Tests

This is the class to use in your Rakefile. The simplest use looks like this:

CIAT::RakeTask(:name_of_task) do |t|
  t.processors << compiler
  t.processors << executor
end

Define compiler and executor in the Rakefile to return a compiler and executor, respectively. :name_of_task is (as I try to make clear by its name) the name of the rake task. If you leave out this name, it defaults to :ciat. The options on t correspond directly to the options of CIAT::Suite. See CIAT::Suite for defaults and details.

  • t.processors is required and specifies the processors to be executed; order matters! Use = to assign a list of processors; use &lt;&lt; to push processors onto the existing list of processors.

  • t.folder specifies folders to search for test files.

  • t.files is an array of specific files.

  • t.report_filename is the name of the report

  • t.feedback specifies a feedback mechanism

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :ciat) {|_self| ... } ⇒ RakeTask

Returns a new instance of RakeTask.

Yields:

  • (_self)

Yield Parameters:



35
36
37
38
39
40
# File 'lib/ciat/rake_task.rb', line 35

def initialize(name = :ciat)
  @name = name
  @processors = []
  yield self if block_given?
  define
end

Instance Attribute Details

#feedbackObject

Returns the value of attribute feedback.



29
30
31
# File 'lib/ciat/rake_task.rb', line 29

def feedback
  @feedback
end

#filesObject

Returns the value of attribute files.



28
29
30
# File 'lib/ciat/rake_task.rb', line 28

def files
  @files
end

#folderObject

Returns the value of attribute folder.



30
31
32
# File 'lib/ciat/rake_task.rb', line 30

def folder
  @folder
end

#output_folderObject

Returns the value of attribute output_folder.



33
34
35
# File 'lib/ciat/rake_task.rb', line 33

def output_folder
  @output_folder
end

#processorsObject

Returns the value of attribute processors.



27
28
29
# File 'lib/ciat/rake_task.rb', line 27

def processors
  @processors
end

#report_filenameObject

Returns the value of attribute report_filename.



31
32
33
# File 'lib/ciat/rake_task.rb', line 31

def report_filename
  @report_filename
end

#report_titleObject

Returns the value of attribute report_title.



32
33
34
# File 'lib/ciat/rake_task.rb', line 32

def report_title
  @report_title
end

Instance Method Details

#defineObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ciat/rake_task.rb', line 42

def define
  desc "Run CIAT tests" + (@name==:test ? "" : ", #{@name}")
  task @name do
    suite = CIAT::Suite.new(
      :processors => @processors,
      :files => @files,
      :feedback => @feedback,
      :folder => @folder,
      :report_filename => @report_filename,
      :output_folder => @output_folder,
      :report_title => @report_title)
    suite.run
  end
end