testability-driver 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. data/README +1 -0
  2. data/bin/start_app_perf +199 -0
  3. data/bin/tdriver-devtools +3 -0
  4. data/config/sut_parameters.rb +39 -0
  5. data/ext/extconf.rb +67 -0
  6. data/ext/native_extensions.c +70 -0
  7. data/lib/matti.rb +30 -0
  8. data/lib/tdriver-devtools/behaviour/old/xml/example/flick-example.rb +223 -0
  9. data/lib/tdriver-devtools/behaviour/old/xml/example/impl.rb_invalid +194 -0
  10. data/lib/tdriver-devtools/behaviour/old/xml/generate_behaviour_xml.rb +95 -0
  11. data/lib/tdriver-devtools/behaviour/old/xml/lib/tdriver_generator.rb +722 -0
  12. data/lib/tdriver-devtools/behaviour/old/xml/qdoc_generator.rb +321 -0
  13. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.method.template +43 -0
  14. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.module.template +54 -0
  15. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.argument.template +7 -0
  16. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.argument_type.template +7 -0
  17. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.exception.template +5 -0
  18. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.howto.line.template +2 -0
  19. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.howto.template +5 -0
  20. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.method.template +23 -0
  21. data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.template +14 -0
  22. data/lib/tdriver-devtools/behaviour/old/xml/update +3 -0
  23. data/lib/tdriver-devtools/behaviour/xml/generate.rb +88 -0
  24. data/lib/tdriver-devtools/behaviour/xml/rdoc_behaviour_xml_generator.rb +1924 -0
  25. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument.default.template +1 -0
  26. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument.template +3 -0
  27. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument_type.template +4 -0
  28. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.exception.template +4 -0
  29. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.arguments.template +4 -0
  30. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.deprecated.template +3 -0
  31. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.exceptions.template +3 -0
  32. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.info.template +1 -0
  33. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.returns.template +3 -0
  34. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.tables.template +3 -0
  35. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.template +12 -0
  36. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.returns.template +5 -0
  37. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.item.template +1 -0
  38. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.row.template +2 -0
  39. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.template +8 -0
  40. data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.template +14 -0
  41. data/lib/tdriver-devtools/behaviour/xml_generator/example/flick-example.rb +245 -0
  42. data/lib/tdriver-devtools/behaviour/xml_generator/example/sut.rb +964 -0
  43. data/lib/tdriver-devtools/behaviour/xml_generator/generate.rb +68 -0
  44. data/lib/tdriver-devtools/behaviour/xml_generator/lib/custom_rdoc_generator.rb +1865 -0
  45. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.argument.default.template +1 -0
  46. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.argument.template +3 -0
  47. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.argument_type.template +4 -0
  48. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.exception.template +4 -0
  49. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.method.arguments.template +4 -0
  50. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.method.deprecated.template +3 -0
  51. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.method.exceptions.template +3 -0
  52. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.method.info.template +1 -0
  53. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.method.returns.template +3 -0
  54. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.method.tables.template +3 -0
  55. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.method.template +12 -0
  56. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.returns.template +5 -0
  57. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.table.item.template +1 -0
  58. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.table.row.template +2 -0
  59. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.table.template +7 -0
  60. data/lib/tdriver-devtools/behaviour/xml_generator/templates/behaviour.xml.template +14 -0
  61. data/lib/tdriver-devtools/behaviour/xml_generator/update +3 -0
  62. data/lib/tdriver-devtools/doc/behaviour_xml/QtExampleGestureBehaviour.xml +138 -0
  63. data/lib/tdriver-devtools/doc/behaviour_xml/created.rid +1 -0
  64. data/lib/tdriver-devtools/doc/behaviour_xml/tdriver.hash +1 -0
  65. data/lib/tdriver-devtools/doc/feature_xml/qt_widget_hold.feature.xml +9 -0
  66. data/lib/tdriver-devtools/doc/feature_xml/qt_widget_tap.feature.xml +9 -0
  67. data/lib/tdriver-devtools/doc/generate.rb +892 -0
  68. data/lib/tdriver-devtools/doc/update +1 -0
  69. data/lib/tdriver-devtools/doc/xslt/html.rb +7 -0
  70. data/lib/tdriver-devtools/doc/xslt/template.xsl +1861 -0
  71. data/lib/tdriver-devtools/doc/xslt/update +3 -0
  72. data/lib/tdriver-devtools/plugin/placeholder.txt +1 -0
  73. data/lib/tdriver-devtools/tdriver-devtools.rb +404 -0
  74. data/lib/tdriver-devtools/tests/feature_tests/example/flick-example.rb +233 -0
  75. data/lib/tdriver-devtools/tests/feature_tests/example/impl.rb +194 -0
  76. data/lib/tdriver-devtools/tests/feature_tests/generate.rb +82 -0
  77. data/lib/tdriver-devtools/tests/feature_tests/lib/custom_rdoc_generator.rb +468 -0
  78. data/lib/tdriver-devtools/tests/feature_tests/templates/feature_attribute.template +5 -0
  79. data/lib/tdriver-devtools/tests/feature_tests/templates/feature_method.template +5 -0
  80. data/lib/tdriver-devtools/tests/feature_tests/templates/scenario_attribute.template +5 -0
  81. data/lib/tdriver-devtools/tests/feature_tests/templates/scenario_method.template +5 -0
  82. data/lib/tdriver-devtools/tests/feature_tests/update +3 -0
  83. data/lib/tdriver.rb +26 -0
  84. data/lib/tdriver/base/behaviour/behaviour.rb +32 -0
  85. data/lib/tdriver/base/behaviour/behaviours/object_behaviour_composition.rb +94 -0
  86. data/lib/tdriver/base/behaviour/behaviours/object_behaviour_description.rb +262 -0
  87. data/lib/tdriver/base/behaviour/behaviours/object_composition.rb +111 -0
  88. data/lib/tdriver/base/behaviour/factory.rb +380 -0
  89. data/lib/tdriver/base/behaviour/loader.rb +28 -0
  90. data/lib/tdriver/base/command_data/command_data.rb +51 -0
  91. data/lib/tdriver/base/command_data/loader.rb +25 -0
  92. data/lib/tdriver/base/errors.rb +131 -0
  93. data/lib/tdriver/base/loader.rb +38 -0
  94. data/lib/tdriver/base/state_object.rb +270 -0
  95. data/lib/tdriver/base/sut/adapter.rb +28 -0
  96. data/lib/tdriver/base/sut/controller.rb +119 -0
  97. data/lib/tdriver/base/sut/factory.rb +287 -0
  98. data/lib/tdriver/base/sut/generic/behaviours/application.rb +243 -0
  99. data/lib/tdriver/base/sut/generic/behaviours/controller.rb +67 -0
  100. data/lib/tdriver/base/sut/generic/behaviours/find.rb +96 -0
  101. data/lib/tdriver/base/sut/generic/behaviours/flash_behaviour.rb +346 -0
  102. data/lib/tdriver/base/sut/generic/behaviours/sut.rb +1268 -0
  103. data/lib/tdriver/base/sut/generic/behaviours/switchbox_behaviour.rb +182 -0
  104. data/lib/tdriver/base/sut/generic/behaviours/verification.rb +119 -0
  105. data/lib/tdriver/base/sut/generic/commands/application.rb +219 -0
  106. data/lib/tdriver/base/sut/generic/commands/key_sequence.rb +82 -0
  107. data/lib/tdriver/base/sut/generic/commands/screen_capture.rb +58 -0
  108. data/lib/tdriver/base/sut/generic/plugin.rb +96 -0
  109. data/lib/tdriver/base/sut/loader.rb +35 -0
  110. data/lib/tdriver/base/sut/sut.rb +67 -0
  111. data/lib/tdriver/base/test_object/abstract.rb +179 -0
  112. data/lib/tdriver/base/test_object/behaviours/syncronization.rb +94 -0
  113. data/lib/tdriver/base/test_object/behaviours/test_object.rb +787 -0
  114. data/lib/tdriver/base/test_object/factory.rb +618 -0
  115. data/lib/tdriver/base/test_object/identificator.rb +511 -0
  116. data/lib/tdriver/base/test_object/loader.rb +37 -0
  117. data/lib/tdriver/env.rb +21 -0
  118. data/lib/tdriver/loader.rb +36 -0
  119. data/lib/tdriver/matti.rb +35 -0
  120. data/lib/tdriver/report/error_recovery/tdriver_custom_error_recovery.rb +83 -0
  121. data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +158 -0
  122. data/lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb +98 -0
  123. data/lib/tdriver/report/report.rb +47 -0
  124. data/lib/tdriver/report/report_api.rb +207 -0
  125. data/lib/tdriver/report/report_combine.rb +86 -0
  126. data/lib/tdriver/report/report_crash_file_capture.rb +167 -0
  127. data/lib/tdriver/report/report_creator.rb +571 -0
  128. data/lib/tdriver/report/report_cucumber.rb +158 -0
  129. data/lib/tdriver/report/report_cucumber_listener.rb +337 -0
  130. data/lib/tdriver/report/report_cucumber_reporter.rb +335 -0
  131. data/lib/tdriver/report/report_data_presentation.rb +152 -0
  132. data/lib/tdriver/report/report_data_table.rb +64 -0
  133. data/lib/tdriver/report/report_execution_statistics.rb +284 -0
  134. data/lib/tdriver/report/report_file_capture.rb +159 -0
  135. data/lib/tdriver/report/report_grouping.rb +539 -0
  136. data/lib/tdriver/report/report_junit_xml.rb +147 -0
  137. data/lib/tdriver/report/report_rspec.rb +108 -0
  138. data/lib/tdriver/report/report_test_case_run.rb +621 -0
  139. data/lib/tdriver/report/report_test_run.rb +1286 -0
  140. data/lib/tdriver/report/report_test_unit.rb +175 -0
  141. data/lib/tdriver/report/report_writer.rb +1405 -0
  142. data/lib/tdriver/tdriver.rb +158 -0
  143. data/lib/tdriver/util/common.rb +24 -0
  144. data/lib/tdriver/util/common/array.rb +39 -0
  145. data/lib/tdriver/util/common/crc16.rb +100 -0
  146. data/lib/tdriver/util/common/environment.rb +153 -0
  147. data/lib/tdriver/util/common/error.rb +39 -0
  148. data/lib/tdriver/util/common/file.rb +315 -0
  149. data/lib/tdriver/util/common/gem.rb +108 -0
  150. data/lib/tdriver/util/common/kernel.rb +189 -0
  151. data/lib/tdriver/util/common/loader.rb +39 -0
  152. data/lib/tdriver/util/common/retryable.rb +98 -0
  153. data/lib/tdriver/util/common/string.rb +77 -0
  154. data/lib/tdriver/util/dbaccess/dbaccess.rb +188 -0
  155. data/lib/tdriver/util/dbaccess/dbconnection.rb +41 -0
  156. data/lib/tdriver/util/dbaccess/error.rb +35 -0
  157. data/lib/tdriver/util/dbaccess/loader.rb +29 -0
  158. data/lib/tdriver/util/dynamic_attribute_filter.rb +182 -0
  159. data/lib/tdriver/util/hooking.rb +434 -0
  160. data/lib/tdriver/util/loader.rb +65 -0
  161. data/lib/tdriver/util/localisation.rb +24 -0
  162. data/lib/tdriver/util/localisation/error.rb +32 -0
  163. data/lib/tdriver/util/localisation/loader.rb +28 -0
  164. data/lib/tdriver/util/localisation/localisation.rb +479 -0
  165. data/lib/tdriver/util/logger.rb +377 -0
  166. data/lib/tdriver/util/operator_data/error.rb +29 -0
  167. data/lib/tdriver/util/operator_data/loader.rb +26 -0
  168. data/lib/tdriver/util/operator_data/operator_data.rb +93 -0
  169. data/lib/tdriver/util/other/config.rb +221 -0
  170. data/lib/tdriver/util/parameter.rb +24 -0
  171. data/lib/tdriver/util/parameter/error.rb +45 -0
  172. data/lib/tdriver/util/parameter/loader.rb +37 -0
  173. data/lib/tdriver/util/parameter/parameter.rb +285 -0
  174. data/lib/tdriver/util/parameter/parameter_hash.rb +101 -0
  175. data/lib/tdriver/util/parameter/parameter_template.rb +120 -0
  176. data/lib/tdriver/util/parameter/parameter_user_api.rb +84 -0
  177. data/lib/tdriver/util/parameter/parameter_xml.rb +247 -0
  178. data/lib/tdriver/util/plugin/abstract.rb +60 -0
  179. data/lib/tdriver/util/plugin/error.rb +25 -0
  180. data/lib/tdriver/util/plugin/loader.rb +28 -0
  181. data/lib/tdriver/util/plugin/service.rb +200 -0
  182. data/lib/tdriver/util/recorder.rb +292 -0
  183. data/lib/tdriver/util/stats.rb +90 -0
  184. data/lib/tdriver/util/user_data/error.rb +29 -0
  185. data/lib/tdriver/util/user_data/loader.rb +26 -0
  186. data/lib/tdriver/util/user_data/user_data.rb +103 -0
  187. data/lib/tdriver/util/video_rec.rb +264 -0
  188. data/lib/tdriver/util/xml/abstraction.rb +47 -0
  189. data/lib/tdriver/util/xml/builder.rb +54 -0
  190. data/lib/tdriver/util/xml/document.rb +32 -0
  191. data/lib/tdriver/util/xml/element.rb +32 -0
  192. data/lib/tdriver/util/xml/error.rb +46 -0
  193. data/lib/tdriver/util/xml/loader.rb +46 -0
  194. data/lib/tdriver/util/xml/nil_element.rb +89 -0
  195. data/lib/tdriver/util/xml/nodeset.rb +32 -0
  196. data/lib/tdriver/util/xml/parsers/libxml/libxml.rb +140 -0
  197. data/lib/tdriver/util/xml/parsers/loader.rb +22 -0
  198. data/lib/tdriver/util/xml/parsers/nokogiri/abstraction.rb +111 -0
  199. data/lib/tdriver/util/xml/parsers/nokogiri/attribute.rb +54 -0
  200. data/lib/tdriver/util/xml/parsers/nokogiri/builder.rb +58 -0
  201. data/lib/tdriver/util/xml/parsers/nokogiri/document.rb +58 -0
  202. data/lib/tdriver/util/xml/parsers/nokogiri/element.rb +147 -0
  203. data/lib/tdriver/util/xml/parsers/nokogiri/loader.rb +42 -0
  204. data/lib/tdriver/util/xml/parsers/nokogiri/nodeset.rb +187 -0
  205. data/lib/tdriver/util/xml/xml.rb +170 -0
  206. data/lib/tdriver/verify/verify.rb +687 -0
  207. data/lib/tdriver/verify/verify.rb_org +630 -0
  208. data/lib/tdriver/version.rb +21 -0
  209. data/xml/behaviours/generic.xml +495 -0
  210. data/xml/defaults/generic.xml +97 -0
  211. data/xml/defaults/sut_generic.xml +36 -0
  212. data/xml/parameters/tdriver_parameters.xml +23 -0
  213. data/xml/templates/generic.xml +227 -0
  214. metadata +327 -0
@@ -0,0 +1,47 @@
1
+ ############################################################################
2
+ ##
3
+ ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
+ ## All rights reserved.
5
+ ## Contact: Nokia Corporation (testabilitydriver@nokia.com)
6
+ ##
7
+ ## This file is part of Testability Driver.
8
+ ##
9
+ ## If you have questions regarding the use of this file, please contact
10
+ ## Nokia at testabilitydriver@nokia.com .
11
+ ##
12
+ ## This library is free software; you can redistribute it and/or
13
+ ## modify it under the terms of the GNU Lesser General Public
14
+ ## License version 2.1 as published by the Free Software Foundation
15
+ ## and appearing in the file LICENSE.LGPL included in the packaging
16
+ ## of this file.
17
+ ##
18
+ ############################################################################
19
+
20
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'error_recovery/tdriver_error_recovery_settings' ) )
21
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'error_recovery/tdriver_error_recovery' ) )
22
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'error_recovery/tdriver_custom_error_recovery' ) )
23
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_file_capture' ) )
24
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_crash_file_capture' ) )
25
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_writer' ) )
26
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_combine' ) )
27
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_data_table' ) )
28
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_creator' ) )
29
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_junit_xml' ) )
30
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_api' ) )
31
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_test_run' ) )
32
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_test_case_run' ) )
33
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_cucumber' ) )
34
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_cucumber_listener' ) )
35
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_cucumber_reporter' ) )
36
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_rspec' ) )
37
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_test_unit' ) )
38
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_grouping' ) )
39
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_execution_statistics' ) )
40
+ require File.expand_path( File.join( File.dirname( __FILE__ ), 'report_data_presentation' ) )
41
+
42
+ if MobyUtil::Parameter[ :custom_error_recovery_module, nil ]!=nil
43
+ require MobyUtil::Parameter[ :custom_error_recovery_module ]
44
+ end
45
+
46
+
47
+
@@ -0,0 +1,207 @@
1
+ ############################################################################
2
+ ##
3
+ ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
+ ## All rights reserved.
5
+ ## Contact: Nokia Corporation (testabilitydriver@nokia.com)
6
+ ##
7
+ ## This file is part of Testability Driver.
8
+ ##
9
+ ## If you have questions regarding the use of this file, please contact
10
+ ## Nokia at testabilitydriver@nokia.com .
11
+ ##
12
+ ## This library is free software; you can redistribute it and/or
13
+ ## modify it under the terms of the GNU Lesser General Public
14
+ ## License version 2.1 as published by the Free Software Foundation
15
+ ## and appearing in the file LICENSE.LGPL included in the packaging
16
+ ## of this file.
17
+ ##
18
+ ############################################################################
19
+
20
+
21
+ module TDriverReportAPI
22
+
23
+ def tdriver_log_data(data)
24
+ Kernel::raise ArgumentError.new("Argument to method cannot be nil.") if data.nil?
25
+ if $tdriver_reporter!=nil
26
+ $tdriver_reporter.set_user_data(data)
27
+ end
28
+ end
29
+
30
+ def tdriver_capture_state(capture_screen_shot=true)
31
+ if $tdriver_reporter
32
+ $new_test_case.capture_dump(capture_screen_shot) if $new_test_case
33
+ end
34
+ end
35
+
36
+ def tdriver_log_data_in_total_run_table(column_name,value)
37
+ Kernel::raise ArgumentError.new("Argument to method cannot be nil.") if column_name.nil? || value.nil?
38
+ if $tdriver_reporter!=nil
39
+ $tdriver_reporter.set_user_table_data(column_name,value)
40
+ end
41
+ end
42
+
43
+ def tdriver_report_log(message)
44
+ Kernel::raise ArgumentError.new("Argument message was not a String.") unless message.nil? or message.kind_of?(String)
45
+ if $tdriver_reporter
46
+ $new_test_case.set_test_case_execution_log(message) if $new_test_case
47
+ end
48
+ end
49
+
50
+ def tdriver_report_set_test_case_status(status)
51
+ Kernel::raise ArgumentError.new("Argument status was not a String.") unless status.nil? or status.kind_of?(String)
52
+ if $tdriver_reporter!=nil
53
+ $tdriver_reporter.set_test_case_user_defined_status(status)
54
+ end
55
+ end
56
+ def tdriver_report_total_tests_run()
57
+ total=0
58
+ if $tdriver_reporter!=nil
59
+ total=$tdriver_reporter.total_run
60
+ end
61
+ return total.to_i
62
+ end
63
+ def tdriver_report_total_passed_tests()
64
+ total=0
65
+ if $tdriver_reporter!=nil
66
+ total=$tdriver_reporter.total_passed
67
+ end
68
+ return total.to_i
69
+ end
70
+ def tdriver_report_total_failed_tests()
71
+ total=0
72
+ if $tdriver_reporter!=nil
73
+ total=$tdriver_reporter.total_failed
74
+ end
75
+ return total.to_i
76
+ end
77
+ def tdriver_report_total_not_run_tests()
78
+ total=0
79
+ if $tdriver_reporter!=nil
80
+ total=$tdriver_reporter.total_not_run
81
+ end
82
+ return total.to_i
83
+ end
84
+ def tdriver_report_folder()
85
+ folder=nil
86
+ if $tdriver_reporter!=nil
87
+ folder=$tdriver_reporter.report_folder
88
+ end
89
+ return folder.to_s
90
+ end
91
+ def tdriver_report_start_time()
92
+ start_time=nil
93
+ if $tdriver_reporter!=nil
94
+ start_time=$tdriver_reporter.start_time
95
+ end
96
+ return start_time.to_s
97
+ end
98
+ def tdriver_report_run_time()
99
+ run_time=nil
100
+ if $tdriver_reporter!=nil
101
+ run_time=$tdriver_reporter.run_time
102
+ end
103
+ return run_time.to_s
104
+ end
105
+ def tdriver_report_total_crash_files()
106
+ crash_files=0
107
+ if $tdriver_reporter!=nil
108
+ crash_files=$tdriver_reporter.total_crash_files
109
+ end
110
+ return crash_files.to_i
111
+ end
112
+ def tdriver_report_total_device_resets()
113
+ device_resets=0
114
+ if $tdriver_reporter!=nil
115
+ device_resets=$tdriver_reporter.total_device_resets
116
+ end
117
+ return device_resets.to_i
118
+ end
119
+ def tdriver_report_combine_reports(reports)
120
+ if $tdriver_reporter!=nil
121
+ $tdriver_reporter.combine_results(reports)
122
+ else
123
+ require 'tdriver'
124
+ include TDriverReportCreator
125
+ start_run
126
+ $tdriver_reporter.combine_results(reports)
127
+ end
128
+ end
129
+
130
+ #old api methods
131
+
132
+ def matti_log_data(data)
133
+ file, line = caller.first.split(":")
134
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
135
+ tdriver_log_data(data)
136
+ end
137
+ def matti_report_log(message)
138
+ file, line = caller.first.split(":")
139
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
140
+ tdriver_report_log(message)
141
+ end
142
+ def matti_report_set_test_case_status(status)
143
+ file, line = caller.first.split(":")
144
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
145
+ tdriver_report_set_test_case_status(status)
146
+ end
147
+ def matti_report_total_tests_run()
148
+ file, line = caller.first.split(":")
149
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
150
+ tdriver_report_total_tests_run()
151
+ end
152
+ def matti_report_total_passed_tests()
153
+ file, line = caller.first.split(":")
154
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
155
+ tdriver_report_total_passed_tests()
156
+ end
157
+ def matti_report_total_failed_tests()
158
+ file, line = caller.first.split(":")
159
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
160
+ tdriver_report_total_failed_tests()
161
+ end
162
+ def matti_report_total_not_run_tests()
163
+ file, line = caller.first.split(":")
164
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
165
+ tdriver_report_total_not_run_tests()
166
+ end
167
+ def matti_report_folder()
168
+ file, line = caller.first.split(":")
169
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
170
+ tdriver_report_folder()
171
+ end
172
+ def matti_report_start_time()
173
+ file, line = caller.first.split(":")
174
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
175
+ tdriver_report_start_time()
176
+ end
177
+ def matti_report_run_time()
178
+ file, line = caller.first.split(":")
179
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
180
+ tdriver_report_run_time()
181
+ end
182
+ def matti_report_total_crash_files()
183
+ file, line = caller.first.split(":")
184
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
185
+ tdriver_report_total_crash_files()
186
+ end
187
+ def matti_report_total_device_resets()
188
+ file, line = caller.first.split(":")
189
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
190
+ tdriver_report_total_device_resets()
191
+ end
192
+ def matti_report_combine_reports(reports)
193
+ file, line = caller.first.split(":")
194
+ $stderr.puts "%s:%s warning: method deprecated" % [ file, line]
195
+ tdriver_report_combine_reports(reports)
196
+ end
197
+
198
+
199
+ end #TDriverReportAPI
200
+
201
+ module MattiReportAPI
202
+
203
+ include TDriverReportAPI
204
+
205
+ end
206
+
207
+
@@ -0,0 +1,86 @@
1
+ ############################################################################
2
+ ##
3
+ ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
+ ## All rights reserved.
5
+ ## Contact: Nokia Corporation (testabilitydriver@nokia.com)
6
+ ##
7
+ ## This file is part of Testability Driver.
8
+ ##
9
+ ## If you have questions regarding the use of this file, please contact
10
+ ## Nokia at testabilitydriver@nokia.com .
11
+ ##
12
+ ## This library is free software; you can redistribute it and/or
13
+ ## modify it under the terms of the GNU Lesser General Public
14
+ ## License version 2.1 as published by the Free Software Foundation
15
+ ## and appearing in the file LICENSE.LGPL included in the packaging
16
+ ## of this file.
17
+ ##
18
+ ############################################################################
19
+
20
+
21
+
22
+
23
+
24
+ class ReportCombine
25
+ #This method combines previous test results with the current test execution
26
+ #
27
+ # === params
28
+ # status: last run test case
29
+ # === returns
30
+ # nil
31
+ # === raises
32
+ def copy_results_from_directory(report_dir)
33
+ current_working_dir=Dir.getwd
34
+ if File::directory?(report_dir)==true
35
+ #FileUtils.cp_r report_dir, @report_folder
36
+ FileUtils.cp_r report_dir+'/cases', @report_folder
37
+ FileUtils.copy(report_dir+'/failed_cases.xml',@report_folder+'/failed_cases.xml') if File.exist?(report_dir+'/failed_cases.xml')
38
+ FileUtils.copy(report_dir+'/passed_cases.xml',@report_folder+'/passed_cases.xml') if File.exist?(report_dir+'/passed_cases.xml')
39
+ FileUtils.copy(report_dir+'/all_cases.xml',@report_folder+'/all_cases.xml') if File.exist?(report_dir+'/all_cases.xml')
40
+ FileUtils.copy(report_dir+'/not_run_cases.xml',@report_folder+'/not_run_all_cases.xml') if File.exist?(report_dir+'/not_run_cases.xml')
41
+ end
42
+ Dir.chdir(report_dir+'/cases')
43
+ executed_tests=Dir['*/']
44
+
45
+ @total_passed=read_result_storage('passed').count
46
+ @total_failed=read_result_storage('failed').count
47
+ @total_not_run=read_result_storage('not run').count
48
+ @total_run=read_result_storage('all').count
49
+
50
+ $test_case_run_index+=executed_tests.count.to_i
51
+
52
+ report_arr=report_dir.split( /[\/|\\]+/)
53
+ #include folder in to the current run
54
+ @attached_test_reports << report_arr.last
55
+
56
+ Dir.chdir(current_working_dir)
57
+ end
58
+
59
+ #This copies and reads the previous results data
60
+ #
61
+ # === params
62
+ # status: last run test case
63
+ # === returns
64
+ # nil
65
+ # === raises
66
+ def extract_results_from_directory(report_dir)
67
+ if File::directory?(report_dir)==true
68
+ copy_results_from_directory(report_dir)
69
+ end
70
+ end
71
+
72
+ #This method combines previous test results with the current test execution
73
+ #
74
+ # === params
75
+ # status: last run test case
76
+ # === returns
77
+ # nil
78
+ # === raises
79
+ def combine_results(reports)
80
+ report_locations_arr=reports.split(',')
81
+ report_locations_arr.each do |report_location|
82
+ extract_results_from_directory(report_location)
83
+ end
84
+ end
85
+
86
+ end
@@ -0,0 +1,167 @@
1
+ ############################################################################
2
+ ##
3
+ ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
+ ## All rights reserved.
5
+ ## Contact: Nokia Corporation (testabilitydriver@nokia.com)
6
+ ##
7
+ ## This file is part of Testability Driver.
8
+ ##
9
+ ## If you have questions regarding the use of this file, please contact
10
+ ## Nokia at testabilitydriver@nokia.com .
11
+ ##
12
+ ## This library is free software; you can redistribute it and/or
13
+ ## modify it under the terms of the GNU Lesser General Public
14
+ ## License version 2.1 as published by the Free Software Foundation
15
+ ## and appearing in the file LICENSE.LGPL included in the packaging
16
+ ## of this file.
17
+ ##
18
+ ############################################################################
19
+
20
+
21
+
22
+
23
+ class TDriverReportCrashFileCapture
24
+ include TDriverReportFileCapture
25
+ def initialize
26
+ @crash_file_locations=Array.new
27
+ @crash_file_suts=Array.new
28
+ @crash_file_names=Array.new
29
+ @crash_file_count=0
30
+ @monitor_crash_files='false'
31
+ read_crash_monitor_settings()
32
+ read_file_monitor_settings()
33
+ end
34
+
35
+ def return_settings_value_array(setting)
36
+ setting_value=setting
37
+ setting_arr=Array.new
38
+ setting_arr=setting_value.split(',')
39
+ setting_arr
40
+ end
41
+
42
+ def read_crash_monitor_settings()
43
+ @crash_file_locations=return_settings_value_array(MobyUtil::Parameter[ :report_crash_file_locations, nil ])
44
+ @crash_file_suts=return_settings_value_array(MobyUtil::Parameter[ :report_crash_file_monitored_sut_ids, nil ])
45
+ @crash_file_names=return_settings_value_array(MobyUtil::Parameter[ :report_crash_file_names, nil ])
46
+ @monitor_crash_files = MobyUtil::Parameter[ :report_crash_file_monitor, 'false' ]
47
+ end
48
+
49
+ def clean_crash_files_from_sut()
50
+ if @monitor_crash_files == 'true'
51
+ MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
52
+ if sut_attributes[:is_connected]
53
+ @crash_file_suts.each do |monitored_sut|
54
+ if monitored_sut == sut_id.to_s
55
+ sut_crash_files=Array.new
56
+ sut_crash_files=list_sut_crash_files(sut_attributes[:sut])
57
+ sut_crash_files.each do |crash_file|
58
+ delete_crash_file(sut_attributes[:sut],crash_file[0])
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+
67
+ def list_sut_crash_files(current_sut)
68
+ crash_file_arr=Array.new
69
+ @crash_file_count=0
70
+ #for every location:
71
+ @crash_file_locations.each do |location|
72
+ begin
73
+ #get file names
74
+ current_location_files = current_sut.ftp( :Command => :List_files, :Remote_dir => location )
75
+ #collect crash names and add paths
76
+ current_location_files.each do |sut_file|
77
+ if file_is_crash_file(sut_file)
78
+ crash_file_arr << [location.gsub("/",'\\')+'\\'+sut_file.to_s,sut_file.to_s]
79
+ @crash_file_count+=1
80
+ end
81
+ end
82
+ rescue => ex
83
+ #puts ex.message
84
+ end
85
+ end
86
+ crash_file_arr
87
+ end
88
+
89
+ def download_crash_file(current_sut,file_name,download_folder,download_file)
90
+ begin
91
+ current_sut.ftp( :Command => :Download, :Local_filename => download_folder+download_file, :Remote_filename => file_name )
92
+ rescue => ex
93
+ #puts ex.message
94
+ end
95
+ end
96
+
97
+ def delete_crash_file(current_sut,file_name)
98
+ begin
99
+ current_sut.ftp( :Command => :Delete, :Remote_filename => file_name )
100
+ rescue => ex
101
+ #puts ex.message
102
+ end
103
+ end
104
+
105
+ def file_is_crash_file(file_name)
106
+ is_crash_file=false
107
+ @crash_file_names.each do |crash_file_identity|
108
+ if file_name.to_s.include? crash_file_identity.to_s
109
+ is_crash_file=true
110
+ end
111
+ end
112
+ is_crash_file
113
+ end
114
+
115
+ def check_if_crash_files_exist()
116
+ sut_crash_files=Array.new
117
+ if @monitor_crash_files == 'true'
118
+ MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
119
+ if sut_attributes[:is_connected]
120
+ @crash_file_suts.each do |monitored_sut|
121
+ if monitored_sut == sut_id.to_s
122
+ sut_crash_files << list_sut_crash_files(sut_attributes[:sut])
123
+ end
124
+ end
125
+ end
126
+ end
127
+ @crash_file_count
128
+ else
129
+ @crash_file_count
130
+ end
131
+ end
132
+
133
+ def download_crash_files(download_folder)
134
+ if @monitor_crash_files == 'true'
135
+ MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
136
+ if sut_attributes[:is_connected]
137
+ @crash_file_suts.each do |monitored_sut|
138
+ if monitored_sut == sut_id.to_s
139
+ sut_crash_files=Array.new
140
+ sut_crash_files=list_sut_crash_files(sut_attributes[:sut])
141
+ sut_crash_files.each do |crash_file|
142
+ download_crash_file(sut_attributes[:sut],crash_file[0],download_folder.gsub("/",'\\')+'\\',crash_file[1])
143
+ end
144
+ end
145
+ end
146
+ end
147
+ end
148
+ end
149
+ end
150
+
151
+ def capture_crash_files()
152
+ if @monitor_crash_files == 'true'
153
+ begin
154
+ dump_folder=@test_case_folder+'/crash_files'
155
+ if File::directory?(dump_folder)==false
156
+ FileUtils.mkdir_p dump_folder
157
+ end
158
+ download_crash_files(dump_folder)
159
+ rescue Exception => e
160
+ @test_case_execution_log=@test_case_execution_log.to_s + '<br />' + "Unable to capture crash files: " + e.message
161
+ end
162
+ end
163
+ end
164
+ end
165
+
166
+
167
+