Home

Awesome

max-test

Automated Test Harness for Max

This package provides a set of simple tools with which to instrument patchers to verify expected behavior. Patchers that are instrumented as "test patchers" assist in fast identification of bugs, of the expectations of the patcher's author, and fast verification once a bug is addressed. Furthermore, instrumented test patchers can be evaluated as part of an automated system on multiple architectures and platforms.

A video introduction is available at https://www.youtube.com/watch?v=l_3W4tZcgXI

Construction of a Test

A test patcher must meet the following criteria:

Examples

The 'patchers' folder in this package contains some example test patchers for reference. Here are the examples with some associated topics:

Running the Tests

You can open a test patcher/project at any time and view it visually to inspect the results.

To run the tests in an automated fashion from with Max, see the 'oscar.maxhelp' patcher in the 'help' folder. To access the results of the tests, see the section below on test results.

Fully Automated Testing with Ruby

You can communicate with Max remotely to fully automate the running of test patchers and log the results. An example for how to do this is provided as a Ruby script that can be expanded or retooled to suit your needs.

Remote Communication

Communication with uses Open Sound Control communicated via UDP. Internal to Max this is implemented using the udpsend and udpreceive objects. By default the oscar extension does not have remote communication enabled.

To enable this remote communication you must set it by creating a configuration file in the max-test/misc folder called max-test-config.json -- the contents of which should look like this:

  {
    "port-send" : 4792,
    "port-listen" : 4791
  }

The ports may be changed to suit your needs. Any changes in the ports used by oscar will also require that you change the Ruby script to use the same ports for communication.

Running the Ruby Script

Having configured Max to enable remote communication, now start a Terminal/Console session and cd into the max-test/ruby folder. Now you can run the script by typing ruby test.rb to get some simple assistance regarding the arguments.

To actually start the tests you will need to provide the path to your Max application folder, e.g. ruby test.rb "/Applications/Max 6.1"

The process may take a few minutes. First Max is launched. Then two-way communication is established. Now we must wait for Max's file database to complete so that all of the tests in the searchpath can be found. Finally, the tests will begin running. When the tests are done, the results will be summarized on the console.

Automated Test Results

The results of automated tests are stored in a SQLite database. The database is located in the max-test folder and named according to the path to the Max application used to run the tests. You can use any SQLite client application to read the results. On the Mac you can also use the built-in sqlite3 program in the Terminal.

The Ruby script provides a summary of the test results by reading the database.