TestUp 2 Released on GitHub


#1

At DevCamp in Athens we open sourced our second iteration of TestUp - the unit test framework we use internally: https://github.com/SketchUp/testup-2

Highlights:

  • Works with SketchUp 2014 and newer
  • Where as in the old version you had to copy your tests to the TestUp folder which was hard coded you can now just add the path to where your tests are located in your own project folder.
  • Builds upon the MiniTest gem which is extendible if needed.
  • Wraps the MiniTest framework such that if we change the underlying library we can preserve compatibility.
  • Allows you to set up manifests for the tests so TestUp knows how much coverage you have.

Documentation is still in progress, but that is coming: https://github.com/SketchUp/testup-2/wiki

This is also a great tool for developers to report bugs in our API. If you send us a test unit that replicates the bug it makes it much easier for us to fix it - saves the time of going back and forth trying to replicate the exact conditions.

Use it, share it, fork it, improve it, like it! :smiley:


#2

For testing an extension against older versions, TestUp “1” is available as part of the old Developer Tools.
However, old tests used to be subclasses of Test::Unit::TestCase and not yet of TestUp::TestCase. Any suggestions to maintain one set of unit tests that can be run in all versions?

if defined?(Test::Unit::TestCase) && !defined?(TestUp::TestCase)
  module Testup
    TestCase = Test::Unit::TestCase
  end
end

#3

It should be “TestUp” not “Testup”:

if defined?(Test::Unit::TestCase) && !defined?(TestUp::TestCase)
  module TestUp
    TestCase = Test::Unit::TestCase
  end
end

#4

advised not adviced
… or use recommended instead.


#5

I’ve been wanting to eventually make TestUp2 compatible with older SketchUp version. Provided that there is a compatible MiniTest gem for 1.8 we can use.


#6

[https://github.com/seattlerb/minitest][1]

== REQUIREMENTS:

  • Ruby 1.8, maybe even 1.6 or lower. No magic is involved.

I got the github project link out of the gemspec file, from the minitest gem, that TestUp2 requested be installed, by rubygems.

So just extract the code into an RBZ archive for SketchUp < 2014
[1]: https://github.com/seattlerb/minitest


#7

Logged issue: https://github.com/SketchUp/testup-2/issues/85


#8

OH it needs also some of the standard lib:

require "optparse"
require "thread"
require "mutex_m"

#9

Ruby 1.8.6 p287 Standard Library SketchUp Extension RBZ

The loader script in case ya’ll prefer to copy the lib files your selves, or have them somewhere else besides the “Plugins” directory.
(FYI, an example of a SketchupExtension script that doesn’t really load a file.):
!!_RubyLib.rb (2.9 KB)

:wink: