summaryrefslogtreecommitdiffstats
path: root/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests.rake
diff options
context:
space:
mode:
authorJoey Castillo <jose.castillo@gmail.com>2021-08-28 12:50:18 -0400
committerJoey Castillo <jose.castillo@gmail.com>2021-08-28 12:50:18 -0400
commit39a5c822a2a2e798e2e39ff8a98b7af84253026c (patch)
treefa157c98d3aea0d4f996e4415aa2a7ad1093ac05 /tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests.rake
parentc9e00b83bbdcb05058806d915ec4fff3cf4e596f (diff)
downloadSensor-Watch-39a5c822a2a2e798e2e39ff8a98b7af84253026c.tar.gz
Sensor-Watch-39a5c822a2a2e798e2e39ff8a98b7af84253026c.tar.bz2
Sensor-Watch-39a5c822a2a2e798e2e39ff8a98b7af84253026c.zip
add tinyusb
Diffstat (limited to 'tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests.rake')
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests.rake60
1 files changed, 60 insertions, 0 deletions
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests.rake
new file mode 100755
index 00000000..5d09c1af
--- /dev/null
+++ b/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests.rake
@@ -0,0 +1,60 @@
+require 'ceedling/constants'
+
+task :test => [:directories] do
+ Rake.application['test:all'].invoke
+end
+
+namespace TEST_SYM do
+
+ desc "Run all unit tests (also just 'test' works)."
+ 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 "Just build tests without running."
+ task :build_only => [:directories] do
+ @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, TEST_SYM, {:build_only => true})
+ 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
+