1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
program test_castle_game_engine;
{ Define this if you use text runner for our tests.
Usually this is automatically defined by calling compile_console.sh. }
{ $define TEXT_RUNNER}
{ Define this to disable any GUI tests (using CastleWindow).
The CastleWindow
- Conflicts with LCL windows (so it can be used only when TEXT_RUNNER,
otherwise we use a runner that shows output in LCL window).
- Can work only when graphical window system (like X on Unix)
is available (e.g. not inside non-X ssh session, or cron).
}
{ $define NO_WINDOW_SYSTEM}
{$mode objfpc}{$H+}
uses
{$ifdef TEXT_RUNNER}
CastleConsoleTestRunner, ConsoleTestRunner,
{$else}
Interfaces, Forms, GuiTestRunner, castle_base,
{$endif}
CastleLog, CastleApplicationProperties,
{ Test units below. Their order determines default tests order. }
{ Testing (mainly) things inside FPC standard library, not CGE }
TestCompiler,
TestSysUtils,
TestFGL,
TestGenericsCollections,
TestOldFPCBugs,
TestFPImage,
{ Testing CGE units }
TestCastleUtils,
TestCastleRectangles,
TestCastleGenericLists,
TestCastleFilesUtils,
TestCastleUtilsLists,
TestCastleClassUtils,
TestCastleVectors,
TestCastleTriangles,
TestCastleColors,
TestCastleKeysMouse,
TestCastleImages,
TestCastleImagesDraw,
TestCastleBoxes,
TestCastleFrustum,
TestCastleTransform,
TestCastleParameters,
TestCastleCameras,
TestX3DFields,
TestX3DNodes,
TestX3DNodesOptimizedProxy,
TestCastleScene,
TestCastleSceneCore,
TestCastleSceneManager,
TestCastleVideos,
TestCastleSpaceFillingCurves,
TestCastleStringUtils,
TestCastleScript,
TestCastleScriptVectors,
TestCastleCubeMaps,
TestCastleGLVersion,
TestCastleCompositeImage,
TestCastleTriangulate,
TestCastleGame,
TestCastleURIUtils,
TestCastleXMLUtils,
TestCastleCurves,
TestCastleTimeUtils,
TestCastleControls,
TestCastleRandom,
TestCastleSoundEngine
{$ifdef TEXT_RUNNER} {$ifndef NO_WINDOW_SYSTEM},
TestCastleWindow,
TestCastleOpeningAndRendering3D,
TestCastleGLFonts,
TestCastleWindowOpen
{$endif} {$endif}
{ Stuff requiring Lazarus LCL. }
{$ifndef TEXT_RUNNER},
TestCastleLCLUtils
{$endif};
{$ifdef TEXT_RUNNER}
var
Application: TCastleConsoleTestRunner;
{$endif}
{var
T: TTestCastleTransform;}
begin
ApplicationProperties.OnWarning.Add(@ApplicationProperties.WriteWarningOnConsole);
// avoid warnings that opening files too early
ApplicationProperties._FileAccessSafe := true;
{ Sometimes it's comfortable to just run the test directly, to get
full backtrace from FPC.
T := TTestCastleTransform.Create;
T.TestPhysicsWorldOwnerEmptyBox;
T.Free;
Exit;}
{$ifdef TEXT_RUNNER}
Application := TCastleConsoleTestRunner.Create(nil);
Application.Title := 'Castle Game Engine test runner (using fpcunit)';
DefaultFormat := fPlain;
{$endif}
Application.Initialize;
{$ifndef TEXT_RUNNER}
Application.CreateForm(TGuiTestRunner, TestRunner);
{$endif}
Application.Run;
{$ifdef TEXT_RUNNER}
Application.Free;
{$endif}
end.
|