cutedriver-driver 2.0.0.20210120164037
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +16 -0
- data/bin/start_app_perf +200 -0
- data/bin/tdriver-devtools +3 -0
- data/config/sut_parameters.rb +52 -0
- data/config/sut_setup.rb +32 -0
- data/config/sut_teardown.rb +32 -0
- data/config/tdriver_custom_error_recovery.rb +83 -0
- data/ext/extconf.rb +70 -0
- data/ext/native_extensions.c +315 -0
- data/lib/matti.rb +25 -0
- data/lib/tdriver-devtools/behaviour/old/xml/example/flick-example.rb +120 -0
- data/lib/tdriver-devtools/behaviour/old/xml/example/impl.rb_invalid +194 -0
- data/lib/tdriver-devtools/behaviour/old/xml/generate_behaviour_xml.rb +95 -0
- data/lib/tdriver-devtools/behaviour/old/xml/lib/tdriver_generator.rb +722 -0
- data/lib/tdriver-devtools/behaviour/old/xml/qdoc_generator.rb +321 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.method.template +43 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.module.template +54 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.argument.template +7 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.argument_type.template +7 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.exception.template +5 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.howto.line.template +2 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.howto.template +5 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.method.template +23 -0
- data/lib/tdriver-devtools/behaviour/old/xml/templates/behaviour.xml.template +14 -0
- data/lib/tdriver-devtools/behaviour/old/xml/update +3 -0
- data/lib/tdriver-devtools/behaviour/xml/generate.rb +88 -0
- data/lib/tdriver-devtools/behaviour/xml/rdoc_behaviour_xml_generator.rb +1945 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument.default.template +1 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument.template +3 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.argument_type.template +4 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.exception.template +4 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.arguments.template +4 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.deprecated.template +3 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.exceptions.template +3 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.info.template +1 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.returns.template +3 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.tables.template +3 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.method.template +12 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.returns.template +5 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.item.template +1 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.row.template +2 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.table.template +8 -0
- data/lib/tdriver-devtools/behaviour/xml/templates/behaviour.xml.template +14 -0
- data/lib/tdriver-devtools/doc/behaviour_xml/QtExampleGestureBehaviour.xml +138 -0
- data/lib/tdriver-devtools/doc/behaviour_xml/created.rid +1 -0
- data/lib/tdriver-devtools/doc/behaviour_xml/tdriver.hash +1 -0
- data/lib/tdriver-devtools/doc/feature_xml/qt_widget_hold.feature.xml +9 -0
- data/lib/tdriver-devtools/doc/feature_xml/qt_widget_tap.feature.xml +9 -0
- data/lib/tdriver-devtools/doc/generate.rb +917 -0
- data/lib/tdriver-devtools/doc/update +1 -0
- data/lib/tdriver-devtools/doc/xslt/html.rb +7 -0
- data/lib/tdriver-devtools/doc/xslt/template.xsl +2170 -0
- data/lib/tdriver-devtools/doc/xslt/update +3 -0
- data/lib/tdriver-devtools/plugin/placeholder.txt +1 -0
- data/lib/tdriver-devtools/tdriver-devtools.rb +404 -0
- data/lib/tdriver-devtools/tests/feature_tests/example/behaviour_example.rb +100 -0
- data/lib/tdriver-devtools/tests/feature_tests/generate.rb +82 -0
- data/lib/tdriver-devtools/tests/feature_tests/lib/custom_rdoc_generator.rb +468 -0
- data/lib/tdriver-devtools/tests/feature_tests/templates/feature_attribute.template +5 -0
- data/lib/tdriver-devtools/tests/feature_tests/templates/feature_method.template +5 -0
- data/lib/tdriver-devtools/tests/feature_tests/templates/scenario_attribute.template +5 -0
- data/lib/tdriver-devtools/tests/feature_tests/templates/scenario_method.template +5 -0
- data/lib/tdriver-devtools/tests/feature_tests/update +3 -0
- data/lib/tdriver.rb +23 -0
- data/lib/tdriver/base/behaviour/abstract.rb +29 -0
- data/lib/tdriver/base/behaviour/behaviours/object_abstract.rb +107 -0
- data/lib/tdriver/base/behaviour/behaviours/object_behaviour_composition.rb +99 -0
- data/lib/tdriver/base/behaviour/behaviours/object_behaviour_description.rb +278 -0
- data/lib/tdriver/base/behaviour/behaviours/object_composition.rb +119 -0
- data/lib/tdriver/base/behaviour/factory.rb +495 -0
- data/lib/tdriver/base/behaviour/loader.rb +46 -0
- data/lib/tdriver/base/command_data/command_data.rb +51 -0
- data/lib/tdriver/base/command_data/loader.rb +29 -0
- data/lib/tdriver/base/controller/abstraction.rb +56 -0
- data/lib/tdriver/base/controller/loader.rb +21 -0
- data/lib/tdriver/base/errors.rb +134 -0
- data/lib/tdriver/base/loader.rb +47 -0
- data/lib/tdriver/base/state_object.rb +373 -0
- data/lib/tdriver/base/sut/adapter.rb +54 -0
- data/lib/tdriver/base/sut/controller.rb +151 -0
- data/lib/tdriver/base/sut/factory.rb +339 -0
- data/lib/tdriver/base/sut/generic/behaviours/agent.rb +77 -0
- data/lib/tdriver/base/sut/generic/behaviours/application.rb +427 -0
- data/lib/tdriver/base/sut/generic/behaviours/controller.rb +67 -0
- data/lib/tdriver/base/sut/generic/behaviours/find.rb +107 -0
- data/lib/tdriver/base/sut/generic/behaviours/flash_behaviour.rb +337 -0
- data/lib/tdriver/base/sut/generic/behaviours/sut.rb +1888 -0
- data/lib/tdriver/base/sut/generic/behaviours/switchbox_behaviour.rb +210 -0
- data/lib/tdriver/base/sut/generic/behaviours/verification.rb +222 -0
- data/lib/tdriver/base/sut/generic/commands/agent.rb +43 -0
- data/lib/tdriver/base/sut/generic/commands/application.rb +274 -0
- data/lib/tdriver/base/sut/generic/commands/fixture.rb +47 -0
- data/lib/tdriver/base/sut/generic/commands/key_sequence.rb +94 -0
- data/lib/tdriver/base/sut/generic/commands/screen_capture.rb +64 -0
- data/lib/tdriver/base/sut/generic/plugin.rb +97 -0
- data/lib/tdriver/base/sut/loader.rb +35 -0
- data/lib/tdriver/base/sut/sut.rb +98 -0
- data/lib/tdriver/base/test_object/abstract.rb +208 -0
- data/lib/tdriver/base/test_object/adapter.rb +740 -0
- data/lib/tdriver/base/test_object/behaviours/syncronization.rb +144 -0
- data/lib/tdriver/base/test_object/behaviours/test_object.rb +1047 -0
- data/lib/tdriver/base/test_object/cache.rb +134 -0
- data/lib/tdriver/base/test_object/factory.rb +684 -0
- data/lib/tdriver/base/test_object/loader.rb +51 -0
- data/lib/tdriver/base/test_object/verification.rb +178 -0
- data/lib/tdriver/base/test_object/xml/abstraction.rb +63 -0
- data/lib/tdriver/base/test_object/xml/adapter.rb +773 -0
- data/lib/tdriver/env.rb +21 -0
- data/lib/tdriver/loader.rb +57 -0
- data/lib/tdriver/matti.rb +35 -0
- data/lib/tdriver/report/error_recovery/tdriver_custom_error_recovery.rb +83 -0
- data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +168 -0
- data/lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb +106 -0
- data/lib/tdriver/report/report.rb +61 -0
- data/lib/tdriver/report/report_api.rb +348 -0
- data/lib/tdriver/report/report_combine.rb +86 -0
- data/lib/tdriver/report/report_crash_file_capture.rb +178 -0
- data/lib/tdriver/report/report_creator.rb +665 -0
- data/lib/tdriver/report/report_cucumber.rb +158 -0
- data/lib/tdriver/report/report_cucumber_listener.rb +184 -0
- data/lib/tdriver/report/report_cucumber_reporter.rb +181 -0
- data/lib/tdriver/report/report_data_presentation.rb +156 -0
- data/lib/tdriver/report/report_data_table.rb +64 -0
- data/lib/tdriver/report/report_execution_statistics.rb +400 -0
- data/lib/tdriver/report/report_file_capture.rb +159 -0
- data/lib/tdriver/report/report_graph_generator.rb +59 -0
- data/lib/tdriver/report/report_grouping.rb +541 -0
- data/lib/tdriver/report/report_javascript.rb +199 -0
- data/lib/tdriver/report/report_junit_xml.rb +147 -0
- data/lib/tdriver/report/report_rspec.rb +108 -0
- data/lib/tdriver/report/report_test_case_run.rb +725 -0
- data/lib/tdriver/report/report_test_run.rb +1476 -0
- data/lib/tdriver/report/report_test_unit.rb +223 -0
- data/lib/tdriver/report/report_writer.rb +1621 -0
- data/lib/tdriver/tdriver.rb +209 -0
- data/lib/tdriver/util/agent/loader.rb +22 -0
- data/lib/tdriver/util/agent/service.rb +107 -0
- data/lib/tdriver/util/common/array.rb +39 -0
- data/lib/tdriver/util/common/boolean.rb +48 -0
- data/lib/tdriver/util/common/crc16.rb +149 -0
- data/lib/tdriver/util/common/environment.rb +154 -0
- data/lib/tdriver/util/common/error.rb +40 -0
- data/lib/tdriver/util/common/exception.rb +53 -0
- data/lib/tdriver/util/common/exceptions.rb +12 -0
- data/lib/tdriver/util/common/file.rb +328 -0
- data/lib/tdriver/util/common/gem.rb +109 -0
- data/lib/tdriver/util/common/hash.rb +288 -0
- data/lib/tdriver/util/common/kernel.rb +253 -0
- data/lib/tdriver/util/common/loader.rb +47 -0
- data/lib/tdriver/util/common/numeric.rb +159 -0
- data/lib/tdriver/util/common/object.rb +159 -0
- data/lib/tdriver/util/common/retryable.rb +179 -0
- data/lib/tdriver/util/common/stackable.rb +185 -0
- data/lib/tdriver/util/common/string.rb +174 -0
- data/lib/tdriver/util/database/access.rb +240 -0
- data/lib/tdriver/util/database/connection.rb +44 -0
- data/lib/tdriver/util/database/error.rb +34 -0
- data/lib/tdriver/util/database/loader.rb +28 -0
- data/lib/tdriver/util/filters/attribute_filter.rb +121 -0
- data/lib/tdriver/util/filters/loader.rb +29 -0
- data/lib/tdriver/util/fixture/loader.rb +22 -0
- data/lib/tdriver/util/fixture/service.rb +211 -0
- data/lib/tdriver/util/hooking/hooking.rb +477 -0
- data/lib/tdriver/util/keymap/keymap.rb +81 -0
- data/lib/tdriver/util/loader.rb +80 -0
- data/lib/tdriver/util/localisation/error.rb +31 -0
- data/lib/tdriver/util/localisation/loader.rb +25 -0
- data/lib/tdriver/util/localisation/localisation.rb +762 -0
- data/lib/tdriver/util/logger/loader.rb +22 -0
- data/lib/tdriver/util/logger/logger.rb +591 -0
- data/lib/tdriver/util/operator_data/error.rb +29 -0
- data/lib/tdriver/util/operator_data/loader.rb +27 -0
- data/lib/tdriver/util/operator_data/operator_data.rb +93 -0
- data/lib/tdriver/util/other/config.rb +221 -0
- data/lib/tdriver/util/parameter/error.rb +48 -0
- data/lib/tdriver/util/parameter/loader.rb +25 -0
- data/lib/tdriver/util/parameter/parameter.rb +1161 -0
- data/lib/tdriver/util/plugin/abstract.rb +61 -0
- data/lib/tdriver/util/plugin/error.rb +0 -0
- data/lib/tdriver/util/plugin/loader.rb +28 -0
- data/lib/tdriver/util/plugin/service.rb +319 -0
- data/lib/tdriver/util/recorder/loader.rb +25 -0
- data/lib/tdriver/util/recorder/recorder.rb +72 -0
- data/lib/tdriver/util/recorder/scripter.rb +294 -0
- data/lib/tdriver/util/statistics/statistics.rb +89 -0
- data/lib/tdriver/util/user_data/error.rb +28 -0
- data/lib/tdriver/util/user_data/loader.rb +25 -0
- data/lib/tdriver/util/user_data/user_data.rb +104 -0
- data/lib/tdriver/util/video/camera.rb +67 -0
- data/lib/tdriver/util/video/camera_linux.rb +153 -0
- data/lib/tdriver/util/video/camera_windows.rb +174 -0
- data/lib/tdriver/util/video/loader.rb +31 -0
- data/lib/tdriver/util/video/video_utils.rb +139 -0
- data/lib/tdriver/util/xml/abstraction.rb +117 -0
- data/lib/tdriver/util/xml/attribute.rb +32 -0
- data/lib/tdriver/util/xml/builder.rb +53 -0
- data/lib/tdriver/util/xml/comment.rb +32 -0
- data/lib/tdriver/util/xml/document.rb +32 -0
- data/lib/tdriver/util/xml/element.rb +32 -0
- data/lib/tdriver/util/xml/error.rb +46 -0
- data/lib/tdriver/util/xml/loader.rb +62 -0
- data/lib/tdriver/util/xml/nil_node.rb +95 -0
- data/lib/tdriver/util/xml/nodeset.rb +32 -0
- data/lib/tdriver/util/xml/parsers/libxml/libxml.rb +140 -0
- data/lib/tdriver/util/xml/parsers/loader.rb +21 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/abstraction.rb +167 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/attribute.rb +66 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/builder.rb +64 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/comment.rb +39 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/document.rb +66 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/element.rb +39 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/loader.rb +58 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/node.rb +212 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/nodeset.rb +237 -0
- data/lib/tdriver/util/xml/parsers/nokogiri/text.rb +39 -0
- data/lib/tdriver/util/xml/text.rb +32 -0
- data/lib/tdriver/util/xml/xml.rb +332 -0
- data/lib/tdriver/verify/verify.rb +2398 -0
- data/lib/tdriver/version.rb +21 -0
- data/xml/behaviours/generic.xml +530 -0
- data/xml/defaults/generic.xml +11 -0
- data/xml/defaults/sut_generic.xml +8 -0
- data/xml/parameters/tdriver_parameters.xml +23 -0
- data/xml/templates/generic.xml +292 -0
- metadata +324 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bf9f19728e4c46a60306ef8af4d791049e690e431ac2ab24afbfea66c94f20a4
|
4
|
+
data.tar.gz: 7513e0bd4437a346c9ba1e27c4321f0bff709206c9a82c5ce5cd7ca7561aab9c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: '08c164d6cb6ab22ae69c561852849b5460bbcba94faa9ae54b8c69d26af9844ceab82f8c62e3ee16fadfe550b790839064cbeb13d675e2c6e3b32bbf00c1ea4a'
|
7
|
+
data.tar.gz: 1dede0372ccc2778f6c9e77128060f163fccefc26dd508355fec706d404175da20042a48b273a4c84b4e70b961809d19374746e14422f93a8189c0d994e8d0b3
|
data/README.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
cuTeDriver is a Testability Driver (TDriver) fork.
|
2
|
+
|
3
|
+
cuTeDriver is a framework for remote execution, automatic testing, regression testing and even automated performance measurement for any Qt-based application.
|
4
|
+
|
5
|
+
For more information about cuTeDriver visit https://github.com/nomovok-opensource/cutedriver-agent_qt/wiki
|
6
|
+
|
7
|
+
Minor changes:
|
8
|
+
* renaming to cuTeDriver
|
9
|
+
|
10
|
+
|
11
|
+
Build instructions:
|
12
|
+
https://github.com/nomovok-opensource/cutedriver-agent_qt/wiki/Setup%3A-driver-and-sut_qt
|
13
|
+
|
14
|
+
For details contact:
|
15
|
+
antti.korventausta@nomovok.com
|
16
|
+
jukka.raninen@nomovok.com
|
data/bin/start_app_perf
ADDED
@@ -0,0 +1,200 @@
|
|
1
|
+
#! /usr/bin/ruby1.8
|
2
|
+
# Add '.rb' to work around a bug in IronRuby's File#dirname
|
3
|
+
$:.unshift(File.dirname(__FILE__ + '.rb') + '/../lib') unless $:.include?(File.dirname(__FILE__ + '.rb') + '/../lib')
|
4
|
+
|
5
|
+
|
6
|
+
require 'tdriver' # contains the reporter!
|
7
|
+
require 'nokogiri'
|
8
|
+
require 'date'
|
9
|
+
require 'optparse'
|
10
|
+
|
11
|
+
include TDriverReportDataPresentation
|
12
|
+
|
13
|
+
##################################
|
14
|
+
## PARSE COMMAND LINE OPTIONS
|
15
|
+
@settings = {}
|
16
|
+
@settings[:iterations] = nil
|
17
|
+
@settings[:signals] = ["applicationReady()"]
|
18
|
+
@settings[:events] = ["Paint"]
|
19
|
+
@settings[:output_filename] = "startperf_report.html"
|
20
|
+
@settings[:app_name] = ""
|
21
|
+
@settings[:objects] = ""
|
22
|
+
@settings[:sut_type] = "sut_qt"
|
23
|
+
@data = {}
|
24
|
+
|
25
|
+
begin
|
26
|
+
options = OptionParser.new do |opts|
|
27
|
+
opts.banner = "Usage: start_app_perf [OPTIONS] <application>\nNote: 'applicationStart()' signal and 'Paint' events will be collected by default.\nOptions:\n"
|
28
|
+
opts.on("-n ITERATIONS", "--iterations", "Required. Number of iterations of the start test.") do |s| @settings[:iterations] = s.to_i; end
|
29
|
+
opts.on("-s SYGNALS", "--signals", "Comma separated list of signals to collect, don't use spaces.") do |s| @settings[:signals] << s.split(',').collect{|a| a.strip}; end
|
30
|
+
opts.on("-e EVENTS", "--events", "Comma separated list of events to collect, don't use spaces.") do |s| @settings[:events] << s.split(',').collect{|a| a.strip}; end
|
31
|
+
opts.on("-o FILENAME", "--output", "Filename for the output html report. Defaults to 'startperf_report.html'") do |s| @settings[:output_filename] = s; end
|
32
|
+
opts.on("-t SUTTYPE", "--suttype", "Sut type to be used. 'sut_qt' will be used as default type.") do |s| @settings[:sut_type] = s; end
|
33
|
+
@settings[:opts] = opts
|
34
|
+
end.parse!
|
35
|
+
raise OptionParser::MissingArgument.new("number of iterations not provided. use the -n option to provide it.") if @settings[:iterations] == nil
|
36
|
+
raise OptionParser::MissingArgument.new("application to run not provided.") if ARGV.length < 1
|
37
|
+
raise OptionParser::InvalidArgument.new("too many arguments provided." + ARGV.to_s) if ARGV.length > 1
|
38
|
+
@settings[:app_name] = ARGV[0].sub(/\.exe/, '')
|
39
|
+
rescue OptionParser::MissingArgument, OptionParser::InvalidArgument, Exception => e
|
40
|
+
puts e.message
|
41
|
+
puts
|
42
|
+
puts @settings[:opts]
|
43
|
+
exit
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
# HARDCODED => Sut type,
|
48
|
+
# signals to listen: 'applicationReady()'
|
49
|
+
# events to listen: 'Paint'
|
50
|
+
|
51
|
+
##################################
|
52
|
+
## METHODS
|
53
|
+
|
54
|
+
# convert string argument into integer
|
55
|
+
def toi(arg)
|
56
|
+
while(arg.length > 0 && arg[0] == '0')
|
57
|
+
arg = arg[1..-1]
|
58
|
+
end
|
59
|
+
arg.to_i
|
60
|
+
end
|
61
|
+
|
62
|
+
# Run Application
|
63
|
+
def run(iteration)
|
64
|
+
# start application and set events & signals to listen. SLEEP prevents other communications to affect the performance of the application while starting
|
65
|
+
app = @sut.run(:name => @settings[:app_name], :events_to_listen => @settings[:events].join(','), :signals_to_listen => @settings[:signals].join(','), :sleep_after_launch => 5)
|
66
|
+
strOut = ""
|
67
|
+
|
68
|
+
# process Events
|
69
|
+
if !@settings[:events].empty?
|
70
|
+
app.enable_events
|
71
|
+
events = app.get_events
|
72
|
+
app.disable_events
|
73
|
+
#puts events
|
74
|
+
doc = Nokogiri::XML.parse(events)
|
75
|
+
first_time_stamp = nil
|
76
|
+
node_set = doc.xpath('//obj[@name = "QtApplicationEvents"]/obj')
|
77
|
+
timer_counter = 0
|
78
|
+
index = 0
|
79
|
+
target_object = nil
|
80
|
+
while(index < node_set.size)
|
81
|
+
node = node_set.at(index)
|
82
|
+
time_str = node.xpath("#{node.path}/attr[@name = \"timeStamp\"]").first.text
|
83
|
+
time_stamp = Time.local(toi(time_str[0..3]), toi(time_str[4..5]), toi(time_str[6..7]), toi(time_str[8..9]), toi(time_str[10..11]), toi(time_str[12..13]), toi(time_str[14..16])*1000)
|
84
|
+
if (first_time_stamp == nil)
|
85
|
+
first_time_stamp = time_stamp
|
86
|
+
strOut << "application started at " << first_time_stamp.to_s << "\n"
|
87
|
+
strOut << "events:\n"
|
88
|
+
else
|
89
|
+
event_name = node.attribute("name").text
|
90
|
+
delta_time_seconds = time_stamp.to_i-first_time_stamp.to_i
|
91
|
+
delta_time_milliseconds = (time_stamp.usec/1000) - (first_time_stamp.usec/1000)
|
92
|
+
delta_time = delta_time_seconds*1000
|
93
|
+
delta_time = delta_time + delta_time_milliseconds
|
94
|
+
|
95
|
+
strOut << (delta_time).to_s << "\t" << event_name
|
96
|
+
target_object = node.xpath("#{node.path}/obj").first
|
97
|
+
if(target_object)
|
98
|
+
target_object_name = target_object.attribute("name").text
|
99
|
+
target_object_type = target_object.attribute("type").text
|
100
|
+
strOut << "\t" << target_object_type << "(" << target_object_name << ")"
|
101
|
+
end
|
102
|
+
strOut << "\n"
|
103
|
+
|
104
|
+
#DATACOLLECTION!
|
105
|
+
event_method_name = target_object.nil? ? event_name : "#{event_name}:#{target_object_type}(#{target_object_name})"
|
106
|
+
@data[event_method_name] = Array.new if @data[event_method_name] == nil
|
107
|
+
@data[event_method_name][iteration] = delta_time
|
108
|
+
end
|
109
|
+
index = index + 1
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
# process signals
|
115
|
+
if !@settings[:signals].empty?
|
116
|
+
signals = app.fixture('signal', 'get_signal')
|
117
|
+
app.fixture('signal', 'remove_signals')
|
118
|
+
#puts signals
|
119
|
+
doc = Nokogiri::XML.parse(signals)
|
120
|
+
first_time_stamp = nil
|
121
|
+
node_set = doc.xpath('//tasInfo[@name = "QtSignals"]/obj')
|
122
|
+
timer_counter = 0
|
123
|
+
index = 0
|
124
|
+
target_object = nil
|
125
|
+
while(index < node_set.size)
|
126
|
+
node = node_set.at(index)
|
127
|
+
time_str = node.xpath("#{node.path}/attr[@name = \"timeStamp\"]").first.text
|
128
|
+
time_stamp = Time.local(toi(time_str[0..3]), toi(time_str[4..5]), toi(time_str[6..7]), toi(time_str[8..9]), toi(time_str[10..11]), toi(time_str[12..13]), toi(time_str[14..16])*1000)
|
129
|
+
if (first_time_stamp == nil)
|
130
|
+
first_time_stamp = time_stamp
|
131
|
+
strOut << "application started at " << first_time_stamp.to_s << "\n" if (strOut == "")
|
132
|
+
strOut << "signals:\n"
|
133
|
+
else
|
134
|
+
signal_name = node.attribute("name").text
|
135
|
+
delta_time_seconds = time_stamp.to_i-first_time_stamp.to_i
|
136
|
+
delta_time_milliseconds = (time_stamp.usec/1000) - (first_time_stamp.usec/1000)
|
137
|
+
delta_time = delta_time_seconds*1000
|
138
|
+
delta_time = delta_time + delta_time_milliseconds
|
139
|
+
|
140
|
+
#DATACOLLECTION!
|
141
|
+
@data[signal_name] = Array.new if @data[signal_name] == nil
|
142
|
+
@data[signal_name][iteration] = delta_time
|
143
|
+
|
144
|
+
strOut << (delta_time).to_s << "\t" << signal_name << "\n"
|
145
|
+
end
|
146
|
+
index = index + 1
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# print out the list of events and signals
|
151
|
+
puts strOut
|
152
|
+
app.close
|
153
|
+
end
|
154
|
+
|
155
|
+
# Create HTML Graph Report
|
156
|
+
def gen_html_report
|
157
|
+
include TDriverReportWriter
|
158
|
+
write_style_sheet("tdriver_report_style.css")
|
159
|
+
html_file = File.new(@settings[:output_filename], "w+")
|
160
|
+
html_file << '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
161
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
162
|
+
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-eqiv="cache-control" content="no-cache">
|
163
|
+
<link rel="stylesheet" title="TDriverReportStyle" href="tdriver_report_style.css"/>
|
164
|
+
<title>'+ "Application Start Performance" +'</title>
|
165
|
+
</head><body>'
|
166
|
+
html_file << insert_graph_css
|
167
|
+
html_file << insert_html_graph( @data, nil, nil, "500")
|
168
|
+
html_file << insert_html_table( @data , 500)
|
169
|
+
html_file << '</body></html>'
|
170
|
+
end
|
171
|
+
|
172
|
+
##################################
|
173
|
+
## MAIN
|
174
|
+
# Print options summary
|
175
|
+
puts ">> Application: " + @settings[:app_name]
|
176
|
+
puts ">> Iterations: " + @settings[:iterations].to_s
|
177
|
+
puts ">> Signals: " + @settings[:signals].to_s
|
178
|
+
puts ">> Events: " + @settings[:events].to_s
|
179
|
+
|
180
|
+
# Connect to TDriver
|
181
|
+
@sut = TDriver.sut( :Id => @settings[:sut_type] )
|
182
|
+
|
183
|
+
# Run iterations
|
184
|
+
@settings[:iterations].times do |iteration|
|
185
|
+
puts "\nITERATION " + (iteration + 1).to_s + " OF " + @settings[:iterations].to_s
|
186
|
+
run(iteration)
|
187
|
+
end
|
188
|
+
|
189
|
+
# Print Summary
|
190
|
+
puts "\nDATA Collected"
|
191
|
+
@data.each_key do |key|
|
192
|
+
puts "Signal/Event: " + key.to_s + " Values: " + @data[key].join(',')
|
193
|
+
end
|
194
|
+
|
195
|
+
# Generate HTML report
|
196
|
+
gen_html_report
|
197
|
+
puts "\nHTML Report created at " + @settings[:output_filename]
|
198
|
+
|
199
|
+
# Disconnect from Tdriver
|
200
|
+
@sut.disconnect
|
@@ -0,0 +1,52 @@
|
|
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
|
+
# Generic configuration file for sut data.
|
20
|
+
# Can be used to provide ruby code for sut configurations.
|
21
|
+
module SutParameters
|
22
|
+
|
23
|
+
# Verify blocks define the verify_always blocks that are automatically added to given sut.
|
24
|
+
# Takes an array of VerifyBlock objects
|
25
|
+
# VerifyBlock parameters:
|
26
|
+
# - Proc block
|
27
|
+
# - Expected return value
|
28
|
+
# - Error message
|
29
|
+
# Configured verify_always blocks will not return the failed error block code in the error message.
|
30
|
+
VERIFY_BLOCKS = [
|
31
|
+
|
32
|
+
# Example block
|
33
|
+
MobyUtil::VerifyBlock.new(
|
34
|
+
|
35
|
+
# proc block to execute
|
36
|
+
Proc.new{ |sut|
|
37
|
+
# Verifies that some application is always running
|
38
|
+
sut.application.name != "qttasserver"
|
39
|
+
},
|
40
|
+
|
41
|
+
# expected return value
|
42
|
+
true,
|
43
|
+
|
44
|
+
# error message
|
45
|
+
"Top most application is qttas, no application is running"
|
46
|
+
|
47
|
+
)
|
48
|
+
|
49
|
+
]
|
50
|
+
|
51
|
+
end
|
52
|
+
|
data/config/sut_setup.rb
ADDED
@@ -0,0 +1,32 @@
|
|
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
|
+
# Generic configuration file for sut setup.
|
20
|
+
# Can be used to provide ruby code for sut configurations.
|
21
|
+
module MobyBehaviour
|
22
|
+
module SUT
|
23
|
+
# Setup method for sut that will be executed when @sut.setup is called
|
24
|
+
# Methods for sut can be called with self
|
25
|
+
# Example:
|
26
|
+
# self.run(:name => 'testapp')
|
27
|
+
def setup
|
28
|
+
puts "Hello world"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,32 @@
|
|
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
|
+
# Generic configuration file for sut teardown.
|
20
|
+
# Can be used to provide ruby code for sut configurations.
|
21
|
+
module MobyBehaviour
|
22
|
+
module SUT
|
23
|
+
# Teardown method for sut that will be executed when @sut.teardown is called
|
24
|
+
# Methods for sut can be called with self
|
25
|
+
# Example:
|
26
|
+
# self.application.close
|
27
|
+
def teardown
|
28
|
+
puts "Bye world"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,83 @@
|
|
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
|
+
module TDriverCustomErrorRecovery
|
21
|
+
|
22
|
+
# This method is called by TDriver Reporter when error is detected in connection
|
23
|
+
# === params
|
24
|
+
# === returns
|
25
|
+
# === raises
|
26
|
+
def error_in_connection()
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
# This method is called by TDriver Reporter when test set execution is starting
|
31
|
+
# === params
|
32
|
+
# === returns
|
33
|
+
# === raises
|
34
|
+
def starting_test_set_run()
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
# This method is called by TDriver Reporter when test case execution is starting
|
39
|
+
# === params
|
40
|
+
# test_case: the test case name
|
41
|
+
# connected_suts: All the connected TDriver suts
|
42
|
+
# === returns
|
43
|
+
# === raises
|
44
|
+
def starting_test_case(test_case,connected_suts)
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
# This method is called by TDriver Reporter when a error is detected in test case execution
|
49
|
+
# === params
|
50
|
+
# connected_suts: All the connected TDriver suts
|
51
|
+
# === returns
|
52
|
+
# === raises
|
53
|
+
def error_in_test_case(connected_suts)
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
# This method is called by TDriver Reporter when test case details are updated
|
58
|
+
# === params
|
59
|
+
# details: Execution details recived from the current test case
|
60
|
+
# === returns
|
61
|
+
# === raises
|
62
|
+
def updating_test_case_details(details)
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
# This method is called by TDriver Reporter when test case execution is ended
|
67
|
+
# === params
|
68
|
+
# connected_suts: All the connected TDriver suts
|
69
|
+
# === returns
|
70
|
+
# === raises
|
71
|
+
def ending_test_case(status,connected_suts)
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
# This method is called by TDriver Reporter when test set execution is ending
|
76
|
+
# === params
|
77
|
+
# === returns
|
78
|
+
# === raises
|
79
|
+
def ending_test_set_run()
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
data/ext/extconf.rb
ADDED
@@ -0,0 +1,70 @@
|
|
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.join( File.dirname(__FILE__), '../lib/tdriver/util/loader.rb' )
|
21
|
+
|
22
|
+
MobyUtil::GemHelper.install( MobyUtil::FileHelper.tdriver_home ){ | tdriver_home_folder |
|
23
|
+
|
24
|
+
[
|
25
|
+
# default parameters & sut configuration
|
26
|
+
[ "../xml/defaults/*.xml", "defaults/", true ],
|
27
|
+
|
28
|
+
# parameters
|
29
|
+
[ "../xml/parameters/tdriver_parameters.xml", "tdriver_parameters.xml", false ],
|
30
|
+
[ "../xml/parameters/tdriver_parameters.xml", "default/tdriver_parameters.xml", true ],
|
31
|
+
[ "../config/sut_parameters.rb", "sut_parameters.rb", true ],
|
32
|
+
[ "../config/sut_setup.rb", "sut_setup.rb", false ],
|
33
|
+
[ "../config/sut_teardown.rb", "sut_teardown.rb", false ],
|
34
|
+
[ "../config/tdriver_custom_error_recovery.rb", "tdriver_custom_error_recovery.rb", false ],
|
35
|
+
|
36
|
+
# templates
|
37
|
+
[ "../xml/templates/*.xml", "templates/", true ],
|
38
|
+
[ "../xml/templates/*.xml", "default/templates/", true ],
|
39
|
+
|
40
|
+
# behaviours
|
41
|
+
[ "../xml/behaviours/*.xml", "behaviours/", true ],
|
42
|
+
[ "../xml/behaviours/*.xml", "default/behaviours/", true ],
|
43
|
+
|
44
|
+
# create logfiles fodler
|
45
|
+
[ nil, "logfiles/", false ]
|
46
|
+
|
47
|
+
# documentation
|
48
|
+
#[ "../doc/", "doc/", true ]
|
49
|
+
|
50
|
+
].each { | task |
|
51
|
+
|
52
|
+
source, destination, overwrite = task
|
53
|
+
|
54
|
+
if source.nil?
|
55
|
+
|
56
|
+
MobyUtil::FileHelper.mkdir_path( File.join( tdriver_home_folder, destination ) ) unless MobyUtil::FileHelper.folder_exist?( File.join( tdriver_home_folder, destination ) )
|
57
|
+
|
58
|
+
else
|
59
|
+
|
60
|
+
MobyUtil::FileHelper.copy_file( source, "#{ tdriver_home_folder }/#{ destination }", false, overwrite, true )
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
}
|
65
|
+
|
66
|
+
}
|
67
|
+
|
68
|
+
MobyUtil::Stats.report( 'install', 'Installed gem' )
|
69
|
+
|
70
|
+
sleep ( 5 ) # do not remove!!
|