regressiontest 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - jruby-19mode # JRuby in 1.9 mode
6
+ - rbx-19mode
7
+ # - 1.8.7
8
+ # - jruby-18mode # JRuby in 1.8 mode
9
+ # - rbx-18mode
10
+
11
+ # uncomment this line if your project needs to run something other than `rake`:
12
+ # script: bundle exec rspec spec
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "shoulda", ">= 0"
10
+ gem "rdoc", "~> 3.12"
11
+ gem "cucumber", ">= 0"
12
+ gem "jeweler", "~> 1.8.3"
13
+ gem "bundler", ">= 1.0.21"
14
+ gem "bio", ">= 1.4.2"
15
+ gem "rdoc", "~> 3.12"
16
+ end
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Pjotr Prins
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,47 @@
1
+ # regressiontest
2
+
3
+ [![Build Status](https://secure.travis-ci.org/pjotrp/regressiontest.png)](http://travis-ci.org/pjotrp/regressiontest)
4
+
5
+ Full description goes here
6
+
7
+ Note: this software is under active development!
8
+
9
+ ## Installation
10
+
11
+ ```sh
12
+ gem install regressiontest
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```ruby
18
+ require 'regressiontest'
19
+ ```
20
+
21
+ The API doc is online. For more code examples see the test files in
22
+ the source tree.
23
+
24
+ ## Project home page
25
+
26
+ Information on the source tree, documentation, examples, issues and
27
+ how to contribute, see
28
+
29
+ http://github.com/pjotrp/regressiontest
30
+
31
+ The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.
32
+
33
+ ## Cite
34
+
35
+ If you use this software, please cite one of
36
+
37
+ * [BioRuby: bioinformatics software for the Ruby programming language](http://dx.doi.org/10.1093/bioinformatics/btq475)
38
+ * [Biogem: an effective tool-based approach for scaling up open source software development in bioinformatics](http://dx.doi.org/10.1093/bioinformatics/bts080)
39
+
40
+ ## Biogems.info
41
+
42
+ This Biogem is published at [#regressiontest](http://biogems.info/index.html)
43
+
44
+ ## Copyright
45
+
46
+ Copyright (c) 2012 Pjotr Prins. See LICENSE.txt for further details.
47
+
@@ -0,0 +1,48 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "regressiontest"
18
+ gem.homepage = "http://github.com/pjotrp/regressiontest"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Functional (regression) testing library}
21
+ gem.description = %Q{Regression testing for the command line, and library API}
22
+ gem.email = "pjotr.public01@thebird.nl"
23
+ gem.authors = ["Pjotr Prins"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
34
+
35
+ require 'cucumber/rake/task'
36
+ Cucumber::Rake::Task.new(:features)
37
+
38
+ task :default => :test
39
+
40
+ require 'rdoc/task'
41
+ Rake::RDocTask.new do |rdoc|
42
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
43
+
44
+ rdoc.rdoc_dir = 'rdoc'
45
+ rdoc.title = "regressiontest #{version}"
46
+ rdoc.rdoc_files.include('README*')
47
+ rdoc.rdoc_files.include('lib/**/*.rb')
48
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # BioRuby regressiontest Plugin BioRegressiontest
4
+ # Author:: Pjotr Prins
5
+ # Copyright:: 2012
6
+
7
+ USAGE = "Describe regressiontest"
8
+
9
+ gempath = File.dirname(File.dirname(__FILE__))
10
+ $: << File.join(gempath,'lib')
11
+
12
+ VERSION_FILENAME=File.join(gempath,'VERSION')
13
+ version = File.new(VERSION_FILENAME).read.chomp
14
+
15
+ # print banner
16
+ print "regressiontest #{version} by Pjotr Prins 2012\n"
17
+
18
+ if ARGV.size == 0
19
+ print USAGE
20
+ end
21
+
22
+ require 'regressiontest'
23
+ require 'optparse'
24
+
25
+ # Uncomment when using the bio-logger
26
+ # require 'bio-logger'
27
+ # log = Bio::Log::LoggerPlus.new 'regressiontest'
28
+ # log.outputters = Bio::Log::Outputter.stderr
29
+ # Bio::Log::CLI.logger('stderr')
30
+ # Bio::Log::CLI.trace('info')
31
+
32
+ options = {:example_switch=>false,:show_help=>false}
33
+ opts = OptionParser.new do |o|
34
+ o.banner = "Usage: #{File.basename($0)} [options] filename\ne.g. #{File.basename($0)} test.txt"
35
+
36
+ o.on('--example_parameter [EXAMPLE_PARAMETER]', 'TODO: put a description for the PARAMETER') do |example_parameter|
37
+ # TODO: your logic here, below an example
38
+ options[:example_parameter] = 'this is a parameter'
39
+ end
40
+
41
+ o.separator ""
42
+ o.on("--switch-example", 'TODO: put a description for the SWITCH') do
43
+ # TODO: your logic here, below an example
44
+ self[:example_switch] = true
45
+ end
46
+
47
+ # Uncomment the following when using the bio-logger
48
+ # o.separator ""
49
+ # o.on("--logger filename",String,"Log to file (default stderr)") do | name |
50
+ # Bio::Log::CLI.logger(name)
51
+ # end
52
+ #
53
+ # o.on("--trace options",String,"Set log level (default INFO, see bio-logger)") do | s |
54
+ # Bio::Log::CLI.trace(s)
55
+ # end
56
+ #
57
+ # o.on("-q", "--quiet", "Run quietly") do |q|
58
+ # Bio::Log::CLI.trace('error')
59
+ # end
60
+ #
61
+ # o.on("-v", "--verbose", "Run verbosely") do |v|
62
+ # Bio::Log::CLI.trace('info')
63
+ # end
64
+ #
65
+ # o.on("--debug", "Show debug messages") do |v|
66
+ # Bio::Log::CLI.trace('debug')
67
+ # end
68
+
69
+ o.separator ""
70
+ o.on_tail('-h', '--help', 'display this help and exit') do
71
+ options[:show_help] = true
72
+ end
73
+ end
74
+
75
+ begin
76
+ opts.parse!(ARGV)
77
+
78
+ # Uncomment when using the bio-logger
79
+ # Bio::Log::CLI.configure('regressiontest')
80
+ # logger = Bio::Log::LoggerPlus['regressiontest']
81
+ # Log parsed options and remaining arguments in ARGV
82
+ # logger.info [options, ARGV]
83
+
84
+ # TODO: your code here
85
+ # use options for your logic
86
+ rescue OptionParser::InvalidOption => e
87
+ options[:invalid_argument] = e.message
88
+ end
89
+
@@ -0,0 +1,9 @@
1
+ Feature: something something
2
+ In order to something something
3
+ A user something something
4
+ something something something
5
+
6
+ Scenario: something something
7
+ Given inspiration
8
+ When I create a sweet new gem
9
+ Then everyone should see how awesome I am
@@ -0,0 +1,15 @@
1
+ require 'bundler'
2
+ begin
3
+ Bundler.setup(:default, :development)
4
+ rescue Bundler::BundlerError => e
5
+ $stderr.puts e.message
6
+ $stderr.puts "Run `bundle install` to install missing gems"
7
+ exit e.status_code
8
+ end
9
+
10
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
11
+ require 'regressiontest'
12
+
13
+ require 'test/unit/assertions'
14
+
15
+ World(Test::Unit::Assertions)
@@ -0,0 +1,11 @@
1
+ # Please require your code below, respecting the naming conventions in the
2
+ # bioruby directory tree.
3
+ #
4
+ # For example, say you have a plugin named bio-plugin, the only uncommented
5
+ # line in this file would be
6
+ #
7
+ # require 'bio/bio-plugin/plugin'
8
+ #
9
+ # In this file only require other files. Avoid other source code.
10
+
11
+ require 'regressiontest/cli_exec'
@@ -0,0 +1,41 @@
1
+ module RegressionTest
2
+
3
+ DEFAULT_TESTDIR = "test/data/regression"
4
+
5
+ # Regression test runner compares output in ./test/data/regression (by default).
6
+ # The convention is to have a file with names .ref (reference) and create .new
7
+ module CliExec
8
+ def CliExec::exec command, testname, options = {}
9
+ # ---- Find .ref file
10
+ fullname = DEFAULT_TESTDIR + "/" + testname
11
+ basefn = if File.exist?(testname+".ref")
12
+ testname
13
+ elsif fullname + ".ref"
14
+ FileUtils.mkdir_p DEFAULT_TESTDIR
15
+ fullname
16
+ else
17
+ raise "Can not find reference file for #{testname} - expected #{fullname}.ref"
18
+ end
19
+ outfn = basefn + ".new"
20
+ reffn = basefn + ".ref"
21
+ # ---- Create .new file
22
+ cmd = command + " > #{outfn}"
23
+ $stderr.print cmd,"\n"
24
+ if Kernel.system(cmd) == false
25
+ $stderr.print cmd," returned an error\n"
26
+ return false
27
+ end
28
+ # ---- Compare the two files
29
+ compare_files(outfn,reffn)
30
+ end
31
+
32
+ def CliExec::compare_files fn1, fn2
33
+ cmd = "diff #{fn2} #{fn1}"
34
+ $stderr.print cmd+"\n"
35
+ return true if Kernel.system(cmd) == true
36
+ $stderr.print "If it is correct, execute \"cp #{fn1} {fn2}\", and run again"
37
+ false
38
+ end
39
+ end
40
+
41
+ end
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+ require 'shoulda'
12
+
13
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
15
+ require 'regressiontest'
16
+
17
+ class Test::Unit::TestCase
18
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestBioRegressiontest < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: regressiontest
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Pjotr Prins
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-07-27 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: shoulda
16
+ requirement: &27821800 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *27821800
25
+ - !ruby/object:Gem::Dependency
26
+ name: rdoc
27
+ requirement: &27820620 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '3.12'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *27820620
36
+ - !ruby/object:Gem::Dependency
37
+ name: cucumber
38
+ requirement: &27819580 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *27819580
47
+ - !ruby/object:Gem::Dependency
48
+ name: jeweler
49
+ requirement: &27818860 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 1.8.3
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *27818860
58
+ - !ruby/object:Gem::Dependency
59
+ name: bundler
60
+ requirement: &27818060 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: 1.0.21
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *27818060
69
+ - !ruby/object:Gem::Dependency
70
+ name: bio
71
+ requirement: &27814360 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: 1.4.2
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *27814360
80
+ - !ruby/object:Gem::Dependency
81
+ name: rdoc
82
+ requirement: &27807100 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ~>
86
+ - !ruby/object:Gem::Version
87
+ version: '3.12'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: *27807100
91
+ description: Regression testing for the command line, and library API
92
+ email: pjotr.public01@thebird.nl
93
+ executables:
94
+ - regressiontest
95
+ extensions: []
96
+ extra_rdoc_files:
97
+ - LICENSE.txt
98
+ - README.md
99
+ files:
100
+ - .document
101
+ - .travis.yml
102
+ - Gemfile
103
+ - LICENSE.txt
104
+ - README.md
105
+ - Rakefile
106
+ - VERSION
107
+ - bin/regressiontest
108
+ - features/bio-regressiontest.feature
109
+ - features/step_definitions/bio-regressiontest_steps.rb
110
+ - features/support/env.rb
111
+ - lib/regressiontest.rb
112
+ - lib/regressiontest/cli_exec.rb
113
+ - test/helper.rb
114
+ - test/test_bio-regressiontest.rb
115
+ homepage: http://github.com/pjotrp/regressiontest
116
+ licenses:
117
+ - MIT
118
+ post_install_message:
119
+ rdoc_options: []
120
+ require_paths:
121
+ - lib
122
+ required_ruby_version: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ segments:
129
+ - 0
130
+ hash: 2174228862267285081
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ none: false
133
+ requirements:
134
+ - - ! '>='
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ requirements: []
138
+ rubyforge_project:
139
+ rubygems_version: 1.8.10
140
+ signing_key:
141
+ specification_version: 3
142
+ summary: Functional (regression) testing library
143
+ test_files: []