First public contribution.
2 * Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #include "t_testhandler.h"
21 #include "tScriptTests.h"
22 #include "t_testsetup.h"
26 #include "tconstructionfb.h"
27 #include "tconstructionvector.h"
28 #include "tbasicmathsvector.h"
29 #include "tbasicmathsfb.h"
30 #include "tmontgomeryvector.h"
31 #include "tmontgomeryfb.h"
32 #include "tprimevector.h"
33 #include "tmontgomeryperformance.h"
34 #include "tprimegenperformance.h"
35 #include "tprimevectorperformance.h"
36 #include "tprimegen.h"
37 #include "tprimegenvector.h"
40 LOCAL_D void callExampleL() // initialize and call example code under cleanup stack
43 SCRIPT_ITEM(CMontgomeryPerformance,_L8("MontgomeryPerformance")),
44 SCRIPT_ITEM(CPrimeVector,_L8("PrimeVector")),
45 SCRIPT_ITEM(CConstructionFB,_L8("ConstructionFB")),
46 SCRIPT_ITEM(CConstructionVector,_L8("ConstructionVector")),
47 SCRIPT_ITEM(CBasicMathsVector,_L8("BasicMathsVector")),
48 SCRIPT_ITEM(CBasicMathsFB,_L8("BasicMathsFB")),
49 SCRIPT_ITEM(CMontgomeryVector,_L8("MontgomeryVector")),
50 SCRIPT_ITEM(CMontgomeryFB,_L8("MontgomeryFB")),
51 SCRIPT_ITEM(CPrimeGenPerformance,_L8("PrimeGenPerformance")),
52 SCRIPT_ITEM(CPrimeVectorPerformance,_L8("PrimeVectorPerformance")),
53 SCRIPT_ITEM(CPrimeGen,_L8("PrimeGen")),
54 SCRIPT_ITEM(CPrimeGenVector,_L8("PrimeGenVector"))
57 // Either run the top level build and test script or, if running this test specifically,
58 // uncomment the following and it'll run them all one after the other
60 CSystemRandom *rng = CSystemRandom::NewL();
61 SetThreadRandomLC(rng);
63 TDriveUnit sysDrive (static_cast <TInt> (RFs::GetSystemDrive()));
64 TBuf<64> scriptFile = sysDrive.Name();
65 scriptFile.Append(_L("\\tbigint\\tbasicmathstests.txt"));
66 TBuf<64> logFile = sysDrive.Name();
67 logFile.Append(_L("\\tbigint\\tbasicmaths.log"));
69 CTestSetup::CreateAndRunTestsL(theTestTypes, scriptFile, logFile);
71 /* CTestSetup::CreateAndRunTestsL(theTestTypes,
72 _L("c:\\tbigint\\tconstructiontests.txt"),
73 _L("c:\\tbigint\\tconstruction.log"));
74 CTestSetup::CreateAndRunTestsL(theTestTypes,
75 _L("c:\\tbigint\\tprimegen.txt"),
76 _L("c:\\tbigint\\tprimegen.log"));
77 CTestSetup::CreateAndRunTestsL(theTestTypes,
78 _L("c:\\tbigint\\tprimegenperformance.txt"),
79 _L("c:\\tbigint\\tprimegenperformance.log"));
80 CTestSetup::CreateAndRunTestsL(theTestTypes,
81 _L("c:\\tbigint\\tmontgomerytests.txt"),
82 _L("c:\\tbigint\\tmontgomery.log"));
83 CTestSetup::CreateAndRunTestsL(theTestTypes,
84 _L("c:\\tbigint\\tperformancetests.txt"),
85 _L("c:\\tbigint\\tperformance.log"));
86 CTestSetup::CreateAndRunTestsL(theTestTypes,
87 _L("c:\\tbigint\\tprimetests.txt"),
88 _L("c:\\tbigint\\tprime.log"));
89 CTestSetup::CreateAndRunTestsL(theTestTypes,
90 _L("c:\\tbigint\\tprimetests2.txt"),
91 _L("c:\\tbigint\\tprime2.log"));
94 DestroyThreadRandom();
95 CleanupStack::Pop(); // Pop the cleanup item which would have reset/delete the threadrandom
98 GLDEF_C TInt E32Main() // main function called by E32
101 CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack
102 TRAPD(error, callExampleL());
103 __ASSERT_ALWAYS(!error,User::Panic(_L("bigint"),error));
104 delete cleanup; // destroy clean-up stack