search

Class myphysicslab.test.Engine2DTestRig

Provided By

Static class that provides common test functions such as runTest.

When using these test functions, be sure to set the testName class variable.

Why the testName class property exists

It is crazy that we can't get the name of the current test function from the stack in Javascript (as we do in Java). There are ways to do it, but the Error.stack property is non-standard (Chrome and Firefox only); and using arguments.callee.caller is standard but deprecated; and in either case we still have to prevent Google Closure from mangling the name of the function when compiled. So it seems to be safer and easier to just stuff the name of the current test into the testName variable. Plus, we can add other information about the test, such as additional test parameters that vary between runs of the test.

new Engine2DTestRig()

Parameters

None.

Static Functions

Static Properties