Files
haiku-beta6/src/tests/UnitTester.cpp
T
Axel Dörfler 52702ce24d * indent is obviously only 2 spaces.
* BTW, the tests work on GCC4 just fine, only the GCC2 build doesn't work, so
  it's likely to be a newly introduced compiler problem as those tests worked
  under BeOS fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39674 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-29 18:51:33 +00:00

79 lines
1.6 KiB
C++

/*
* Copyright 2002-2010, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#include <stdio.h>
#include <SemaphoreSyncObject.h>
#include <Directory.h>
#include "UnitTester.h"
UnitTesterShell::UnitTesterShell(const std::string &description,
SyncObject *syncObject)
:
BTestShell(description, syncObject)
{
}
void
UnitTesterShell::PrintDescription(int argc, char *argv[])
{
printf("This program is the central testing framework for the purpose\n"
"of testing and verifying the various kits, classes, functions,\n"
"and the like that comprise Haiku.\n");
}
void
UnitTesterShell::PrintValidArguments()
{
BTestShell::PrintValidArguments();
printf(" -haiku Runs tests linked against our Haiku "
"libraries (*default*)\n"
" -r5 Runs tests linked against Be Inc.'s R5 "
"libraries (instead\n"
" of our libraries) for the sake of comparison.\n");
}
void
UnitTesterShell::LoadDynamicSuites()
{
// Add the appropriate test lib path
std::string defaultLibDir = std::string(GlobalTestDir()) + "/lib";
fLibDirs.insert(defaultLibDir);
// Load away
BTestShell::LoadDynamicSuites();
}
// #pragma mark -
int
main(int argc, char *argv[])
{
UnitTesterShell shell("Haiku Unit Testing Framework",
new SemaphoreSyncObject);
// ##### Add test suites for statically linked tests here #####
//shell.AddTest("Example", ExampleTest::Suite());
BTestShell::SetGlobalShell(&shell);
// Load our dynamically linked tests
int result = shell.Run(argc, argv);
// Unset global shell, just to be sure
BTestShell::SetGlobalShell(NULL);
return result;
}