File: ruby-tests.rb

package info (click to toggle)
ruby-gsl 1.15.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,528 kB
  • ctags: 6,328
  • sloc: ansic: 62,164; ruby: 17,917; makefile: 18; sh: 15
file content (19 lines) | stat: -rw-r--r-- 557 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$LOAD_PATH << File.expand_path("lib/")

EXPANDED_LOAD_PATH=$LOAD_PATH.map { |d| File.expand_path d }
EXCLUDED_TESTS=["tests/sf/make_test.rb",
                "tests/speed/bench.rb",
                "tests/tensor.rb"
               ]

oldpath = Dir.getwd
(Dir["tests/**/*.rb"]-EXCLUDED_TESTS).each do |f|
  puts "*** running #{f} ***"
  dir, filename = File.split f
  begin
    Dir.chdir File.expand_path(dir)
    system("#{ENV['RUBY_TEST_BIN']} -I#{EXPANDED_LOAD_PATH.join(":")} #{filename}") || exit($?.exitstatus)
  ensure
    Dir.chdir oldpath
  end
end