Better way to test multi-layered code?

| | Comments (1)
add_tests("lasgn_call",
          "Rewriter"    => :same,
          "TypeChecker" => t(:lasgn, :c,
                             t(:call,
                               t(:lit, 2, Type.long),
                               :+,
                               t(:arglist,
                                 t(:lit, 3, Type.long)),
                               Type.long),
                             Type.long),
          "CRewriter"   => :same,
          "RubyToAnsiC" => "c = 2 + 3", # FIX: probably not "c = ..."
          "RubyToRubyC" => 'c = rb_funcall(LONG2NUM(2), rb_intern("+"), 1, LONG2NUM(3))')

Can you think of a better / cleaner way? This generates 5 test_lasgn_call methods in 5 different test classes. :same says "use previous output as my input", and Rewriter gets its input from ParseTree's test suite.

I've got 297 of these add_tests method calls. Gah. Just seems a bit much, but I can't really think of a better way ATM.

1 Comments

I don't understand what's going on above. Where are you using this?

Leave a comment

About this Entry

This page contains a single entry by zenspider published on August 6, 2008 9:22 AM.

hoe version 1.7.0 has been released! was the previous entry in this blog.

Writing Extensions using Hoe is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.32-en