testability-driver 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -185,8 +185,7 @@ module TDriverReportCreator
|
|
185
185
|
$new_test_case.test_case_user_data_columns
|
186
186
|
)
|
187
187
|
|
188
|
-
|
189
|
-
$tdriver_reporter.test_case_user_xml_data=Hash.new
|
188
|
+
$tdriver_reporter.test_case_user_xml_data=Hash.new
|
190
189
|
$tdriver_reporter.set_end_time(Time.now)
|
191
190
|
$tdriver_reporter.set_total_run(1)
|
192
191
|
$tdriver_reporter.update_summary_page('inprogress')
|
@@ -232,7 +231,7 @@ module TDriverReportCreator
|
|
232
231
|
chronological_data_rows=$tdriver_reporter.test_case_user_chronological_table_data
|
233
232
|
$new_test_case.set_test_case_chronological_view_data(chronological_data_rows)
|
234
233
|
$tdriver_reporter.set_user_data(nil)
|
235
|
-
$tdriver_reporter.set_user_chronological_table_data(nil)
|
234
|
+
$tdriver_reporter.set_user_chronological_table_data(nil)
|
236
235
|
end
|
237
236
|
end
|
238
237
|
|
@@ -317,7 +316,7 @@ module TDriverReportCreator
|
|
317
316
|
|
318
317
|
each_video_device do | video_device, device_index |
|
319
318
|
begin
|
320
|
-
FileUtils.mv( "cam_" + device_index + "_" + @_video_file_name, "cam_" + device_index + "_" + @_previous_video_file_name )
|
319
|
+
FileUtils.mv(tdriver_report_folder() + "/cam_" + device_index + "_" + @_video_file_name, tdriver_report_folder() + "/cam_" + device_index + "_" + @_previous_video_file_name )
|
321
320
|
rescue
|
322
321
|
# do nothing..
|
323
322
|
end
|
@@ -551,6 +550,7 @@ module TDriverReportCreator
|
|
551
550
|
no_activity_videos = ""
|
552
551
|
if $parameters[:report_check_device_active, 'false']=='true'
|
553
552
|
if temp_rec
|
553
|
+
|
554
554
|
no_activity_videos = $new_test_case.target_video_alive
|
555
555
|
end
|
556
556
|
end
|
@@ -596,8 +596,6 @@ module TDriverReportCreator
|
|
596
596
|
|
597
597
|
update_run($new_test_case.test_case_name.to_s,status,$new_test_case.test_case_reboots,$new_test_case.test_case_crash_files,execution_log)
|
598
598
|
|
599
|
-
|
600
|
-
|
601
599
|
$new_junit_xml_results.add_test_result(status, $new_test_case.test_case_start_time, $new_test_case.test_case_end_time)
|
602
600
|
tdriver_update_sequential_fails( status ) if $parameters[ :runner_sequence_skip, "false" ] == "true"
|
603
601
|
|
@@ -620,7 +618,7 @@ module TDriverReportCreator
|
|
620
618
|
|
621
619
|
each_video_device do | video_device, device_index |
|
622
620
|
begin
|
623
|
-
delete_file = "cam_" + device_index + "_" + file_name
|
621
|
+
delete_file = tdriver_report_folder() + "/cam_" + device_index + "_" + file_name
|
624
622
|
if File.exists?( delete_file )
|
625
623
|
File.delete( delete_file )
|
626
624
|
end
|
@@ -393,13 +393,14 @@ module TDriverReportCreator
|
|
393
393
|
|
394
394
|
rec_options = { :width => tc_video_width, :height => tc_video_height, :fps => tc_video_fps }
|
395
395
|
rec_options[ :device ] = video_device unless video_device == "true" # use default device if "true"
|
396
|
-
video_recorder = MobyUtil::TDriverCam.new_cam( "cam_" + device_index + "_" + @tc_video_filename, rec_options )
|
396
|
+
video_recorder = MobyUtil::TDriverCam.new_cam( tdriver_report_folder() + "/cam_" + device_index + "_" + @tc_video_filename, rec_options )
|
397
397
|
video_recorder.start_recording
|
398
398
|
@tc_video_recorders << video_recorder
|
399
399
|
@tc_video_recording = true
|
400
400
|
|
401
401
|
end
|
402
402
|
rescue Exception => e
|
403
|
+
|
403
404
|
# make sure to stop any started cams if startup fails
|
404
405
|
stop_video_recording
|
405
406
|
raise e
|
@@ -419,11 +420,11 @@ module TDriverReportCreator
|
|
419
420
|
check_frame_min = $parameters[:report_activity_frame_treshold, '8']
|
420
421
|
check_video_min = $parameters[:report_activity_video_treshold, '29']
|
421
422
|
|
422
|
-
ret_n = MobyUtil.video_alive? "cam_" + device_index + "_" + @tc_video_filename, check_fps.to_f, check_frame_min.to_f, check_video_min.to_f, false
|
423
|
+
ret_n = MobyUtil.video_alive? tdriver_report_folder() + "/cam_" + device_index + "_" + @tc_video_filename, check_fps.to_f, check_frame_min.to_f, check_video_min.to_f, false
|
423
424
|
|
424
425
|
if !ret_n
|
425
426
|
ret += ", " if !ret.empty?
|
426
|
-
ret += "cam_" + device_index + "_" + @tc_video_filename
|
427
|
+
ret += tdriver_report_folder() + "/cam_" + device_index + "_" + @tc_video_filename
|
427
428
|
end
|
428
429
|
|
429
430
|
end
|
@@ -523,6 +524,7 @@ module TDriverReportCreator
|
|
523
524
|
MobyUtil::Logger.instance.enabled=false
|
524
525
|
begin
|
525
526
|
|
527
|
+
|
526
528
|
video_folder=@test_case_folder+'/video'
|
527
529
|
if File::directory?(video_folder)==false
|
528
530
|
FileUtils.mkdir_p video_folder
|
@@ -532,14 +534,15 @@ module TDriverReportCreator
|
|
532
534
|
each_video_device do | video_device, device_index |
|
533
535
|
|
534
536
|
begin
|
535
|
-
FileUtils.copy("cam_" + device_index + "_" + @tc_video_filename, video_folder)
|
537
|
+
FileUtils.copy(tdriver_report_folder() + "/cam_" + device_index + "_" + @tc_video_filename, video_folder)
|
536
538
|
rescue
|
537
|
-
|
539
|
+
# Copy failed, do nothing
|
538
540
|
end
|
539
541
|
|
540
542
|
begin
|
541
|
-
FileUtils.copy("cam_" + device_index + "_" + @tc_previous_video_filename, video_folder)
|
543
|
+
FileUtils.copy(tdriver_report_folder() + "/cam_" + device_index + "_" + @tc_previous_video_filename, video_folder)
|
542
544
|
rescue
|
545
|
+
|
543
546
|
# Copy failed, do nothing
|
544
547
|
end
|
545
548
|
|
@@ -42,6 +42,7 @@ module MobyUtil
|
|
42
42
|
"Norwegian" => ["no", "08"],
|
43
43
|
"Finnish" => ["fi", "09"],
|
44
44
|
"English US" => ["en_US", "10"],
|
45
|
+
"en_US" => ["en_US", "14346"],
|
45
46
|
# "Swiss French" => ["SF", "11"],
|
46
47
|
# "Swiss German" => ["SG", "12"],
|
47
48
|
"Portuguese" => ["pt", "13"],
|
@@ -83,6 +84,7 @@ module MobyUtil
|
|
83
84
|
"Estonian" => ["et", "49"],
|
84
85
|
"Persian" => ["fa", "50"],
|
85
86
|
"French CA" => ["fr_CA", "51"],
|
87
|
+
"fr_CA" => ["fr_CA", "14387"],
|
86
88
|
# "Scots Gaelic" => ["GD", "52"],
|
87
89
|
"Georgian" => ["ka", "53"],
|
88
90
|
"Greek" => ["el", "54"],
|
@@ -107,14 +109,18 @@ module MobyUtil
|
|
107
109
|
# "Moldavian" => ["MO", "73"],
|
108
110
|
"Mongolian" => ["mn", "74"],
|
109
111
|
# "Norwegian Nynorsk" => ["nn", "75"],
|
110
|
-
"Portuguese BR" => ["pt_BR", "76"],
|
112
|
+
"Portuguese BR" => ["pt_BR", "76"],
|
113
|
+
"pt_AM" => ["pt_AM", "14412"],
|
111
114
|
"Punjabi" => ["pa", "77"],
|
112
115
|
"Romanian" => ["ro", "78"],
|
113
116
|
"Servian" => ["sr", "79"],
|
114
117
|
"Sinhala" => ["si", "80"],
|
115
118
|
# "Somali" => ["SO", "81"],
|
116
119
|
# "International Spanish" => ["OS", "82"],
|
117
|
-
"Spanish AM" => ["es_419", "83"],
|
120
|
+
"Spanish AM" => ["es_419", "83"],
|
121
|
+
"sp_AM" => ["sp_AM", "14419"],
|
122
|
+
"sp_PA" => ["sp_PA", "6154"],
|
123
|
+
"sp_UR" => ["sp_UR", "14346"],
|
118
124
|
"Swahili" => ["sw", "84"],
|
119
125
|
# "Finland Swedish" => ["FS", "85"],
|
120
126
|
"Tamil" => ["ta", "87"],
|
@@ -564,7 +570,7 @@ module MobyUtil
|
|
564
570
|
begin
|
565
571
|
|
566
572
|
data = []
|
567
|
-
file.split('/').last.match(/(.*)_(\w{2,
|
573
|
+
file.split('/').last.match(/(.*)_(\w{2,5}).loc/)
|
568
574
|
fname = $1
|
569
575
|
language_number = $2
|
570
576
|
# select returns an array of [language, codes] that suite the conditional
|
@@ -574,7 +580,7 @@ module MobyUtil
|
|
574
580
|
|
575
581
|
io = open(file)
|
576
582
|
while line = io.gets
|
577
|
-
if line.match(/#define ([a-zA-Z1-9\_]*) \"(.*)\"/)
|
583
|
+
if line.match(/#define ([a-zA-Z1-9\d\_]*) \"(.*)\"/)
|
578
584
|
lname = $1
|
579
585
|
translation = $2
|
580
586
|
# When no lengthvar is provided we now assign priority '1' by default
|
@@ -586,8 +592,8 @@ module MobyUtil
|
|
586
592
|
#p data
|
587
593
|
return language, data
|
588
594
|
rescue Exception => e
|
589
|
-
puts e.message
|
590
|
-
puts e.backtrace
|
595
|
+
#puts e.message
|
596
|
+
#puts e.backtrace
|
591
597
|
end
|
592
598
|
end
|
593
599
|
|
@@ -607,7 +613,7 @@ module MobyUtil
|
|
607
613
|
language += "_"
|
608
614
|
end
|
609
615
|
|
610
|
-
sql_file = File.open(table_name + ".#{db_connection.db_type}.sql", 'a')
|
616
|
+
sql_file = File.open(table_name + ".#{db_connection.db_type}.sql", 'a')
|
611
617
|
|
612
618
|
# CREATE TABLE if doesn't exist (language columns to be created as needed)
|
613
619
|
# When no lengthvar is provided we now assign priority '1' by default
|
@@ -668,30 +674,30 @@ module MobyUtil
|
|
668
674
|
|
669
675
|
begin
|
670
676
|
# Formatting (seems like there is no length limit for the insert string)
|
671
|
-
data.each do |fname, source, translation, plurality, lengthvar|
|
677
|
+
data.each do |fname, source, translation, plurality, lengthvar|
|
672
678
|
# Escape ` and ' and " and other restricted characters in SQL (prevent SQL injections
|
673
679
|
source = source.gsub(/([\'\"\`\;\&])/){|s| "\\" + s}
|
674
|
-
translation = (translation != nil) ? translation.gsub(/([\'\"
|
680
|
+
translation = (translation != nil) ? translation.gsub(/([\'\"\`\;\&\\'\\"])/){|s| "\\" + s} : ""
|
675
681
|
if plurality=='NULL'
|
676
682
|
insert_values += "('" + fname + "', '" + source + "', '" + translation + "', NULL, '" + lengthvar + "'), "
|
677
683
|
else
|
678
684
|
insert_values += "('" + fname + "', '" + source + "', '" + translation + "', '" + plurality + "', '" + lengthvar + "'), "
|
679
|
-
end
|
685
|
+
end
|
680
686
|
end
|
687
|
+
|
681
688
|
insert_values[-2] = ' ' unless insert_values == "" # replace last ',' with ';'
|
682
689
|
# INSERT Query
|
683
690
|
query_string = "INSERT INTO `" + table_name + "` (FNAME, LNAME, `" + language + "`, `PLURALITY`, `LENGTHVAR`) VALUES " + insert_values +
|
684
691
|
"ON DUPLICATE KEY UPDATE fname = VALUES(fname), lname = VALUES(lname), `" + language + "` = VALUES(`" + language + "`) ;"
|
685
692
|
MobyUtil::DBAccess.query( db_connection, query_string )
|
686
693
|
sql_file.write( query_string + "\n" ) if record_sql
|
687
|
-
|
688
694
|
rescue Exception => e
|
689
695
|
puts e.message
|
690
696
|
puts e.backtrace
|
691
697
|
puts ''
|
692
|
-
sql_file.write( "Error: #{e.message}: #{query_string}" + "\n" )
|
698
|
+
sql_file.write( "Error: #{e.message}: #{query_string}" + "\n" )
|
693
699
|
end
|
694
|
-
|
700
|
+
|
695
701
|
when "sqlite"
|
696
702
|
begin
|
697
703
|
# Formatting (limit on the length of the Insert String! So multiple Insets
|
data/lib/tdriver/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testability-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 1.4.
|
9
|
+
- 2
|
10
|
+
version: 1.4.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Testability Driver team
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin/
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-12-
|
18
|
+
date: 2011-12-20 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|