testability-driver 1.1.1 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/config/sut_parameters.rb +21 -8
  2. data/config/tdriver_custom_error_recovery.rb +83 -0
  3. data/ext/extconf.rb +3 -2
  4. data/ext/native_extensions.c +60 -2
  5. data/lib/tdriver-devtools/behaviour/old/xml/example/flick-example.rb +2 -105
  6. data/lib/tdriver/base/behaviour/factory.rb +154 -89
  7. data/lib/tdriver/base/behaviour/factory_new.rb +409 -0
  8. data/lib/tdriver/base/errors.rb +3 -3
  9. data/lib/tdriver/base/state_object.rb +85 -22
  10. data/lib/tdriver/base/sut/adapter.rb +26 -0
  11. data/lib/tdriver/base/sut/controller.rb +1 -1
  12. data/lib/tdriver/base/sut/generic/behaviours/application.rb +89 -118
  13. data/lib/tdriver/base/sut/generic/behaviours/find.rb +67 -62
  14. data/lib/tdriver/base/sut/generic/behaviours/sut.rb +296 -187
  15. data/lib/tdriver/base/sut/generic/behaviours/switchbox_behaviour.rb +7 -7
  16. data/lib/tdriver/base/sut/generic/commands/application.rb +366 -295
  17. data/lib/tdriver/base/sut/sut.rb +19 -3
  18. data/lib/tdriver/base/test_object/abstract.rb +41 -21
  19. data/lib/tdriver/base/test_object/adapter.rb +62 -9
  20. data/lib/tdriver/base/test_object/behaviours/syncronization.rb +10 -6
  21. data/lib/tdriver/base/test_object/behaviours/test_object.rb +84 -47
  22. data/lib/tdriver/base/test_object/factory.rb +124 -68
  23. data/lib/tdriver/base/test_object/loader.rb +3 -4
  24. data/lib/tdriver/base/test_object/verification.rb +3 -3
  25. data/lib/tdriver/base/test_object/xml/adapter.rb +734 -0
  26. data/lib/tdriver/loader.rb +12 -0
  27. data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +3 -2
  28. data/lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb +14 -14
  29. data/lib/tdriver/report/report.rb +4 -8
  30. data/lib/tdriver/report/report_api.rb +9 -0
  31. data/lib/tdriver/report/report_crash_file_capture.rb +4 -4
  32. data/lib/tdriver/report/report_creator.rb +57 -35
  33. data/lib/tdriver/report/report_cucumber.rb +1 -1
  34. data/lib/tdriver/report/report_cucumber_listener.rb +5 -158
  35. data/lib/tdriver/report/report_cucumber_reporter.rb +7 -161
  36. data/lib/tdriver/report/report_execution_statistics.rb +4 -4
  37. data/lib/tdriver/report/report_file_capture.rb +5 -5
  38. data/lib/tdriver/report/report_grouping.rb +24 -22
  39. data/lib/tdriver/report/report_junit_xml.rb +5 -5
  40. data/lib/tdriver/report/report_test_case_run.rb +31 -22
  41. data/lib/tdriver/report/report_test_run.rb +107 -104
  42. data/lib/tdriver/report/report_writer.rb +150 -83
  43. data/lib/tdriver/tdriver.rb +147 -103
  44. data/lib/tdriver/util/common/boolean.rb +51 -0
  45. data/lib/tdriver/util/common/crc16.rb +110 -68
  46. data/lib/tdriver/util/common/hash.rb +63 -7
  47. data/lib/tdriver/util/common/kernel.rb +46 -1
  48. data/lib/tdriver/util/common/loader.rb +1 -0
  49. data/lib/tdriver/util/common/object.rb +20 -8
  50. data/lib/tdriver/util/common/string.rb +21 -2
  51. data/lib/tdriver/util/logger/logger.rb +4 -4
  52. data/lib/tdriver/util/parameter/loader.rb +2 -19
  53. data/lib/tdriver/util/parameter/parameter.rb +874 -177
  54. data/lib/tdriver/util/plugin/service.rb +1 -1
  55. data/lib/tdriver/util/recorder/recorder.rb +7 -1
  56. data/lib/tdriver/util/xml/abstraction.rb +13 -1
  57. data/lib/tdriver/util/xml/parsers/nokogiri/abstraction.rb +63 -10
  58. data/lib/tdriver/util/xml/parsers/nokogiri/attribute.rb +8 -2
  59. data/lib/tdriver/util/xml/parsers/nokogiri/document.rb +16 -3
  60. data/lib/tdriver/util/xml/parsers/nokogiri/node.rb +36 -32
  61. data/lib/tdriver/util/xml/parsers/nokogiri/nodeset.rb +19 -22
  62. data/lib/tdriver/util/xml/xml.rb +147 -32
  63. data/lib/tdriver/verify/verify.rb +1112 -289
  64. data/lib/tdriver/version.rb +1 -1
  65. data/xml/templates/generic.xml +14 -2
  66. metadata +51 -24
  67. data/lib/tdriver/util/parameter/parameter_hash.rb +0 -104
  68. data/lib/tdriver/util/parameter/parameter_new.rb +0 -869
  69. data/lib/tdriver/util/parameter/parameter_template.rb +0 -120
  70. data/lib/tdriver/util/parameter/parameter_user_api.rb +0 -116
  71. data/lib/tdriver/util/parameter/parameter_xml.rb +0 -261
@@ -57,7 +57,10 @@ module TDriverReportCreator
57
57
  :pass_statuses,
58
58
  :fail_statuses,
59
59
  :not_run_statuses,
60
- :report_editable
60
+ :report_editable,
61
+ :test_fails,
62
+ :report_exclude_passed_cases
63
+
61
64
  )
62
65
  #class variables for summary report
63
66
  def initialize()
@@ -88,14 +91,39 @@ module TDriverReportCreator
88
91
  @total_received_data=Hash.new
89
92
  @total_sent_data=Hash.new
90
93
  $result_storage_in_use=false
91
- @pages=MobyUtil::Parameter[ :report_results_per_page, 50]
92
- @duration_graph=MobyUtil::Parameter[ :report_generate_duration_graph, false]
93
- @pass_statuses=MobyUtil::Parameter[ :report_passed_statuses, "passed" ].split('|')
94
- @fail_statuses=MobyUtil::Parameter[ :report_failed_statuses, "failed" ].split('|')
95
- @not_run_statuses=MobyUtil::Parameter[ :report_not_run_statuses, "not run" ].split('|')
96
- @report_editable=MobyUtil::Parameter[ :report_editable, "false" ]
97
- @report_short_folders=MobyUtil::Parameter[ :report_short_folders, 'false']
94
+ @pages=$parameters[ :report_results_per_page, 50]
95
+ @duration_graph=$parameters[ :report_generate_duration_graph, false]
96
+ @pass_statuses=$parameters[ :report_passed_statuses, "passed" ].split('|')
97
+ @fail_statuses=$parameters[ :report_failed_statuses, "failed" ].split('|')
98
+ @not_run_statuses=$parameters[ :report_not_run_statuses, "not run" ].split('|')
99
+ @report_editable=$parameters[ :report_editable, "false" ]
100
+ @report_short_folders=$parameters[ :report_short_folders, 'false']
101
+ @report_exclude_passed_cases=$parameters[ :report_exclude_passed_cases, 'false' ]
102
+ @test_fails=Hash.new(0) # return 0 by default if key not found
103
+
104
+
105
+ end
106
+
107
+ def get_sequential_fails
108
+ test_identifier = $new_test_case.test_case_group + "::" + $new_test_case.test_case_name
109
+ return @test_fails[ test_identifier ] # return 0 by default if key not found
110
+ end
111
+
112
+ def update_sequential_fails( status )
113
+
114
+ test_identifier = $new_test_case.test_case_group + "::" + $new_test_case.test_case_name
115
+
116
+ if @pass_statuses.include?(status)
117
+ @test_fails[ test_identifier ] = 0 unless @test_fails[ test_identifier ] == 0
118
+ elsif @fail_statuses.include?(status)
119
+ tempnum = @test_fails[ test_identifier ]
120
+ tempnum = tempnum + 1
121
+ @test_fails[ test_identifier ] = tempnum
122
+ end
123
+
124
+
98
125
  end
126
+
99
127
  #This method sets the test case user defined status
100
128
  #
101
129
  # === params
@@ -380,7 +408,7 @@ module TDriverReportCreator
380
408
  # nil
381
409
  # === raises
382
410
  def get_reporting_groups()
383
- @reporting_groups=MobyUtil::Parameter[ :report_groups, nil ]
411
+ @reporting_groups=$parameters[ :report_groups, nil ]
384
412
  if @reporting_groups==nil
385
413
  @reporting_groups=@generic_reporting_groups
386
414
  end
@@ -437,9 +465,9 @@ module TDriverReportCreator
437
465
  t = Time.now
438
466
  b_fixed_report_folder=false
439
467
  @start_time=t
440
- @reporter_base_folder = MobyUtil::Parameter[ :report_outputter_path, 'tdriver_reports/' ]
441
- if MobyUtil::Parameter[ :report_outputter_folder, nil ] != nil
442
- @report_folder=@reporter_base_folder+MobyUtil::Parameter[ :report_outputter_folder, nil ]
468
+ @reporter_base_folder = $parameters[ :report_outputter_path, 'tdriver_reports/' ]
469
+ if $parameters[ :report_outputter_folder, nil ] != nil
470
+ @report_folder=@reporter_base_folder+$parameters[ :report_outputter_folder, nil ]
443
471
  b_fixed_report_folder=true
444
472
  else
445
473
  @report_folder=@reporter_base_folder+"test_run_"+t.strftime( "%Y%m%d%H%M%S" )
@@ -451,7 +479,6 @@ module TDriverReportCreator
451
479
  FileUtils.mkdir_p @report_folder+'/environment'
452
480
  FileUtils.mkdir_p @report_folder+'/cases'
453
481
  FileUtils.mkdir_p @report_folder+'/junit_xml'
454
-
455
482
  else
456
483
  if b_fixed_report_folder==true
457
484
  FileUtils::remove_entry_secure(@report_folder, :force => true)
@@ -473,6 +500,18 @@ module TDriverReportCreator
473
500
  #write_page_end(@report_folder+'/cases/tdriver_log_index.html')
474
501
  write_page_start(@report_folder+'/cases/statistics_index.html','Statistics')
475
502
  write_page_end(@report_folder+'/cases/statistics_index.html')
503
+ if $parameters[ :report_generate_rdoc, 'false' ]=='true'
504
+ if $parameters[ :ats4_error_recovery_enabled, 'false' ]=='true'
505
+ ats4_drop_folder_arr=@report_folder.split('ats4-results')
506
+ system("rdoc --include #{ats4_drop_folder_arr[0]}/* --exclude test_run --op #{@report_folder}/doc")
507
+ puts "RDoc generated from test folder: #{ats4_drop_folder_arr[0]}/*"
508
+ else
509
+ system("rdoc --exclude test_run --op #{@report_folder}/doc")
510
+ puts "RDoc generated from test folder: #{Dir.pwd}"
511
+ end
512
+
513
+
514
+ end
476
515
  rescue Exception => e
477
516
  Kernel::raise e, "Unable to create report folder: #{@report_folder}", caller
478
517
  end
@@ -542,7 +581,7 @@ module TDriverReportCreator
542
581
  language='-'
543
582
  loc='-'
544
583
  #Copy behaviour and parameter xml files in to the report folder
545
- if /win/ =~ MobyUtil::EnvironmentHelper.ruby_platform
584
+ if /win/ =~ MobyUtil::EnvironmentHelper.ruby_platform || /mingw32/ =~ MobyUtil::EnvironmentHelper.ruby_platform
546
585
  FileUtils.cp_r 'C:/tdriver/behaviours', @report_folder+'/environment' if File.directory?('C:/tdriver/behaviours')
547
586
  FileUtils.cp_r 'C:/tdriver/templates', @report_folder+'/environment' if File.directory?('C:/tdriver/templates')
548
587
  FileUtils.cp_r 'C:/tdriver/defaults', @report_folder+'/environment' if File.directory?('C:/tdriver/defaults')
@@ -553,7 +592,7 @@ module TDriverReportCreator
553
592
  FileUtils.cp_r '/etc/tdriver/defaults', @report_folder+'/environment' if File.directory?('/etc/tdriver/defaults')
554
593
  FileUtils.copy('/etc/tdriver/tdriver_parameters.xml',@report_folder+'/environment/tdriver_parameters.xml') if File.file?('/etc/tdriver/tdriver_parameters.xml')
555
594
  end
556
- if MobyUtil::Parameter[ :report_monitor_memory, 'false']=='true'
595
+ if $parameters[ :report_monitor_memory, 'false']=='true'
557
596
  MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
558
597
  if sut_attributes[:is_connected]
559
598
  @memory_amount_start=get_sut_used_memory(sut_id, sut_attributes) if @memory_amount_start==nil || @memory_amount_start=='-'
@@ -565,7 +604,7 @@ module TDriverReportCreator
565
604
  end
566
605
  end
567
606
  end
568
- if MobyUtil::Parameter[ :report_collect_environment_data_from_sut, 'true']=='true'
607
+ if $parameters[ :report_collect_environment_data_from_sut, 'true']=='true'
569
608
  MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
570
609
  begin
571
610
  if sut_attributes[:is_connected]
@@ -574,9 +613,9 @@ module TDriverReportCreator
574
613
  @memory_amount_start=get_sut_used_memory(sut_id, sut_attributes) if @memory_amount_start==nil || @memory_amount_start=='-'
575
614
  @memory_amount_end=get_sut_used_memory(sut_id, sut_attributes)
576
615
  @memory_amount_total=get_sut_total_memory(sut_id, sut_attributes)
577
- product=MobyUtil::Parameter[sut_id][:product]
578
- language=MobyUtil::Parameter[sut_id][:language]
579
- loc=MobyUtil::Parameter[sut_id][:localisation_server_database_tablename]
616
+ product=$parameters[sut_id][:product]
617
+ language=$parameters[sut_id][:language]
618
+ loc=$parameters[sut_id][:localisation_server_database_tablename]
580
619
  end
581
620
  @memory_amount_start='-' if @memory_amount_start==nil
582
621
  @memory_amount_end='-' if @memory_amount_end==nil
@@ -629,10 +668,10 @@ module TDriverReportCreator
629
668
  MobyUtil::Logger.instance.enabled=false
630
669
  lang_version='-'
631
670
  begin
632
- if MobyUtil::Parameter[sut_id][:type]=='S60' || MobyUtil::Parameter[sut_id][:type]=='Symbian'
671
+ if $parameters[sut_id][:type]=='S60' || $parameters[sut_id][:type]=='Symbian'
633
672
  lang_version=sut_attributes[:sut].sysinfo( :Lang_version )
634
673
  end
635
- if MobyUtil::Parameter[sut_id][:type]=='QT'
674
+ if $parameters[sut_id][:type]=='QT'
636
675
  if /win/ =~ MobyUtil::EnvironmentHelper.ruby_platform
637
676
  lang_version=0
638
677
  else
@@ -641,7 +680,7 @@ module TDriverReportCreator
641
680
  end
642
681
  rescue
643
682
  ensure
644
- if MobyUtil::Parameter[ :logging_level, 0 ].to_i > 0
683
+ if $parameters[ :logging_level, 0 ].to_i > 0
645
684
  MobyUtil::Logger.instance.enabled=true
646
685
  else
647
686
  MobyUtil::Logger.instance.enabled=false
@@ -660,10 +699,10 @@ module TDriverReportCreator
660
699
  MobyUtil::Logger.instance.enabled=false
661
700
  sw_version='-'
662
701
  begin
663
- if MobyUtil::Parameter[sut_id][:type]=='S60' || MobyUtil::Parameter[sut_id][:type]=='Symbian'
702
+ if $parameters[sut_id][:type]=='S60' || $parameters[sut_id][:type]=='Symbian'
664
703
  sw_version=sut_attributes[:sut].sysinfo( :Sw_version )
665
704
  end
666
- if MobyUtil::Parameter[sut_id][:type]=='QT'
705
+ if $parameters[sut_id][:type]=='QT'
667
706
  if /win/ =~ MobyUtil::EnvironmentHelper.ruby_platform
668
707
  sw_version=0
669
708
  else
@@ -672,7 +711,7 @@ module TDriverReportCreator
672
711
  end
673
712
  rescue
674
713
  ensure
675
- if MobyUtil::Parameter[ :logging_level, 0 ].to_i > 0
714
+ if $parameters[ :logging_level, 0 ].to_i > 0
676
715
  MobyUtil::Logger.instance.enabled=true
677
716
  else
678
717
  MobyUtil::Logger.instance.enabled=false
@@ -691,10 +730,10 @@ module TDriverReportCreator
691
730
  MobyUtil::Logger.instance.enabled=false
692
731
  memory=0
693
732
  begin
694
- if MobyUtil::Parameter[sut_id][:type]=='S60' || MobyUtil::Parameter[sut_id][:type]=='Symbian'
733
+ if $parameters[sut_id][:type]=='S60' || $parameters[sut_id][:type]=='Symbian'
695
734
  memory=sut_attributes[:sut].sysinfo( :Get_used_ram )
696
735
  end
697
- if MobyUtil::Parameter[sut_id][:type]=='QT'
736
+ if $parameters[sut_id][:type]=='QT'
698
737
  if /win/ =~ MobyUtil::EnvironmentHelper.ruby_platform
699
738
  memory=0
700
739
  else
@@ -703,7 +742,7 @@ module TDriverReportCreator
703
742
  end
704
743
  rescue
705
744
  ensure
706
- if MobyUtil::Parameter[ :logging_level, 0 ].to_i > 0
745
+ if $parameters[ :logging_level, 0 ].to_i > 0
707
746
  MobyUtil::Logger.instance.enabled=true
708
747
  else
709
748
  MobyUtil::Logger.instance.enabled=false
@@ -723,10 +762,10 @@ module TDriverReportCreator
723
762
  MobyUtil::Logger.instance.enabled=false
724
763
  memory=0
725
764
  begin
726
- if MobyUtil::Parameter[sut_id][:type]=='S60' || MobyUtil::Parameter[sut_id][:type]=='Symbian'
765
+ if $parameters[sut_id][:type]=='S60' || $parameters[sut_id][:type]=='Symbian'
727
766
  memory=sut_attributes[:sut].sysinfo( :Get_total_ram )
728
767
  end
729
- if MobyUtil::Parameter[sut_id][:type]=='QT'
768
+ if $parameters[sut_id][:type]=='QT'
730
769
  if /win/ =~ MobyUtil::EnvironmentHelper.ruby_platform
731
770
  memory=0
732
771
  else
@@ -735,7 +774,7 @@ module TDriverReportCreator
735
774
  end
736
775
  rescue
737
776
  ensure
738
- if MobyUtil::Parameter[ :logging_level, 0 ].to_i > 0
777
+ if $parameters[ :logging_level, 0 ].to_i > 0
739
778
  MobyUtil::Logger.instance.enabled=true
740
779
  else
741
780
  MobyUtil::Logger.instance.enabled=false
@@ -900,7 +939,7 @@ module TDriverReportCreator
900
939
  row_hash.sort{|a,b| a[0]<=>b[0]}.each do |value|
901
940
  data_value=Nokogiri::XML::Node.new("column",test_data)
902
941
  data_value.set_attribute("name",value[0].to_s)
903
- data_value.content = value[1].to_s
942
+ data_value.content = value[1].to_s
904
943
  test_data << data_value
905
944
  end
906
945
  end
@@ -939,7 +978,7 @@ module TDriverReportCreator
939
978
  xml.dump_count calculate_total_values_from_hash(total_dump)
940
979
  xml.sent_bytes calculate_total_values_from_hash(total_sent)
941
980
  xml.received_bytes calculate_total_values_from_hash(total_received)
942
-
981
+
943
982
  if user_data!=nil && !user_data.empty?
944
983
  xml.user_display_data {
945
984
  (0..counter).each { |i|
@@ -950,7 +989,7 @@ module TDriverReportCreator
950
989
  }
951
990
  }
952
991
  end
953
-
992
+
954
993
  if user_data_rows!=nil && !user_data_columns.empty?
955
994
 
956
995
  xml.user_table_data{
@@ -958,7 +997,7 @@ module TDriverReportCreator
958
997
  user_data_rows.each do |row_hash|
959
998
  row_hash.sort{|a,b| a[0]<=>b[0]}.each do |value|
960
999
  xml.column("name"=>value[0].to_s){
961
- xml.text value[1].to_s
1000
+ xml.text value[1].to_s
962
1001
  }
963
1002
  end
964
1003
  end
@@ -1045,16 +1084,43 @@ module TDriverReportCreator
1045
1084
  result_storage=Array.new
1046
1085
  storage_file='all_cases.xml'
1047
1086
 
1087
+ nodes=Nokogiri::XML::NodeSet
1088
+
1048
1089
  file=@report_folder+'/'+storage_file
1049
1090
  if File.exist?(file)
1050
1091
  io = File.open(file, 'rb')
1051
1092
  xml_data = Nokogiri::XML(io){ |config| config.options = Nokogiri::XML::ParseOptions::STRICT }
1052
1093
  io.close
1053
1094
  if case_name
1054
- nodes=xml_data.root.xpath("//tests/test[name='#{case_name}']")
1095
+ nodes=xml_data.root.xpath("//tests/test[name='#{case_name}' and status='#{results.gsub('_',' ')}']")
1096
+ elsif results=='crash'
1097
+ nodes=xml_data.root.xpath("//tests/test[crashes>0]")
1098
+ elsif results=='reboot'
1099
+ nodes=xml_data.root.xpath("//tests/test[reboots>0]")
1100
+ elsif results!='all' && results!='crash' && results!='reboot'
1101
+ case results
1102
+ when 'passed'
1103
+
1104
+ nodes=xml_data.root.xpath("//tests/test[status='#{@pass_statuses.first}']")
1105
+
1106
+ when 'failed'
1107
+
1108
+ nodes=xml_data.root.xpath("//tests/test[status='#{@fail_statuses.first}']")
1109
+
1110
+ when 'not_run'
1111
+
1112
+ nodes=xml_data.root.xpath("//tests/test[status='#{@not_run_statuses.first}']")
1113
+
1114
+ end
1055
1115
  else
1056
- nodes=xml_data.root.xpath("//tests/test")
1116
+ if @report_exclude_passed_cases=='true'
1117
+ nodes=xml_data.root.xpath("//tests/test[status!='passed']")
1118
+ else
1119
+ nodes=xml_data.root.xpath("//tests/test")
1120
+ end
1121
+
1057
1122
  end
1123
+
1058
1124
  nodes.each do |node|
1059
1125
  value=node.search("name").text #0
1060
1126
  group=node.search("group").text #1
@@ -1095,73 +1161,9 @@ module TDriverReportCreator
1095
1161
  sent_bytes,
1096
1162
  received_bytes
1097
1163
  ]
1098
- case results
1099
- when 'passed'
1100
- if case_name
1101
- if @pass_statuses.include?(status) && value==case_name
1102
- result_storage << current_record
1103
- end
1104
- else
1105
- if @pass_statuses.include?(status)
1106
- result_storage << current_record
1107
- end
1108
- end
1109
1164
 
1110
- when 'failed'
1111
- if case_name
1112
- if @fail_statuses.include?(status) && value==case_name
1113
- result_storage << current_record
1114
- end
1115
- else
1116
- if @fail_statuses.include?(status)
1117
- result_storage << current_record
1118
- end
1119
- end
1165
+ result_storage << current_record
1120
1166
 
1121
- when 'not_run'
1122
- if case_name
1123
- if @not_run_statuses.include?(status) && value==case_name
1124
- result_storage << current_record
1125
- end
1126
- else
1127
- if @not_run_statuses.include?(status)
1128
- result_storage << current_record
1129
- end
1130
- end
1131
-
1132
- when 'crash'
1133
- if crashes.to_i > 0
1134
- result_storage << current_record
1135
- end
1136
-
1137
- when 'reboot'
1138
- if reboots.to_i > 0
1139
- result_storage << current_record
1140
- end
1141
-
1142
- when 'all'
1143
- if case_name
1144
- if value==case_name
1145
- result_storage << current_record
1146
- end
1147
- else
1148
- result_storage << current_record
1149
- end
1150
- else
1151
- if @pass_statuses.include?(status)
1152
- if (( case_name and value==case_name ) or !case_name )
1153
- result_storage << current_record
1154
- end
1155
- elsif @fail_statuses.include?(status)
1156
- if (( case_name and value==case_name ) or !case_name )
1157
- result_storage << current_record
1158
- end
1159
- elsif @not_run_statuses.include?(status)
1160
- if (( case_name and value==case_name ) or !case_name )
1161
- result_storage << current_record
1162
- end
1163
- end
1164
- end
1165
1167
  end
1166
1168
  xml_data=nil
1167
1169
  $result_storage_in_use=false
@@ -1210,7 +1212,7 @@ module TDriverReportCreator
1210
1212
  # nil
1211
1213
  # === raises
1212
1214
  def disconnect_connected_devices()
1213
- if MobyUtil::Parameter[ :report_disconnect_connected_devices, false ] == 'true'
1215
+ if $parameters[ :report_disconnect_connected_devices, false ] == 'true'
1214
1216
  MobyBase::SUTFactory.instance.connected_suts.each do |sut_id, sut_attributes|
1215
1217
  sut_attributes[:sut].disconnect() if sut_attributes[:is_connected]
1216
1218
  end
@@ -1240,6 +1242,7 @@ module TDriverReportCreator
1240
1242
  search_case = nil
1241
1243
  if @pass_statuses.include?(status)
1242
1244
  search_case = "passed"
1245
+ return if @report_exclude_passed_cases=='true'
1243
1246
  elsif @fail_statuses.include?(status)
1244
1247
  search_case = "failed"
1245
1248
  elsif @not_run_statuses.include?(status)
@@ -1405,4 +1408,4 @@ module TDriverReportCreator
1405
1408
  end
1406
1409
 
1407
1410
  end
1408
- end
1411
+ end
@@ -468,6 +468,7 @@ display: block;
468
468
  m, s = seconds.divmod(60)
469
469
  duration_str="#{m}m#{'%.3f' % s}s"
470
470
  end
471
+ duration_str='0' if duration_str==nil
471
472
  duration_str
472
473
  end
473
474
 
@@ -646,7 +647,8 @@ display: block;
646
647
  '-'
647
648
  end
648
649
  end
649
- def format_execution_log(log,folder=nil)
650
+
651
+ def format_execution_log(log,folder=nil)
650
652
  begin
651
653
  formatted_log=Array.new
652
654
  log.each do |line|
@@ -662,6 +664,7 @@ display: block;
662
664
  '-'
663
665
  end
664
666
  end
667
+
665
668
  def write_page_start(page, title,report_page=nil,report_pages=nil)
666
669
  case title
667
670
  when "TDriver test results"
@@ -696,6 +699,7 @@ display: block;
696
699
  status_style='test_passed' if status=='passed' || @pass_statuses.include?(status)
697
700
  status_style='test_failed' if status=='failed' || @fail_statuses.include?(status)
698
701
  status_style='test_not_run' if status=='not run' || @not_run_statuses.include?(status)
702
+
699
703
  begin
700
704
  used_memory_difference=@tc_memory_amount_start.to_i-@tc_memory_amount_end.to_i
701
705
  rescue
@@ -780,9 +784,18 @@ display: block;
780
784
  used_memory_difference.to_s<<
781
785
  '</td></tr>' <<
782
786
  '<tr><td><b>Device reboots</b></td><td>'<<
783
- reboots.to_s<<
784
- '</td></tr>' <<
785
- '<tr>' <<
787
+ reboots.to_s <<
788
+ '</td></tr>'
789
+ if $parameters[ :report_generate_rdoc, 'false' ]=='true' && test_case_name.include?('test_')
790
+ html_body << '<tr>' <<
791
+ '<td style="font-weight: 700">'<<
792
+ 'RDoc</td>'<<
793
+ '<td style="font-size: small; font-weight: bold">'<<
794
+ get_rdoc_for_method(test_case_name)<<
795
+ '</td></tr>'
796
+ end
797
+
798
+ html_body << '<tr>' <<
786
799
  '<td style="font-weight: 700">'<<
787
800
  'Details</td>'<<
788
801
  '<td style="font-size: small; font-weight: bold">'<<
@@ -956,7 +969,7 @@ display: block;
956
969
  html_body << '<form action="save_results_to" ><input type="submit" name="save_results_to" value="Download report" /></form>' if @report_editable=='true'
957
970
  tdriver_group=nil
958
971
  html_result=nil
959
- elsif @not_run_statuses.include?(status) || status == "not_run"
972
+ elsif @not_run_statuses.include?(status) || status == "not_run"
960
973
  title='<div class="page_title"><center><h1>Not run</h1></center></div>'<<
961
974
  '<div class="summary_not_run">' <<
962
975
  '<form action="save_total_run_results" >'
@@ -971,83 +984,83 @@ display: block;
971
984
  tdriver_group=nil
972
985
  html_result=nil
973
986
  else
974
- case status
975
- when 'crash'
976
- title='<div class="page_title"><center><h1>Crash</h1></center></div>'<<
977
- '<div class="summary_crash">' <<
978
- '<form action="save_total_run_results" >'
979
- tdriver_group=ReportingGroups.new(@reporting_groups,tc_arr,false)
980
- tdriver_group.parse_groups()
981
- html_result=tdriver_group.generate_report('all')
982
- html_body << title
983
- html_body << html_result
984
- html_body << "<input type=\"submit\" name=\"save_changes\" value=\"Save changes\" />" if @report_editable=='true'
985
- html_body << "</form>"
986
- html_body << '<form action="save_results_to" ><input type="submit" name="save_results_to" value="Download report" /></form>' if @report_editable=='true'
987
- tdriver_group=nil
988
- html_result=nil
989
- when 'reboot'
990
- title='<div class="page_title"><center><h1>Reboot</h1></center></div>'<<
991
- '<div class="summary_reboot">' <<
992
- '<form action="save_total_run_results" >'
993
- tdriver_group=ReportingGroups.new(@reporting_groups,tc_arr,false)
994
- tdriver_group.parse_groups()
995
- html_result=tdriver_group.generate_report('all')
996
- html_body << title
997
- html_body << html_result
998
- html_body << "<input type=\"submit\" name=\"save_changes\" value=\"Save changes\" />" if @report_editable=='true'
999
- html_body << "</form>"
1000
- html_body << '<form action="save_results_to" ><input type="submit" name="save_results_to" value="Download report" /></form>' if @report_editable=='true'
1001
- tdriver_group=nil
1002
- html_result=nil
1003
- when 'statistics'
1004
- title='<div class="page_title"><center><h1>Statistics</h1></center></div>'<<
1005
- '<div class="statistics">'
1006
- tdriver_group=ReportingStatistics.new(tc_arr)
1007
- html_result=tdriver_group.generate_statistics_table()
1008
- html_body << title
1009
- html_body << html_result
1010
- tdriver_group=nil
1011
- html_result=nil
1012
- else
1013
- chronological_html_body=Array.new
1014
- title='<div class="page_title"><center><h1>Total run</h1></center></div>'
1015
- view_selection='<div class="summary_view_select"><center><input type="button" value="Grouped view" ONCLICK="location.assign(\''+report_page.to_s+'_total_run_index.html\');"/>'<<
1016
- '<input type="button" value="Chronological view" ONCLICK="location.assign(\''+report_page.to_s+'_chronological_total_run_index.html\');"/></center></div>'<<
1017
- '<div class="summary_total_run">' <<
1018
- '<form action="save_total_run_results" >'
1019
- title << view_selection
1020
- tdriver_group=ReportingGroups.new(@reporting_groups,tc_arr)
1021
- tdriver_group.parse_groups()
1022
- html_result=tdriver_group.generate_report('all')
1023
- html_body << title
1024
- html_body << html_result
1025
- html_body << "<input type=\"submit\" name=\"save_changes\" value=\"Save changes\" />" if @report_editable=='true'
1026
- html_body << "</form>"
1027
- html_body << '<form action="save_results_to" ><input type="submit" name="save_results_to" value="Download report" /></form>' if @report_editable=='true'
1028
- html_body << '<form action="export_results_to_excel" ><input type="submit" name="export_results_to_excel" value="Export to Excel" /></form>' if @report_editable=='true'
1029
-
1030
- tdriver_group=nil
1031
- html_result=nil
1032
- tdriver_group=ReportingGroups.new(@reporting_groups,tc_arr,false)
1033
- tdriver_group.parse_groups()
1034
- chronological_html_result=tdriver_group.generate_report('all')
1035
- chronological_html_body << title
1036
- chronological_html_body << chronological_html_result
1037
- chronological_html_body << "<input type=\"submit\" name=\"save_changes\" value=\"Save changes\" />" if @report_editable=='true'
1038
- chronological_html_body << "</form>"
1039
- chronological_html_body << '<form action="save_results_to" ><input type="submit" name="save_results_to" value="Download report" /></form>' if @report_editable=='true'
1040
- chronological_html_body << '<form action="export_results_to_excel" ><input type="submit" name="export_results_to_excel" value="Export to Excel" /></form>' if @report_editable=='true'
1041
- chronological_html_body << "</div>"
1042
-
1043
- File.open(chronological_page, 'a') do |f2|
1044
- f2.puts chronological_html_body
1045
- end
1046
- tdriver_group=nil
1047
- chronological_html_result=nil
1048
- chronological_html_body=nil
1049
- end # case
1050
- end # if
987
+ case status
988
+ when 'crash'
989
+ title='<div class="page_title"><center><h1>Crash</h1></center></div>'<<
990
+ '<div class="summary_crash">' <<
991
+ '<form action="save_total_run_results" >'
992
+ tdriver_group=ReportingGroups.new(@reporting_groups,tc_arr,false)
993
+ tdriver_group.parse_groups()
994
+ html_result=tdriver_group.generate_report('all')
995
+ html_body << title
996
+ html_body << html_result
997
+ html_body << "<input type=\"submit\" name=\"save_changes\" value=\"Save changes\" />" if @report_editable=='true'
998
+ html_body << "</form>"
999
+ html_body << '<form action="save_results_to" ><input type="submit" name="save_results_to" value="Download report" /></form>' if @report_editable=='true'
1000
+ tdriver_group=nil
1001
+ html_result=nil
1002
+ when 'reboot'
1003
+ title='<div class="page_title"><center><h1>Reboot</h1></center></div>'<<
1004
+ '<div class="summary_reboot">' <<
1005
+ '<form action="save_total_run_results" >'
1006
+ tdriver_group=ReportingGroups.new(@reporting_groups,tc_arr,false)
1007
+ tdriver_group.parse_groups()
1008
+ html_result=tdriver_group.generate_report('all')
1009
+ html_body << title
1010
+ html_body << html_result
1011
+ html_body << "<input type=\"submit\" name=\"save_changes\" value=\"Save changes\" />" if @report_editable=='true'
1012
+ html_body << "</form>"
1013
+ html_body << '<form action="save_results_to" ><input type="submit" name="save_results_to" value="Download report" /></form>' if @report_editable=='true'
1014
+ tdriver_group=nil
1015
+ html_result=nil
1016
+ when 'statistics'
1017
+ title='<div class="page_title"><center><h1>Statistics</h1></center></div>'<<
1018
+ '<div class="statistics">'
1019
+ tdriver_group=ReportingStatistics.new(tc_arr)
1020
+ html_result=tdriver_group.generate_statistics_table()
1021
+ html_body << title
1022
+ html_body << html_result
1023
+ tdriver_group=nil
1024
+ html_result=nil
1025
+ else
1026
+ chronological_html_body=Array.new
1027
+ title='<div class="page_title"><center><h1>Total run</h1></center></div>'
1028
+ view_selection='<div class="summary_view_select"><center><input type="button" value="Grouped view" ONCLICK="location.assign(\''+report_page.to_s+'_total_run_index.html\');"/>'<<
1029
+ '<input type="button" value="Chronological view" ONCLICK="location.assign(\''+report_page.to_s+'_chronological_total_run_index.html\');"/></center></div>'<<
1030
+ '<div class="summary_total_run">' <<
1031
+ '<form action="save_total_run_results" >'
1032
+ title << view_selection
1033
+ tdriver_group=ReportingGroups.new(@reporting_groups,tc_arr)
1034
+ tdriver_group.parse_groups()
1035
+ html_result=tdriver_group.generate_report('all')
1036
+ html_body << title
1037
+ html_body << html_result
1038
+ html_body << "<input type=\"submit\" name=\"save_changes\" value=\"Save changes\" />" if @report_editable=='true'
1039
+ html_body << "</form>"
1040
+ html_body << '<form action="save_results_to" ><input type="submit" name="save_results_to" value="Download report" /></form>' if @report_editable=='true'
1041
+ html_body << '<form action="export_results_to_excel" ><input type="submit" name="export_results_to_excel" value="Export to Excel" /></form>' if @report_editable=='true'
1042
+
1043
+ tdriver_group=nil
1044
+ html_result=nil
1045
+ tdriver_group=ReportingGroups.new(@reporting_groups,tc_arr,false)
1046
+ tdriver_group.parse_groups()
1047
+ chronological_html_result=tdriver_group.generate_report('all')
1048
+ chronological_html_body << title
1049
+ chronological_html_body << chronological_html_result
1050
+ chronological_html_body << "<input type=\"submit\" name=\"save_changes\" value=\"Save changes\" />" if @report_editable=='true'
1051
+ chronological_html_body << "</form>"
1052
+ chronological_html_body << '<form action="save_results_to" ><input type="submit" name="save_results_to" value="Download report" /></form>' if @report_editable=='true'
1053
+ chronological_html_body << '<form action="export_results_to_excel" ><input type="submit" name="export_results_to_excel" value="Export to Excel" /></form>' if @report_editable=='true'
1054
+ chronological_html_body << "</div>"
1055
+
1056
+ File.open(chronological_page, 'a') do |f2|
1057
+ f2.puts chronological_html_body
1058
+ end
1059
+ tdriver_group=nil
1060
+ chronological_html_result=nil
1061
+ chronological_html_body=nil
1062
+ end # case
1063
+ end # if
1051
1064
 
1052
1065
  html_body << '</div>'
1053
1066
  File.open(page, 'a') do |f2|
@@ -1114,6 +1127,12 @@ display: block;
1114
1127
  '<td><b>Total device resets</b></td>'<<
1115
1128
  '<td>'+total_device_resets.to_s+'</td>'<<
1116
1129
  '</tr>'
1130
+ if $parameters[ :report_generate_rdoc, 'false' ]=='true'
1131
+ html_body << '<tr>'<<
1132
+ '<td><a href="doc/index.html"><b>Generated RDoc from</b></a></td>'<<
1133
+ '<td>'+Dir.pwd+'</td>'<<
1134
+ '</tr>'
1135
+ end
1117
1136
  $tdriver_reporter.total_dump_count.each do |item|
1118
1137
  html_body << '<tr>'<<
1119
1138
  "<td><b>Total dump count from sut #{item[0].to_s}</b></td>"<<
@@ -1348,7 +1367,7 @@ display: block;
1348
1367
  total_run_link="1_total_run_index.html\""
1349
1368
  statistics_link='statistics_index.html"'
1350
1369
  passed_link="1_passed_index.html\""
1351
- failed_link="#{report_page}_failed_index.html\" class=\"current\""
1370
+ failed_link="1_failed_index.html\""
1352
1371
  not_run_link="1_not_run_index.html\""
1353
1372
  else
1354
1373
  tdriver_test_results_link='../../index.html"'
@@ -1466,6 +1485,54 @@ display: block;
1466
1485
  def get_java_script()
1467
1486
  get_expand_collapse_java_script()
1468
1487
  end
1488
+
1489
+ def scan_rdoc_file_for_method(file,method_name)
1490
+ text = File.read(file)
1491
+ if text =~ /\b#{method_name}\b/
1492
+ path=file.split('doc/')
1493
+ return path[1]
1494
+ end
1495
+ end
1496
+
1497
+ def get_rdoc_for_method(method_name)
1498
+ doc=Array.new
1499
+ rdoc_files=[]
1500
+ #Find method documentation from report doc folder
1501
+ if File.directory?("#{$tdriver_reporter.report_folder()}/doc/classes")
1502
+ d = Dir.new("#{$tdriver_reporter.report_folder()}/doc/classes")
1503
+ d.each do |entry|
1504
+ if entry!="." && entry!=".."
1505
+ if File.directory?("#{d.path}/#{entry}")
1506
+ d1=Dir.new("#{d.path}/#{entry}")
1507
+ d1.each do |entry1|
1508
+ if entry1!="." && entry1!=".."
1509
+ if !File.directory?("#{d1.path}/#{entry1}")
1510
+ res=scan_rdoc_file_for_method("#{d1.path}/#{entry1}",method_name)
1511
+ rdoc_files << res if res
1512
+ end
1513
+ end
1514
+ end
1515
+ else
1516
+ res=scan_rdoc_file_for_method("#{d.path}/#{entry}",method_name)
1517
+ rdoc_files << res if res
1518
+ end
1519
+ end
1520
+ end
1521
+
1522
+
1523
+ rdoc_files.each do |rdoc|
1524
+ doc << "<iframe src=\"../../doc/#{rdoc}\"
1525
+ width=\"100%\" height=\"340\"
1526
+ align=\"right\" scrolling=\"yes\">
1527
+ <p><a href=\"../../doc/#{rdoc}\">#{method_name}</a>.</p>
1528
+ </iframe>"
1529
+ end
1530
+ return doc
1531
+ else
1532
+ return '-'
1533
+ end
1534
+ end
1535
+
1469
1536
  def format_user_log_table(user_data_rows,user_data_columns)
1470
1537
  begin
1471
1538
  formatted_user_data=Array.new