class MTBuild::TestApplicationConfiguration

Use this class to create test application configurations. You won't typically instantiate this directly. Instead, the TestApplicationProject.add_configuration method will create this for you.

Public Instance Methods

configure_tasks() click to toggle source

Create the actual Rake tasks that will perform the configuration's work

# File lib/mtbuild/test_application_configuration.rb, line 10
def configure_tasks
  super
  all_object_files = []
  all_object_folders = []
  @toolchains.each do |toolchain, sources|
    object_files, object_folders = toolchain.create_compile_tasks(sources)
    all_object_files |= object_files
    all_object_folders |= object_folders
  end

  project_filename = @parent_project.project_name.to_s.gsub(':','-')
  application_binaries, application_files, application_folders = @default_toolchain.create_application_tasks(all_object_files, project_filename)
  dependencies = @dependencies+all_object_folders+application_folders+application_files+application_binaries

  desc "Build and run test application '#{@parent_project.project_name}' with configuration '#{@configuration_name}'"
  new_task = test_application_task @configuration_name => dependencies do |t|
    @post_build.call if @post_build.respond_to? :call
    puts "built test application #{t.name}."
    sh "\"#{application_binaries.first}\""
    puts "ran test application #{t.name}."
  end
end