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