README.md in openstudio_measure_tester-0.1.4 vs README.md in openstudio_measure_tester-0.1.5

- old
+ new

@@ -3,12 +3,14 @@ [![Build Status](https://travis-ci.org/NREL/OpenStudio-measure-tester-gem.svg?branch=develop)](https://travis-ci.org/NREL/OpenStudio-measure-tester-gem) [![Gem Version](https://badge.fury.io/rb/openstudio_measure_tester.svg)](https://badge.fury.io/rb/openstudio_measure_tester) The OpenStudio Measure Tester is a rubygem that exposes rake tasks for testing OpenStudio measures. -## Installation +## Installation and Running +### Rake-based + * Add the following code to the Gemfile and Rakefile of a measure repo you desire to test. * Gemfile ```ruby source 'https://rubygems.org' @@ -33,16 +35,41 @@ * In existing measure directory, run `bundle exec rake openstudio:all` * Minitest, Coverage, Rubocop, and OpenStudio Style will run. The last message that appears to the screen is the location of the dashboard. ``` Open ./test_results/dashboard/index.html to view measure testing dashboard. - ``` + ``` -## Disclaimer +### Ruby-based -This project is under active development and will be changing significantly. +* Require the OpenStudio-measure-tester gem +```ruby +require 'openstudio_measure_tester' +measures_dir = 'spec/test_measures/AddOverhangsByProjectionFactor' +# all measures (recursively) from measures_dir will be tested + +runner = OpenStudioMeasureTester::Runner.new(measures_dir) + +# base_dir is needed for coverage results as they are written to disk on the at_exit calls +base_dir = Dir.pwd + +result = runner.run_all(base_dir) +puts result +# result will be 0 or 1, 0=success, 1=failure + +runner.run_style(false) + +runner.run_test(false, base_dir) + +runner.run_rubocop(false) +``` + +* Results will be saved into the run directory (measures_dir from above). + +## Disclaimer + # Testing in Docker ```bash apt-get update && apt-get install -y curl @@ -52,5 +79,11 @@ chmod +x install_openstudio.sh ./install_ruby.sh 2.2.4 b6eff568b48e0fda76e5a36333175df049b204e91217aa32a65153cc0cdcb761 ./install_openstudio.sh 2.4.0 f58a3e1808 export RUBYLIB=/usr/Ruby ``` + + +# Releasing + +New versions of the OpenStudio Measure Tester Gem will be automatically released for any tags. Makes sure to increment +the version in `/lib/openstudio_measure_tester/version.rb` and tag the release (preferably off the master branch).