diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-19 18:04:20 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-19 18:04:20 +0000 |
| commit | 3891f48119ea01d04d7495cf2f07a9ddb37b2afc (patch) | |
| tree | 564c02bc5cc3498a440ddea80e96a8852791c528 /test/Rakefile | |
| parent | dcab464f8db80e6d8c91a595a77875222f2927bf (diff) | |
| download | puppet-3891f48119ea01d04d7495cf2f07a9ddb37b2afc.tar.gz puppet-3891f48119ea01d04d7495cf2f07a9ddb37b2afc.tar.xz puppet-3891f48119ea01d04d7495cf2f07a9ddb37b2afc.zip | |
Converting to using the Rakefile for testing. The old 'test' script is
now deprecated, and I'll send an email to the dev list and update the
docs to reflect that.
This still isn't the final solution, because the module structure is a
bit weird, but at least it's a starting point, and everything from here
on out is small changes, as opposed to large architectural changes.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1632 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/Rakefile')
| -rw-r--r-- | test/Rakefile | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/test/Rakefile b/test/Rakefile index e1fc374b0..463c7a9a1 100644 --- a/test/Rakefile +++ b/test/Rakefile @@ -7,26 +7,19 @@ $exclusions = %W(lib data) $test_dirs = [] # this is used to generate all the targets. $test_files = [] # this is ONLY used for the top-level test suite. -# this basically amounts to: -# find $(pwd) -type d -maxdepth 1 | xargs basename -# with an exclusion list. +# Collect all of our test directories, skipping specifically excluded dirs. +$test_dirs = Dir.glob("*").find_all { |f| directory?(f) }.reject { |d| + $exclusions.include?(File.basename(d)) +} -find(Dir.pwd) do |path| - if File.basename(path) =~ /^\.+/ - prune - elsif path != Dir.pwd and directory? path and !$exclusions.include? File.basename(path) - $test_dirs.push File.basename(path) - prune - end -end - -# another find for the test files themselves: this could probably be rolled into the original find loop. +# another find for the test files themselves: this could probably be rolled +# into the original find loop. $test_dirs.each do |dir| find(dir) do |path| if File.basename(path) =~ /^\.+/ prune - elsif path != dir and !directory? path + elsif path != dir and ! directory?(path) $test_files.push path end end @@ -35,12 +28,14 @@ end desc "Run the full test suite" Rake::TestTask.new 'test' do |t| t.libs << 'lib' - t.test_files = $test_files.dup + t.test_files = $test_files.sort t.verbose = true end #task :test => $test_dirs -$test_dirs.each do |path| +task :default => :test + +$test_dirs.sort.each do |path| files = [] find(path) do |file| @@ -53,7 +48,7 @@ $test_dirs.each do |path| Rake::TestTask.new path.to_sym do |t| t.libs << 'lib' - t.test_files = files + t.test_files = files.sort t.verbose = true end @@ -69,3 +64,5 @@ $test_dirs.each do |path| end end end + +# $Id$ |
