2 * Copyright 2002-2010, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
9 #include <SemaphoreSyncObject.h>
10 #include <Directory.h>
12 #include "UnitTester.h"
15 UnitTesterShell::UnitTesterShell(const std::string
&description
,
16 SyncObject
*syncObject
)
18 BTestShell(description
, syncObject
)
24 UnitTesterShell::PrintDescription(int argc
, char *argv
[])
26 printf("This program is the central testing framework for the purpose\n"
27 "of testing and verifying the various kits, classes, functions,\n"
28 "and the like that comprise Haiku.\n");
33 UnitTesterShell::PrintValidArguments()
35 BTestShell::PrintValidArguments();
36 printf(" -haiku Runs tests linked against our Haiku "
37 "libraries (*default*)\n"
38 " -r5 Runs tests linked against Be Inc.'s R5 "
39 "libraries (instead\n"
40 " of our libraries) for the sake of comparison.\n");
45 UnitTesterShell::LoadDynamicSuites()
47 // Add the appropriate test lib path
48 std::string defaultLibDir
= std::string(GlobalTestDir()) + "/lib";
49 fLibDirs
.insert(defaultLibDir
);
52 BTestShell::LoadDynamicSuites();
60 main(int argc
, char *argv
[])
62 UnitTesterShell
shell("Haiku Unit Testing Framework",
63 new SemaphoreSyncObject
);
65 // ##### Add test suites for statically linked tests here #####
66 //shell.AddTest("Example", ExampleTest::Suite());
68 BTestShell::SetGlobalShell(&shell
);
70 // Load our dynamically linked tests
72 int result
= shell
.Run(argc
, argv
);
74 // Unset global shell, just to be sure
75 BTestShell::SetGlobalShell(NULL
);