settingsengines/sdb/tests/native/SdbTest/Readme.txt
changeset 1 b538b70cbe51
equal deleted inserted replaced
0:2e8eeb919028 1:b538b70cbe51
       
     1 SdbTest
       
     2 =======
       
     3 
       
     4   SdbTest works in cooperation with Java part of the framework (see Emulator class).
       
     5 
       
     6   Emulator launches SdbTest executable and can retrieve test result. SdbTest stores result code in: 
       
     7   
       
     8   epoc32/winscw/c/SdbTestOut.txt.
       
     9 
       
    10   Each native test is named. Particular test to be run when SdbTest is specified by including test 
       
    11   name as the first parameter on the command line.
       
    12 
       
    13 
       
    14 Java example 
       
    15 ============
       
    16 
       
    17   From the Java side it is enough to write:
       
    18 
       
    19   // Discovering available emulators 
       
    20 
       
    21   // Emulator configs are read from XML file specified by "com.symbian.sdb.emulator.def" system property
       
    22   // See below for example file
       
    23   Emulator[] emulators = Emulator.availableEmulators()
       
    24 
       
    25 
       
    26   // Running the test and checking the result
       
    27   
       
    28   emulators[0].setOutFile("SdbTestOut.txt");
       
    29   String [] cmds = {"ExampleTest"}; 
       
    30   try{
       
    31 	int result = emulators[0].runNativeTestAndWait("SdbTest.exe", cmds, SymbianStartupMode.TEXT_ONLY);
       
    32 	System.out.println("OK : " + Integer.toHexString(result));
       
    33   } catch(Exception e){
       
    34 	e.printStackTrace();
       
    35   }
       
    36 
       
    37 
       
    38 
       
    39 Adding a native verification test
       
    40 =================================
       
    41 
       
    42   1. Modify RegisterTestsL in src/Tests.cpp to register your test function
       
    43   2. Implement your test function by either:
       
    44      a) Adding your test function to src/Tests.cpp
       
    45      b) Implementing test function in a separate file and adding the new file to group/SdbTest.mmp.
       
    46 
       
    47   An example test named ExampleTest is included in the src/Tests.cpp.
       
    48 
       
    49 
       
    50 Example Emulator definition XML file
       
    51 ====================================
       
    52 
       
    53 <emulators>
       
    54   <emulator>
       
    55     <driveLetter>N</driveLetter>
       
    56     <epocroot>/9.3/</epocroot>
       
    57     <platform>WINSCW</platform>
       
    58     <variant>UDEB</variant>
       
    59     <version>SOS_9_3</version>
       
    60   </emulator>
       
    61   <emulator>
       
    62     <driveLetter>N</driveLetter>
       
    63     <epocroot>/9.4/</epocroot>
       
    64     <platform>WINSCW</platform>
       
    65     <variant>UDEB</variant>
       
    66     <version>SOS_9_4</version>
       
    67   </emulator>
       
    68   <emulator>
       
    69     <driveLetter>N</driveLetter>
       
    70     <epocroot>/9.5/</epocroot>
       
    71     <platform>WINSCW</platform>
       
    72     <variant>UDEB</variant>
       
    73     <version>SOS_9_5</version>
       
    74   </emulator>
       
    75 </emulators>