Exemplo n.º 1
0
bool BIO::CORE::TestCore()
{
#if BIO_TESTING_IS_ENABLED == BIO_TESTING_OFF
	std::cout << "Testing is disabled" << std::endl;
	return true;
#else //TESTING IS ENABLED
	//create a test suite for this class
	XNELO::TESTING::TestSuite testSuite("BIO CORE Tests");
	XNELO::TESTING::OutStreamGenerator output;

	testSuite.SetReportGenerator(&output);

	//add the test functions
	testSuite.AddTestFunction(TestBasicTypes);
	testSuite.AddTestFunction(STRING::TestStringUtils);
	testSuite.AddTestFunction(FILE::FileUtilsTests);

	//run tests and print out results
	testSuite.ExecuteTests();

	//save the return value
	bool retValue = testSuite.GetSuccess();

	return retValue;
#endif //BIO_TESTING_IS_ENABLED
}
Exemplo n.º 2
0
int main(int argc, char** argv)
{
    mojo::edk::Init();

    base::TestSuite testSuite(argc, argv);
    return base::LaunchUnitTests(argc, argv, base::Bind(&runHelper, base::Unretained(&testSuite)));
}
Exemplo n.º 3
0
// TestSuite must be created before SetUpTestEnvironment so it performs
// initializations needed by WebKit support. This is slightly complicated by the
// fact that chromium multi-dll build requires that the TestSuite object be created
// and run inside webkit.dll.
int main(int argc, char** argv)
{
#if defined(BLINK_DLL_UNITTEST)
    blink::InitTestSuite(argc, argv);
    content::SetUpTestEnvironmentForWebKitUnitTests();
    int result = blink::RunAllUnitTests();
    content::TearDownEnvironmentForWebKitUnitTests();
    blink::DeleteTestSuite();
#else
    ::testing::InitGoogleMock(&argc, argv);
    TestSuite testSuite(argc, argv);
    content::SetUpTestEnvironmentForWebKitUnitTests();
    int result = testSuite.Run();
    content::TearDownEnvironmentForWebKitUnitTests();
#endif

    return result;
}
Exemplo n.º 4
0
int main(void)
{
	int testResult;
	Suite *suite;
	SRunner *suiteRunner;


	// create the test suite and the runner
	suite = testSuite();
	suiteRunner = srunner_create(suite);

	// execute the tests
	srunner_run_all(suiteRunner, CK_NORMAL);
	testResult = srunner_ntests_failed(suiteRunner);
	srunner_free(suiteRunner);

	return (testResult == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
Exemplo n.º 5
0
int main(int argc, char** argv)
{
    base::CommandLine::Init(argc, argv);

    WTF::Partitions::initialize(nullptr);
    WTF::setTimeFunctionsForTesting(dummyCurrentTime);
    WTF::initialize(nullptr);
    WTF::initializeMainThread(0);

    blink::TestingPlatformSupport::Config platformConfig;
    cc_blink::WebCompositorSupportImpl compositorSupport;
    platformConfig.compositorSupport = &compositorSupport;
    blink::TestingPlatformSupport platform(platformConfig);

    blink::Heap::init();
    blink::ThreadState::attachMainThread();
    blink::ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr);
    blink::EventTracer::initialize();

    blink::HTTPNames::init();

    base::TestSuite testSuite(argc, argv);

    mojo::edk::Init();
    base::TestIOThread testIoThread(base::TestIOThread::kAutoStart);
    WTF::OwnPtr<mojo::edk::test::ScopedIPCSupport> ipcSupport(
        adoptPtr(new mojo::edk::test::ScopedIPCSupport(testIoThread.task_runner())));

    int result = base::LaunchUnitTests(argc, argv, base::Bind(runTestSuite, base::Unretained(&testSuite)));

    blink::ThreadState::detachMainThread();
    blink::Heap::shutdown();

    WTF::shutdown();
    WTF::Partitions::shutdown();
    return result;
}
Exemplo n.º 6
0
struct TestSuite * StubShellTest_suite() {
	return testSuite("StubShellTest", testGetCurrentTime, NULL);
}
Exemplo n.º 7
0
int main(int argc, char **argv) {
  Command        cmd     = NO_COMMAND;
  char          *cp;
  int            verbose = 0;
  int            digits  = 0;
  BigReal        x;
  Array<BigReal> v;

  try {
    for(argv++; *argv && *(cp = *argv) == '-'; argv++) {
      for(cp++; *cp; cp++) {
        switch(*cp) {
        case 'v':
          for(cp++;*cp;cp++) {
            switch(*cp) {
            case 'd': verbose |= VERBOSE_DATA   ; continue;
            case 'm': verbose |= VERBOSE_MATRIX ; continue;
            case 'p': verbose |= VERBOSE_PIVOT  ; continue;
            case 'y': verbose |= VERBOSE_Y      ; continue;
            case 'i': verbose |= VERBOSE_INVA   ; continue;
            default : verbose  = VERBOSE_ALL    ; break;
            }
            break;
          }
          if(*cp) continue; else break;
        case 'p':
          if(sscanf(cp+1, "%u", &digits) != 1) {
            usage();
          }
          break;
        case 'r':
          if(cmd != NO_COMMAND) {
            usage();
          }
          cmd = FIND_POLYNOMIAL;
          x = BigReal(cp+1);
          break;
        case 'x':
          { if(cmd != NO_COMMAND) {
              usage();
            }
            cmd = FIND_RELATION;
            const String tmp(cp+1);
            for(Tokenizer tok(tmp,_T(",")); tok.hasNext();) {
              v.add(BigReal(tok.next()));
            }
          }
          break;
        case 'f':
          { if(cmd != NO_COMMAND) {
              usage();
            }
            cmd = FIND_RELATION;
            char *fileName = cp+1;

            tistream *input = (fileName[0] == '\0') ? (tistream*)&tcin : new tifstream(fileName);
            while(!input->eof() && !input->bad()) {
              BigReal x;
              (*input) >> x;
              v.add(x);
            }
            if(input->bad()) {
              tcerr << _T("Invalid input in ") << fileName << endl;
              exit(-1);
            }
            if(input != &tcin) {
              delete input;
            }
          }
          break;
        case 't':
          if(cmd != NO_COMMAND) {
            usage();
          }
          cmd = TEST_PSLQ;
          continue;

        default :
          usage();
        }
        break;
      }
    }

    if(cmd == NO_COMMAND) {
      usage();
    }

    switch(cmd) {
    case FIND_POLYNOMIAL:
      findIntegerPolynomial(x,digits,verbose);
      break;
    case FIND_RELATION  :
      findIntegerRelation(v,digits,verbose);
      break;
    case TEST_PSLQ:
      testSuite(digits,verbose);
      break;
    }
  } catch(Exception e) {
    _ftprintf(stderr,_T("Exception:%s\n"), e.what());
    return -1;
  }
  return 0;

//  BaileyBorwein(200);
}
Exemplo n.º 8
0
void TxtTestReport::beginTestCase(TestCase *testCase)
{
    fout("%%: %%::run()\n") << testSuite()->name() << testCase->name();
    fout("...........................................................\n");
}
Exemplo n.º 9
0
int runWebTests(int argc, char** argv, void (*preTestHook)(void), void (*postTestHook)(void))
{
    base::TestSuite testSuite(argc, argv);
    return base::LaunchUnitTests(argc, argv, base::Bind(&runHelper, base::Unretained(&testSuite), preTestHook, postTestHook));
}