int main (int argc, char * const argv[]) 
{
    printf("Material Tests\n");
    fflush(stdout);

    Config config;
    if(!loadConfigFromKeyValueFile("render.config", config)) {
        return EXIT_FAILURE;
    }

    auto logger = std::make_shared<FileLogger>("render.log");
    logger->mirrorToStdout = config.get<bool>("MIRROR_LOGGING_TO_STDOUT");
    setLogger(logger);

    config.log(*logger);
    mkdir(output_path.c_str(), 0777);

    WallClockTimer total_run_timer;
    total_run_timer.start();

    if( argc > 1 ) {
        if( std::string(argv[1]) == "list" ) {
            printTests();
            exit(EXIT_SUCCESS);
        }
        else {
            // Run a specific test
            if( argc > 2 && std::string(argv[2]) == "animate" ) {
                animateMaterialTests = true;
            }
            if( argc > 2 && std::string(argv[2]) == "stereo" ) {
                stereoMaterialTests = true;
            }
            if( argc > 2 && std::string(argv[2]) == "preview" ) {
                showPreviewWindow = true;
            }
            int first, last;
            if(sscanf(argv[1], "%d-%d", &first, &last) == 2) {
                for(int index = first; index <= last; index++) {
                    runTest(index);
                }
            }
            else {
                runTest(atoi(argv[1]));
            }
        }
    }
    else {
        // Run all tests
        printTests();
        logTests(*logger);
        runTests();
    }
    
    total_run_timer.stop();
    printf("Done - Run time = %f seconds\n", total_run_timer.elapsed());
    fflush(stdout);
    return 0;
}
Exemple #2
0
void TextTestResult::printHeader(std::ostream& stream)
{
    stream << "\n\n";
    if (wasSuccessful())
        stream << "OK ("
               << runTests() << " tests)"
               << std::endl;
    else
        stream << "!!!FAILURES!!!" << std::endl
               << "Runs: "
               << runTests ()
               << "   Failures: "
               << testFailures ()
               << "   Errors: "
               << testErrors ()
               << std::endl;
}
Exemple #3
0
int
main (void)
{
  const testFunc tests[] = { test_single_file,
                             test_single_directory_random_payload };

  return runTests (tests, NUM_TESTS (tests));
}
Exemple #4
0
int
main (void)
{
  const testFunc tests[] = { test_parsing,
                             test_updating };

  return runTests (tests, NUM_TESTS (tests));
}
Exemple #5
0
int
main (void)
{
  const testFunc tests[] = { test_magnet_link,
                             test_metainfo };

  return runTests (tests, NUM_TESTS (tests));
}
int main(int argc, char *argv[])
{
    struct Set *set = constructSet();
    
    runTests(set);
    SetClose(set);     
    return 0;
}
Exemple #7
0
int
main (void)
{
  const testFunc tests[] = { testPeerId,
                             test_session_id };

  return runTests (tests, NUM_TESTS (tests));
}
Exemple #8
0
int
main (void)
{
  const testFunc tests[] = { test_error_set,
                             test_error_propagate };

  return runTests (tests, NUM_TESTS (tests));
}
Exemple #9
0
void cStream::runBenchmark()
{
  initializeVariables();
  runChecks();
  runTests();
  checkSTREAMresults();
  calculateBandwidthResults();
  outputSummary();
}; // void cStream::runBenchmark()
Exemple #10
0
int main(void)
{
    char const* comma_locales[] =
    {
        "da_DK.UTF-8",
        "fr_FR.UTF-8",
        "ru_RU.UTF-8"
    };

    testFunc const tests[] =
    {
        test_elements,
        test_utf8,
        test1,
        test2,
        test3,
        test_unescape
    };

    /* run the tests in a locale with a decimal point of '.' */
    setlocale(LC_NUMERIC, "C");

    int ret = runTests(tests, NUM_TESTS(tests));

    /* run the tests in a locale with a decimal point of ',' */
    bool is_locale_set = false;

    for (size_t i = 0; !is_locale_set && i < TR_N_ELEMENTS(comma_locales); ++i)
    {
        is_locale_set = setlocale(LC_NUMERIC, comma_locales[i]) != NULL;
    }

    if (!is_locale_set)
    {
        fprintf(stderr, "WARNING: unable to run locale-specific json tests. add a locale like %s or %s\n", comma_locales[0],
            comma_locales[1]);
    }
    else
    {
        ret += runTests(tests, NUM_TESTS(tests));
    }

    return ret;
}
Exemple #11
0
BOOST_FIXTURE_TEST_CASE(CanonizeDev, CanonizeFixture)
{
  addTest("dev://eth0", true, "dev://eth0");
  addTest("dev://", false, "");
  addTest("dev://eth0:8888", false, "");
  addTest("dev://eth0/", true, "dev://eth0");
  addTest("dev://eth0/A", false, "");

  runTests();
}
Exemple #12
0
int
main( void )
{
    static const testFunc tests[] = {
	testInt, testStr, testParse, testJSON, testMerge, testBool,
	testParse2, testStackSmash,
    };

    return runTests(tests, NUM_TESTS(tests));
}
void TextTestResult::printHeader (std::ostream &stream)
{
	if (wasSuccessful ())
		std::cout << "OK (" << runTests () << " tests and "
			 << testSuccesses() << " assertions in " << elapsedTime() << " ms)" << std::endl;
	else
		std::cout << std::endl
			 << "!!!FAILURES!!!" << std::endl
			 << "Test Results:" << std::endl
			 << "Run:  "
			 << runTests ()
			 << "   Failures: "
			 << testFailures ()
			 << "   Errors: "
			 << testErrors ()
			 << std::endl
			 << "(" << testSuccesses() << " assertions ran successfully in " << elapsedTime() << " ms)" << std::endl;

}
Exemple #14
0
int
main (void)
{
  const testFunc tests[] = { test_torrent_hash,
                             test_encrypt_decrypt,
                             test_sha1,
                             test_ssha1 };

  return runTests (tests, NUM_TESTS (tests));
}
Exemple #15
0
int main(int argc, char *argv[])
{
    // Can' destroy the default stream:// TODO - move to another test
    HIPCHECK_API(hipStreamDestroy(0), hipErrorInvalidResourceHandle);

    HipTest::parseStandardArguments(argc, argv, true /*failOnUndefinedArg*/);

    runTests(40000000);

    passed();
}
Exemple #16
0
//--------------------------------------------------------------
void ofApp::setup() {

	ofSetVerticalSync(true);
	ofSetFrameRate(30);
	ofSetLogLevel("ofxLua", OF_LOG_VERBOSE);

	lua.init(true);
	lua.addListener(this);
	runTests();
	loadScript();
}
Exemple #17
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    _instance = this;
    ui->setupUi(this);

    API::getInstance()->init(API::PlatformPtr(new PlatformImpl));

    runTests();
}
Exemple #18
0
/** Runs the suites from the specified ids.
 * @param argc
 *      Id argument count.
 * @param argv
 *      Id arguments with `argv[argc] == NULL`.
 */
void runSuitesFromIds(int argc, char *argv[])
{
    AceTestId_t tests[argc + 1];
    int i;

    for (i = 0; i < argc; i++)
        tests[i] = atoAceTestId(argv[i]);

    tests[i] = 0;

    runTests(tests);
}
Exemple #19
0
int main() {
  PFC pfc(AES_SECURITY);  // initialise pairing-friendly curve
  miracl *mip=get_mip();  // get handle on mip (Miracl Instance Pointer)

  mip->IOBASE=10;

  std::string test_name;
  int result = runTests(test_name);
  print_test_result(result,test_name);

  return 0;
}
Exemple #20
0
int main()
{
	InitializeDatabase();
	fopen_s(&f, "testResults.html", "wt");
	addPrefixToReport();
	initializeTests();
	runTests();
	fclose(f);
	CloseDatabase();
	if (!ok) return -1;
	return 0;
}
Exemple #21
0
MojErr MojTestRunner::run()
{
	// turn off debug error logging
	MojLogEngine::instance()->reset(MojLogger::LevelCritical);

	runTests();
	MojPrintF(_T("\n-----------------------------------\n")
			  _T("Results:     %d succeeded, %d failed\n"),
			  m_numSucceeded, m_numFailed);

	return (MojErr) m_numFailed;
}
Exemple #22
0
int main()
{
    printf("main() started\n");

    runTests(0);
    /*
    osThreadDef_t testRunnerThread = {runTests, osPriorityNormal, 1, 0};
    if (osThreadCreate(&testRunnerThread, 0) == NULL)
        printf("Failed to start the test runner\n");
    */

    while (1);
}
Exemple #23
0
int
main (void)
{
  int i;
  int n;
  int rv;

  const char * comma_locales[] = { "da_DK.UTF-8",
                                   "fr_FR.UTF-8",
                                   "ru_RU.UTF-8"};

  const testFunc tests[] = { test_elements,
                             test_utf8,
                             test1,
                             test2,
                             test3,
                             test_unescape };

  /* run the tests in a locale with a decimal point of '.' */
  setlocale (LC_NUMERIC, "C");
  if ((rv = runTests (tests, NUM_TESTS (tests))))
    return rv;

  /* run the tests in a locale with a decimal point of ',' */
  n = sizeof(comma_locales) / sizeof(comma_locales[0]);
  for (i=0; i<n; ++i)
    if (setlocale (LC_NUMERIC, comma_locales[i]) != NULL)
      break;
  if (i==n)
    fprintf (stderr, "WARNING: unable to run locale-specific json tests. add a locale like %s or %s\n",
             comma_locales[0],
             comma_locales[1]);
  else if ((rv = runTests (tests, NUM_TESTS(tests))))
    return rv;

  /* success */
  return 0;
}
Exemple #24
0
int main()
{
	struct BowlingState *state = createBowlingState();
	if (state == NULL) {
		printf("Failed to create a bowling state.\n");
		exit(1);
	}

	initBowlingState(state);
	runTests(state);	
	destroyBowlingState(state);	

	return 0;
}
int main(int argc, char** argv)
{
	int result = -1;
	CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
	{
		First::IHello_var service = First::IHello::_narrow(getService(orb, "testService"));

		result = runTests(orb, service);
	
		orb->destroy();
	}

	return result;
}
Exemple #26
0
int main(int argc, char *argv[]) {
    //QApplication a(argc, argv);

    GLenum err = glewInit();
    if (GLEW_OK != err)
    {
      /* Problem: glewInit failed, something is seriously wrong. */
      std::cerr <<  "Error: " << glewGetErrorString(err) << std::endl;
    }

    runTests(argc, argv);

    return 0;
    //return a.exec();
}
int main()
{
	bool testsPassed = runTests();
	if (testsPassed)
	{
		writeLogLine("Tests all passed!");
	}
	else
	{
		writeLogLine("Tests failed");
	}

	pauseForClose();
	return 0;
}
Exemple #28
0
int
main( void )
{
    const testFunc tests[] = { test1 };
    int ret;

    if( (ret = runTests(tests, 1)) )
        return ret;

#ifdef VERBOSE
    fprintf( stderr, "magnet-test passed\n" );
#endif

    return 0;
}
Exemple #29
0
void checkDock::validate(ValidateType type)
{
    mErrorList.clear();

    runTests(type);
    mComment->setText(QString("%1 errors were found").arg(mErrorList.count()));

    mRBFeature1->reset();
    mRBFeature2->reset();
    mRBConflict->reset();

    clearVertexMarkers();

    mErrorTableView->resizeColumnsToContents();
}
//////////////////////      test    runner     /////////////////////////
int main()
{
    CU_pSuite suite;
    if (!initialTests(&suite))  return EXIT_FAILURE;

    CU_TestInfo tests[] = {
        { "", test_enterLoop_AfterCall_InsideLoop },
        { "", test_leaveLoop_AfterCall_NotInsideLoop }
    };
    if (!addTests(&suite, tests, sizeof(tests) / sizeof(tests[0])))
        return EXIT_FAILURE;

    if (!runTests(&suite))      return EXIT_FAILURE;
    return 0;
}