function runTest(dir, testName) {
  var test,
      sketch;

   // shortcut on not-pde-files, for now.
  if (testName.indexOf(".pde")===-1) {

    // recurse dirs
    if(fs.statSync(dir + testName).isDirectory()) {
      runTests(dir + testName + "/");
    }

    return;
  }

  // run test for this file.
  test = fs.readFileSync(dir + testName, "utf-8");
  testHarness.prep(testName);
  try {
    sketch = new Processing(canvas, test, testHarness);
    if(sketch._failCount > 0) {
      throw "\n    [one or more tests failed]";
    }
    console.log("- " + testName + " passed.");
    _passcount++;
  }
  catch (e) {
    console.log(e);
    if (!sketch) {
      console.log("could not build sketch for " + testName);
    } else {
      console.log("    " + testName + " failed (" + sketch._failCount + " times)\n");
    }
    _failcount++;
    if (!argv.test && argv.failonerror) {
      throw new Error("fail on error specified");
    }
  }
}
/**
 * Run a test from the unit test directory
 */
Run a test from the unit test directory
Run a test from the unit test directory
function runTest(dir, testName) {
  var test,
      sketch;
  if (testName.indexOf(".pde")===-1) {
    if(fs.statSync(dir + testName).isDirectory()) {
      runTests(dir + testName + "/");
    }
    return;
  }
  test = fs.readFileSync(dir + testName, "utf-8");
  testHarness.prep(testName);
  try {
    sketch = new Processing(canvas, test, testHarness);
    if(sketch._failCount > 0) {
      throw "\n    [one or more tests failed]";
    }
    console.log("- " + testName + " passed.");
    _passcount++;
  }
  catch (e) {
    console.log(e);
    if (!sketch) {
      console.log("could not build sketch for " + testName);
    } else {
      console.log("    " + testName + " failed (" + sketch._failCount + " times)\n");
    }
    _failcount++;
    if (!argv.test && argv.failonerror) {
      throw new Error("fail on error specified");
    }
  }
}
function runTest ( dir , testName ) { var test , sketch ; if ( testName . indexOf ( ".pde" ) === - 1 ) { if ( fs . statSync ( dir + testName ) . isDirectory ( ) ) { runTests ( dir + testName + "/" ) ; } return ; } test = fs . readFileSync ( dir + testName , "utf-8" ) ; testHarness . prep ( testName ) ; try { sketch = new Processing ( canvas , test , testHarness ) ; if ( sketch . _failCount > 0 ) { throw "\n    [one or more tests failed]" ; } console . log ( "- " + testName + " passed." ) ; _passcount ++ ; } catch ( e ) { console . log ( e ) ; if ( ! sketch ) { console . log ( "could not build sketch for " + testName ) ; } else { console . log ( "    " + testName + " failed (" + sketch . _failCount + " times)\n" ) ; } _failcount ++ ; if ( ! argv . test && argv . failonerror ) { throw new Error ( "fail on error specified" ) ; } } }
Run a test from the unit test directory
Run a test from the unit test directory
// shortcut on not-pde-files, for now. // recurse dirs // run test for this file.