Пример #1
0
/*!
    Connect to all of the models signals.  Whenever anything happens recheck everything.
*/
ModelTest::ModelTest ( QAbstractItemModel *_model, QObject *parent ) : QObject ( parent ), model ( _model ), fetchingMore ( false )
{
    Q_ASSERT ( model );

    connect ( model, SIGNAL ( columnsAboutToBeInserted ( const QModelIndex &, int, int ) ),
              this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( columnsAboutToBeRemoved ( const QModelIndex &, int, int ) ),
              this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( columnsInserted ( const QModelIndex &, int, int ) ),
              this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( columnsRemoved ( const QModelIndex &, int, int ) ),
              this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( dataChanged ( const QModelIndex &, const QModelIndex & ) ),
              this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( headerDataChanged ( Qt::Orientation, int, int ) ),
              this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( layoutAboutToBeChanged () ), this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( layoutChanged () ), this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( modelReset () ), this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ),
              this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ),
              this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( rowsInserted ( const QModelIndex &, int, int ) ),
              this, SLOT ( runAllTests() ) );
    connect ( model, SIGNAL ( rowsRemoved ( const QModelIndex &, int, int ) ),
              this, SLOT ( runAllTests() ) );

    // Special checks for inserting/removing
    connect ( model, SIGNAL ( layoutAboutToBeChanged() ),
              this, SLOT ( layoutAboutToBeChanged() ) );
    connect ( model, SIGNAL ( layoutChanged() ),
              this, SLOT ( layoutChanged() ) );

    connect ( model, SIGNAL ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ),
              this, SLOT ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ) );
    connect ( model, SIGNAL ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ),
              this, SLOT ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ) );
    connect ( model, SIGNAL ( rowsInserted ( const QModelIndex &, int, int ) ),
              this, SLOT ( rowsInserted ( const QModelIndex &, int, int ) ) );
    connect ( model, SIGNAL ( rowsRemoved ( const QModelIndex &, int, int ) ),
              this, SLOT ( rowsRemoved ( const QModelIndex &, int, int ) ) );

    runAllTests();
}
Пример #2
0
int main (int argc, char *argv[]) {

    addTest (testAddToneToChar);
    addTest (testAddMarkToChar);

    runAllTests ();

    return 0;
}
Пример #3
0
/** The test program */
int main(int argc, char *argv[]){
	printf("= as1_t2 =\n");
	printf("This unit test program is provided for Assignment 1, Task 2 of the course Operating Systems, University of Twente, 2011.\n\n");
	printf("Your solution will be tested on a number of points. Afterwards, \"[End of Test]\" will be shown. IF this is not so, the program crashed and you're not done yet.\n");
	printf("Please note: this program may detect some flaws, but may not detect all of them. Do *not* assume correctness of your solution on passing this test alone.\n\n");

	runAllTests();
	return 0;
}
Пример #4
0
int main () {

	runAllTests();

	ofAppGlutWindow window;
    ofSetupOpenGL(&window, 800, 600, OF_WINDOW);

    ofRunApp(new testApp());

}
Пример #5
0
Файл: 100.c Проект: rollen/uva
int main(int argc, char *argv[]){
  if(argc == 2 && strcmp(argv[1], "test") == 0){
    runAllTests();
  } else {
    int firstVal, secondVal;
    while(scanf("%d %d", &firstVal, &secondVal) == 2)  
      printf("%d %d %d\n", firstVal, secondVal, maxCycleLength(firstVal, secondVal));
  }
  return 0;
}
Пример #6
0
int main(int argumentCount, char* arguments[])
{
    char* applicationNameAsChar = arguments[0];

    if (argumentCount <= 1) {

        // Run the Motor Board
        char motorBoardOptionCommand[255];
        strcpy_s(motorBoardOptionCommand, _countof(motorBoardOptionCommand), MOTOR_BOARD_PC_NAME);
        strcat_s(motorBoardOptionCommand, _countof(motorBoardOptionCommand), " ");
        strcat_s(motorBoardOptionCommand, _countof(motorBoardOptionCommand), MOTOR_BOARD_PC_RUN_STANDARD);
        runProcess(applicationNameAsChar, motorBoardOptionCommand);

        // And After the main Board
        runMainBoardPC(false);
    }
    else {
        char* boardName = arguments[1];
        if (strcmp(boardName, MAIN_BOARD_PC_NAME) == 0) {
            bool robotManager = false;
            if (argumentCount > 2) {
                char* mainBoardRunMode = arguments[2];
                robotManager = (strcmp(mainBoardRunMode, MAIN_BOARD_PC_ROBOT_MANAGER) == 0);

                char motorBoardOptionCommand[255];
                strcpy_s(motorBoardOptionCommand, _countof(motorBoardOptionCommand), MOTOR_BOARD_PC_NAME);
                strcat_s(motorBoardOptionCommand, _countof(motorBoardOptionCommand), " ");
                strcat_s(motorBoardOptionCommand, _countof(motorBoardOptionCommand), MOTOR_BOARD_PC_RUN_STANDARD);
                runProcess(applicationNameAsChar, motorBoardOptionCommand);
            }
            // In all cases
            runMainBoardPC(robotManager);
        }
        else if (strcmp(boardName, MOTOR_BOARD_PC_NAME) == 0) {
            bool singleMode = true;
            if (argumentCount > 2) {
                char* motorBoardRunMode = arguments[2];
                singleMode = (strcmp(boardName, MOTOR_BOARD_PC_RUN_SINGLE) == 0);
            }
            runMotorBoardPC(singleMode);
        }
        else if (strcmp(boardName, ALL_TESTS_NAME) == 0) {
            runAllTests();
        }
        else {
            printUsage();
            return EXIT_FAILURE;
        }
    }
    
    getchar();
    return EXIT_SUCCESS;
}
Пример #7
0
int CommandLineTestRunner::runAllTestsMain()
{
	int testResult = 0;

	SetPointerPlugin pPlugin(DEF_PLUGIN_SET_POINTER);
	registry_->installPlugin(&pPlugin);

	if (parseArguments(registry_->getFirstPlugin()))
		testResult = runAllTests();

	registry_->removePluginByName(DEF_PLUGIN_SET_POINTER);
	return testResult;
}
Пример #8
0
/** The test program */
int main(int argc, char *argv[]){
	printf("= as2_t3 =\n");
	printf("This unit test program is provided for Assignment 2, Task 3 of the course Operating Systems, University of Twente, 2011.\n\n");
	printf("Your solution will be tested on a number of points. Afterwards, \"[End of Test]\" will be shown. IF this is not so, the program crashed and you're not done yet.\n");
	printf("Please note: this program may detect some flaws, but may not detect all of them. Do *not* assume correctness of your solution on passing this test alone.\n\n");


	printf(" || task_t Slot Size              || %10u Bytes ||\n", sizeof(task_t));
	printf(" || task_t Fair Slot Count        || %10lu slots ||\n", FAIR_TASK_COUNT);
	printf("\n");
	
	runAllTests();
}
int CommandLineTestRunner::runAllTestsMain()
{
	int testResult = 0;

	SetPointerPlugin pPlugin(DEF_PLUGIN_SET_POINTER);
	TestRegistry::getCurrentRegistry()->installPlugin(&pPlugin);

	if (!parseArguments(TestRegistry::getCurrentRegistry()->getFirstPlugin())) return 1;

	testResult = runAllTests();

	return testResult;
}
Пример #10
0
/*!
    Connect to all of the models signals.  Whenever anything happens recheck everything.
*/
ModelTest::ModelTest(QAbstractItemModel *_model, QObject *parent) : QObject(parent), model(_model), fetchingMore(false)
{
    Q_ASSERT(model);

    connect(model, &QAbstractItemModel::columnsAboutToBeInserted,
            this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::columnsAboutToBeRemoved,
            this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::columnsInserted,
            this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::columnsRemoved,
            this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::dataChanged,
            this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::headerDataChanged,
            this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::layoutAboutToBeChanged, this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::layoutChanged, this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::modelReset, this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::rowsAboutToBeInserted,
            this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::rowsAboutToBeRemoved,
            this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::rowsInserted,
            this, &ModelTest::runAllTests);
    connect(model, &QAbstractItemModel::rowsRemoved,
            this, &ModelTest::runAllTests);

    // Special checks for inserting/removing
    connect(model, &QAbstractItemModel::layoutAboutToBeChanged,
            this, &ModelTest::layoutAboutToBeChanged);
    connect(model, &QAbstractItemModel::layoutChanged,
            this, &ModelTest::layoutChanged);

    connect(model, &QAbstractItemModel::rowsAboutToBeInserted,
            this, &ModelTest::rowsAboutToBeInserted);
    connect(model, &QAbstractItemModel::rowsAboutToBeRemoved,
            this, &ModelTest::rowsAboutToBeRemoved);
    connect(model, &QAbstractItemModel::rowsInserted,
            this, &ModelTest::rowsInserted);
    connect(model, &QAbstractItemModel::rowsRemoved,
            this, &ModelTest::rowsRemoved);

    runAllTests();
}
Пример #11
0
int UnityMain(int argc, const char* argv[], void (*runAllTests)(void))
{
    int result = UnityGetCommandLineOptions(argc, argv);
    unsigned int r;
    if (result != 0)
        return result;

    for (r = 0; r < UnityFixture.RepeatCount; r++)
    {
        UnityBegin(argv[0]);
        announceTestRun(r);
        runAllTests();
        if (!UnityFixture.Verbose) UNITY_PRINT_EOL();
        UnityEnd();
    }

    return (int)Unity.TestFailures;
}
Пример #12
0
int UnityMain(int argc, const char* argv[], void (*runAllTests)(void))
{
    int result = UnityGetCommandLineOptions(argc, argv);
    unsigned int r;
    if (result != 0)
        return result;

    for (r = 0; r < UnityFixture.RepeatCount; r++)
    {
        UnityBegin(argv[0]);
        announceTestRun(r);
        runAllTests();
        UNITY_OUTPUT_CHAR('\n');
        UnityEnd();
    }

    return UnityFailureCount();
}
Пример #13
0
int UnityMain(int argc, char* argv[], void (*runAllTests)(struct _Unity * const unity_p), struct _Unity * const unity_p)
{
    int result = UnityGetCommandLineOptions(argc, argv, unity_p);
    unsigned int r;
    if (result != 0)
        return result;

    for (r = 0; r < unity_p->RepeatCount; r++)
    {
        announceTestRun(r, unity_p);
        UnityBegin(unity_p);
        runAllTests(unity_p);
        UNITY_OUTPUT_CHAR('\n');
        UnityEnd(unity_p);
    }

    return UnityFailureCount(unity_p);
}
Пример #14
0
/** The test program */
int main(int argc, char *argv[]){
	void* start;
	printf("= as2_t1 =\n");
	printf("This unit test program is provided for Assignment 2, Task 1 of the course Operating Systems, University of Twente, 2011.\n\n");
	printf("Your solution will be tested on a number of points. Afterwards, \"[End of Test]\" will be shown. IF this is not so, the program crashed and you're not done yet.\n");
	printf("Please note: this program may detect some flaws, but may not detect all of them. Do *not* assume correctness of your solution on passing this test alone.\n\n");


	printf(" || Memory Block Start Address    || 0x%8x       ||\n", (unsigned int) get_MEM_BLOCK_START());
	printf(" || Memory Block Size             || %10lu Bytes ||\n", MEM_BLOCK_SIZE);
	printf(" || task_t Slot Size              || %10u Bytes ||\n", sizeof(task_t));
	printf(" || task_t Max Slot Count         || %10lu slots ||\n", MAX_TASK_COUNT);
	printf(" || task_t Fair Slot Count        || %10i slots ||\n", FAIR_TASK_COUNT);
	printf("\n");
	
	runAllTests();
	
	start = get_MEM_BLOCK_START();
	if( NULL != start )
		free( start );
}
Пример #15
0
int main(int _argc, const char* _argv[])
{
	return runAllTests(_argc, _argv);
}
Пример #16
0
void ANativeActivity_onCreate(ANativeActivity*, void*, size_t)
{
	exit(runAllTests(BX_COUNTOF(s_argv), s_argv) );
}
Пример #17
0
MainWindow::MainWindow(QWidget* parent)
: QMainWindow(parent)
, m_editor(0)
, m_hooqPlayInjector(new PlatformInjector(this))
, m_hooqRecordInjector(new PlatformInjector(this))
, m_hooqLogger(0)
, m_hooqPlayer(0)
, m_interpreter(new Interpreter(this))
, m_server(new QTcpServer(this))
, m_testModel(new TestModel(this))
, m_testRunning(false)
, m_testResultsWindow(new TestResultsDialog(this))
, m_xmlDump(0)
{
	if(!m_interpreter->haveRequiredQtScriptExtensions())
	{
		QMessageBox::critical(0, tr("Couldn't load required QtScript extensions"), tr("Please install qtscriptgenerator for the version of Qt you are currently using. While recording in Hooq may work, playback will not be possible."));
	}

	if(!m_server->listen(QHostAddress::LocalHost, Hooq::Communication::serverPort()))
	{
		QMessageBox::critical(0, tr("Couldn't listen for applications"), tr("Hooq couldn't start listening for applications; you're probably running two copies of Hooq. Hooq will not work."));
	}

	m_editor = new ScriptEditor(m_interpreter->engine());
	setupUi(this);
	setStatusBar(0);

	populateTestSets();

	m_testList->setModel(m_testModel);
	PushButtonDelegate* delegate = new PushButtonDelegate(m_testList, this);
	delegate->addButton(1, QApplication::style()->standardIcon(QStyle::SP_MediaPlay));
	delegate->addButton(2, QApplication::style()->standardIcon(QStyle::SP_FileIcon));
	m_testList->setItemDelegate(delegate);

	m_testList->header()->setResizeMode(0, QHeaderView::Stretch);
	m_testList->header()->setResizeMode(1, QHeaderView::Fixed);
	m_testList->header()->setResizeMode(2, QHeaderView::Fixed);
	m_testList->header()->setStretchLastSection(false);

	m_contextMenu = new QMenu(this);
	m_contextMenu->addAction(tr("Run"), this, SLOT(runCurrentTest()));
	m_contextMenu->addAction(tr("Edit"), this, SLOT(editCurrentTest()));
	m_contextMenu->addSeparator();
	m_contextMenu->addAction(tr("Delete"), this, SLOT(deleteCurrentTest()));

	setTestSet(m_testSetEdit->currentText());

	m_testList->setContextMenuPolicy(Qt::CustomContextMenu);

	QObject* deleteObserver = new ModelIndexKeyEventObserver(QKeySequence::Delete, m_testList);

	connect(
		deleteObserver,
		SIGNAL(released(QModelIndex)),
		SLOT(deleteCurrentTest())
	);

	connect(
		m_testList,
		SIGNAL(customContextMenuRequested(QPoint)),
		SLOT(showTestContextMenu(QPoint))
	);

	connect(
		m_testSetEdit,
		SIGNAL(activated(QString)),
		SLOT(setTestSet(QString))
	);

	connect(
		m_runAllButton,
		SIGNAL(clicked()),
		SLOT(runAllTests())
	);

	connect(
		m_addTestButton,
		SIGNAL(clicked()),
		SLOT(startRecording())
	);

	connect(
		m_hooqRecordInjector,
		SIGNAL(finished(int)),
		SLOT(finishRecording())
	);

	connect(
		m_testNameEdit,
		SIGNAL(textChanged(QString)),
		SLOT(updateActionStates())
	);

	connect(
		m_addTestSetButton,
		SIGNAL(clicked()),
		SLOT(addTestSet())
	);

	connect(
		m_newTestSet,
		SIGNAL(triggered()),
		SLOT(addTestSet())
	);
	connect(
		m_editTestSet,
		SIGNAL(triggered()),
		SLOT(editTestSet())
	);
	connect(
		m_removeTestSet,
		SIGNAL(triggered()),
		SLOT(removeTestSet())
	);
	connect(
		m_exportSet,
		SIGNAL(triggered()),
		SLOT(exportCurrentSet())
	);
	connect(
		m_importSet,
		SIGNAL(triggered()),
		SLOT(importTestSet())
	);
	connect(
		m_editor,
		SIGNAL(pickRequested()),
		m_interpreter,
		SLOT(pickObject())
	);
	connect(
		m_editor,
		SIGNAL(startRequested()),
		SLOT(runEditorTest())
	);

	connect(
		m_editor,
		SIGNAL(exceptionThrown(QString, QStringList)),
		SLOT(logException(QString, QStringList))
	);

	connect(
		m_interpreter,
		SIGNAL(objectPicked(ObjectInformation)),
		m_editor,
		SLOT(objectPicked(ObjectInformation))
	);
	connect(
		m_interpreter,
		SIGNAL(objectNotFound(QString)),
		m_editor,
		SLOT(objectNotFound(QString))
	);
	connect(
		m_interpreter,
		SIGNAL(executionFailed(int)),
		m_editor,
		SLOT(handleApplicationExit(int))
	);

	connect(
		m_interpreter,
		SIGNAL(finished()),
		SLOT(testFinished())
	);
	connect(
		m_interpreter,
		SIGNAL(startApplicationAndAttach()),
		SLOT(startApplication())
	);

	connect(
		m_quit,
		SIGNAL(triggered()),
		qApp,
		SLOT(quit())
	);

	connect(
		m_aboutQt,
		SIGNAL(triggered()),
		qApp,
		SLOT(aboutQt())
	);

	connect(
		m_about,
		SIGNAL(triggered()),
		SLOT(about())
	);

	ColumnClickMapper* mapper = new ColumnClickMapper(m_testList);
	mapper->addMapping(1, this, SLOT(runTestScript(QModelIndex)));
	mapper->addMapping(2, this, SLOT(editTestScript(QModelIndex)));

	updateActionStates();
}
Пример #18
0
Status TestDriver::runTests()
{
    cout << "\nRunning " << testName() << " tests...\n";


    // Kill anything that might be hanging around.

    char* newdbpath;
    char* newlogpath;
   
	char remove_logcmd[50];
	char remove_dbcmd[50];

    newdbpath = new char[ strlen(dbpath) + 20];
    newlogpath = new char[ strlen(logpath) + 20];
    strcpy(newdbpath,dbpath); 
    strcpy(newlogpath, logpath);

#ifdef MULTIUSER
	pwd = getpwuid(getuid());
	sprintf(remove_dbcmd, "/bin/rm -rf %s-%s", dbpath, pwd->pw_name);
	sprintf(remove_logcmd, "/bin/rm -rf %s-%s", logpath, pwd->pw_name);
#else
	sprintf(remove_logcmd, "/bin/rm -rf %s", logpath);
	sprintf(remove_dbcmd, "/bin/rm -rf %s", dbpath);
#endif
	
	system(remove_logcmd);
	system(remove_dbcmd);

#ifdef MULTIUSER
  if ( (pwd = getpwuid(getuid())) != NULL) {
	  sprintf( newdbpath, "%s-%s", dbpath, pwd->pw_name );
  	  sprintf( newlogpath, "%s-%s", logpath, pwd->pw_name );
  }
#else
  sprintf(newdbpath, "%s", dbpath);
  sprintf(newlogpath, "%s", logpath);
#endif


    unlink( newdbpath );
    unlink( newlogpath );

    minibase_errors.clear_errors();


      // Run the tests.
    Status answer = runAllTests();


      // Clean up.
    unlink( newdbpath );
    unlink( newlogpath );
    minibase_errors.clear_errors();

    cout << "\n..." << testName() << " tests "
         << (answer == OK ? "completed successfully" : "failed")
         << ".\n\n";

    delete newdbpath; delete newlogpath;

    return answer;
}
Пример #19
0
// all comparisons done with upper case (mostly because of Open MVS
void TestRunner::run (int ac, const char **av)
{
	TString testCase;

	if (ac == 1) {
		usage(av[0]);
		return;
	} // if

	for (int i = 1; i < ac; ++i) {
		testCase = av [i];
		testCase.ToUpper();
		if ( testCase == "-H" ) {
			usage(av[0]);
			return;
		} else if ( testCase == "-ALL" ) {
			runAllTests();
			continue;
		} else if (testCase == "-LOG") {
			if (i < ac - 1) {
				setLogToFileNamed(av[++i]);
			} // if
			continue;
		} else if (testCase == "-OUT") {
			if (i < ac - 1) {
				++i;
				int outfile = open(av[i], O_RDWR | O_CREAT | O_TRUNC, 0660);
				if (outfile > 0) {	// make it stdout
					std::cout << "redirecting output to " << av[i] << std::endl;
					close(1);
					dup(outfile);	// ignore possible errors for now
					close(outfile);
				} else {
					std::cout << "output redirection failed" << std::endl;
				} // if
			} // if
			continue;
		} else if (testCase == "-ERR") {
			if (i < ac - 1) {
				++i;
				int outfile = open(av[i], O_RDWR | O_CREAT | O_TRUNC, 0660);
				if (outfile > 0) {	// make it stdout
					std::cerr << "redirecting errors to " << av[i] << std::endl;
					close(2);
					dup(outfile);	// ignore possible errors for now
					close(outfile);
				} else {
					std::cerr << "error redirection failed" << std::endl;
				} // if
			} // if
			continue;
		} else if (testCase == "-LIST") {
			listTests();
			continue;
		} else if (testCase == "-WAIT") {
			fWait = true;
			continue;
		} // if

		Test *test;
		for ( test = fMappings->first(); test != 0 ;
			  test = fMappings->next() ) {
			TString className = test->getClassName();
			className.ToUpper();

			if ( className == testCase ) {
				run(test->getSuite());
				break;
			} // if
		} // for

		if ( !test ) {
			std::cout << "Test " << testCase << " not found." << std::endl;
			return;
		}
	}
}
Пример #20
0
PP_EXPORT int32_t PPP_InitializeModule(PP_Module /*_module*/, PPB_GetInterface /*_interface*/)
{
	DBG("PPAPI version: %d", PPAPI_RELEASE);
	runAllTests(BX_COUNTOF(s_argv), s_argv);
	return PP_ERROR_NOINTERFACE;
}
Пример #21
0
int main(int argc, char *argv[]) {
   
  return runAllTests();
}
Пример #22
0
int main(int argc, char const *argv[]) {
    return runAllTests(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE;
}
Пример #23
0
int main(int argc, char const *argv[]) {
	runAllTests(argc, argv);
	return 0;
}
Пример #24
0
int main(void)
{
	runAllTests();
	return 0;
}
Пример #25
0
int main(int argc, const char * argv[]) {
    runAllTests();
}