{ --------------------------------------------------------------------------- }
{ AnyDAC Speed Tester - dataset and test registration unit                    }
{ Copyright (c) 2004 by Dmitry Arefiev (www.da-soft.com)                      }
{                                                                             }
{ All rights reserved.                                                        }
{ --------------------------------------------------------------------------- }
{$I ADSpeed.inc}

unit ADSpeedReg;

interface

uses
  ADSpeedBase;

  function ADSpeedRegister: TADSpeedTestManager;
  procedure ADSpeedUnRegister;

implementation

uses
  ADSpeedTests,
  ADSpeedBDE,
  ADSpeedSQLDirect,
{$IFDEF AnyDACSPEED_ORA}
  ADSpeedNCOCI8,
  ADSpeedDOA,
  ADSpeedODAC,
{$ENDIF}
{$IFDEF AnyDACSPEED_MSSQL}
  ADSpeedSDAC,
{$ENDIF}
{$IFDEF AnyDAC_D6}
  ADSpeedDbExpr,
{$ENDIF}
  ADSpeedAD,
  ADSpeedADO,
  ADSpeedODBC;

{---------------------------------------------------------------------------}
function ADSpeedRegister: TADSpeedTestManager;
begin
  if ADSpeedTestManager = nil then begin
    ADSpeedTestManager := TADSpeedTestManager.Create;
    // register tests
    ADSpeedTestManager.RegisterTest(TADSpeedFetch1WithBLOBSTest, 1000);
    ADSpeedTestManager.RegisterTest(TADSpeedFetch1WithoutBLOBSTest, 1000);
    ADSpeedTestManager.RegisterTest(TADSpeedFetchAllWithBLOBSTest, 1);
    ADSpeedTestManager.RegisterTest(TADSpeedFetchAllWithoutBLOBSTest, 1);
    ADSpeedTestManager.RegisterTest(TADSpeedExecSQLTest, 10000);
    ADSpeedTestManager.RegisterTest(TADSpeedExecArraySQLTest, 10000);
{$IFDEF AnyDACSPEED_ORA}
    // register DB's
    ADSpeedTestManager.RegisterDS(TADSpeedOraBDEQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedOraSQLDirectQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedNCOCI8Query);
    ADSpeedTestManager.RegisterDS(TADSpeedDbxOraADQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedDirOraADQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedDOAQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedODACQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedOraDbExprQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedCrlabOraDbExprQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedCrlabNetOraDbExprQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedCrlabOraSQLDataSetQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedOra4OraADOQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedMs4OraADOQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedOra4OraODBCQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedMs4OraODBCQuery);
    // exclusions
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedOra4OraADOQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedMs4OraADOQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedOra4OraODBCQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedMs4OraODBCQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedOraBDEQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedOraSQLDirectQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedOraDbExprQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedCrlabOraDbExprQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedCrlabNetOraDbExprQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedCrlabOraSQLDataSetQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecSQLTest,      TADSpeedCrlabOraSQLDataSetQuery);
{$ENDIF}
{$IFDEF AnyDACSPEED_MSSQL}
    // register DB's
    ADSpeedTestManager.RegisterDS(TADSpeedMssqlBDEQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedMssqlSQLDirectQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedDirMssqlADQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedMssqlDbExprQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedCrlabMssqlDbExprQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedMs4MssqlADOQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedMs4MssqlODBCQuery);
    ADSpeedTestManager.RegisterDS(TADSpeedSDACQuery);
    // exclusions
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedMs4MssqlADOQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedMs4MssqlODBCQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedMssqlBDEQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedMssqlSQLDirectQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedMssqlDbExprQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedCrlabMssqlDbExprQuery);
    ADSpeedTestManager.ExcludeTest(TADSpeedExecArraySQLTest, TADSpeedSDACQuery);
{$ENDIF}
  end;
  Result := ADSpeedTestManager;
end;

{---------------------------------------------------------------------------}
procedure ADSpeedUnRegister;
begin
  ADSpeedTestManager.Free;
  ADSpeedTestManager := nil;
end;

end.

