Personal tools

Regression Testing from ANT

From OpenLaszlo

Contents

Instructions for adding LzTest API regression tests to the automatic testing system

OPTIONAL Check if there are "@affects" tags in the LFC or LPS source files you're modifying.

Source files will contain a comment line with "@affects" followed by a space-separated list of tags

/**
 * @affects lztext
 */


If there isn't already an '@affects' tag in a source file you are editing, consider adding one, it will make the automatic testing system more useful for everyone. Tag names should be something simple and mnemonic, by default use the LFC class name in lowercase.

Create your LzTest file

The directory "test/lztest" is where we've been putting LzTest regression tests, but you can put your test file someplace else if you want.

See the file test/lztest/lztest-simple.lzx for an example boilerplate test.

When you write your test case, add a "covers-tags" comment to declare which features this test covers. These match up with @affects tags in source code. You can list multiple test tag names, separated by spaces


Note, if you want to add the test to the generic "smoketest" which run by "ant lztest", add "smoketest" to the covers-tags list.

Add the test filename to the master list of tests

We have two lists

test/lztest/rhino.txt
test/lztest/browser.txt
  • If the test will work in rhino (headless), then add it to headless.txt
  • If it requires a browser, add it to browser.txt

You can add your test to both lists if it makes sense to do so.


Run "ant findlztests", "ant findlztestsbrowser-swf7" or "ant findlztestsbrowser-dhtml"

This will:

  run 'svn status' to find your modified source files
  scan them for @affects tags
  scan test files in smoketest.txt, and find all tests which are affected
  run those tests (in rhino, or in a browser)