Sha256: 7628dc4896c41be5bd0b09ef825091bbe13a1299d696f5e5b18e9b661b25f877

Contents?: true

Size: 1.72 KB

Versions: 14

Compression:

Stored size: 1.72 KB

Contents

require 'constants'


namespace TEST_SYM do
  
  desc "Run all unit tests."
  task :all => [:directories] do
    @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS)
  end

  desc "Run single test ([*] real test or source file name, no path)."
  task :* do
    message = "\nOops! '#{TEST_ROOT_NAME}:*' isn't a real task. " +
              "Use a real test or source file name (no path) in place of the wildcard.\n" +
              "Example: rake #{TEST_ROOT_NAME}:foo.c\n\n"
  
    @ceedling[:streaminator].stdout_puts( message )
  end
  
  desc "Run tests for changed files."
  task :delta => [:directories] do
    @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, TEST_SYM, {:force_run => false})
  end
  
  desc "Run tests by matching regular expression pattern."
  task :pattern, [:regex] => [:directories] do |t, args|
    matches = []
    
    COLLECTION_ALL_TESTS.each { |test| matches << test if (test =~ /#{args.regex}/) }
  
    if (matches.size > 0)
      @ceedling[:test_invoker].setup_and_invoke(matches, TEST_SYM, {:force_run => false})
    else
      @ceedling[:streaminator].stdout_puts("\nFound no tests matching pattern /#{args.regex}/.")
    end
  end

  desc "Run tests whose test path contains [dir] or [dir] substring."
  task :path, [:dir] => [:directories] do |t, args|
    matches = []
    
    COLLECTION_ALL_TESTS.each { |test| matches << test if File.dirname(test).include?(args.dir.gsub(/\\/, '/')) }
  
    if (matches.size > 0)
      @ceedling[:test_invoker].setup_and_invoke(matches, TEST_SYM, {:force_run => false})
    else
      @ceedling[:streaminator].stdout_puts("\nFound no tests including the given path or path component.")
    end
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ceedling-0.13.0 lib/tasks_tests.rake
ceedling-0.13.0.rc1 lib/tasks_tests.rake
ceedling-0.12.2 new_project_template/vendor/ceedling/lib/tasks_tests.rake
ceedling-0.12.1 new_project_template/vendor/ceedling/lib/tasks_tests.rake
ceedling-0.12.0 new_project_template/vendor/ceedling/lib/tasks_tests.rake
ceedling-0.11.2 new_project_template/vendor/ceedling/lib/tasks_tests.rake
ceedling-0.11.1 new_project_template/vendor/ceedling/lib/tasks_tests.rake
ceedling-0.11.0 new_project_template/vendor/ceedling/lib/tasks_tests.rake
ceedling-0.10.0 new_project_template/vendor/ceedling/lib/tasks_tests.rake
ceedling-0.9.4 new_project_template/vendor/ceedling/lib/tasks_tests.rake
ceedling-0.9.2 new_project_template/vendor/ceedling/lib/tasks_tests.rake
ceedling-0.9.0 new_project_template/vendor/ceedling/lib/tasks_tests.rake
ceedling-0.0.18 new_project_template/vendor/ceedling/lib/tasks_tests.rake
ceedling-0.0.17 new_project_template/vendor/ceedling/lib/tasks_tests.rake