diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-01-19 13:49:52 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-01-21 11:10:14 +0100 |
commit | b6191b16d41459ed73cea738dfaf8e25e81ae22b (patch) | |
tree | 6ad0952af507bf1ab8df9612023d6e224db8d7e2 /tests/auto/android/runtests_androiddeployqt.pl | |
parent | b2883a6acc7a8d8372a815cc91dd1a8449f25723 (diff) | |
parent | 9087df6bd2dd5198ccf101a237aadee331e51ec3 (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/corelib/global/global.pri
src/corelib/global/qcompilerdetection.h
src/corelib/global/qglobal.h
src/corelib/tools/qdatetime.cpp
src/plugins/platforms/xcb/qxcbscreen.h
src/plugins/platforms/xcb/qxcbwindow.h
src/widgets/dialogs/qcolordialog.cpp
src/widgets/dialogs/qcolordialog_p.h
tools/configure/configureapp.cpp
Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
Diffstat (limited to 'tests/auto/android/runtests_androiddeployqt.pl')
-rwxr-xr-x | tests/auto/android/runtests_androiddeployqt.pl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/android/runtests_androiddeployqt.pl b/tests/auto/android/runtests_androiddeployqt.pl index fe67257b4b..8e9376da35 100755 --- a/tests/auto/android/runtests_androiddeployqt.pl +++ b/tests/auto/android/runtests_androiddeployqt.pl @@ -40,6 +40,8 @@ use File::Temp 'tempdir'; use File::Path 'remove_tree'; use Getopt::Long; use Pod::Usage; +use XML::Simple; +use Term::ANSIColor; ### default options my @stack = cwd; @@ -53,6 +55,7 @@ my $testsubset = ""; my $man = 0; my $help = 0; my $make_clean = 0; +my $stop_on_fail = 0; my $time_out=400; my $android_toolchain_version = "4.8"; my $host_arch = "linux-x86"; @@ -89,6 +92,7 @@ GetOptions('h|help' => \$help , 'strip=s' => \$strip_tool , 'readelf=s' => \$readelf_tool , 'testcase=s' => \$testcase + , 'f|fail' => sub { $stop_on_fail = 1 } , 'silent' => sub { $silent = 1 } , 'ci' => sub { $ci_use = 1 } , 'uninstall' => sub { $uninstall = 1 } @@ -311,6 +315,37 @@ if ($output =~ m/.*\[ro.build.version.sdk\]: \[(\d+)\]/) $sdk_api=9 if ($sdk_api>9); } +sub checkXMLOutput +{ + print color 'bold red'; + my $fileName = shift; + my $XMLOutput = eval { XMLin($fileName, ForceArray => 1) }; + if (!defined($XMLOutput)) { + print "Can't parse the $fileName file, probably the test crased.\n"; + print color 'reset'; + die "Stopping\n" if $stop_on_fail; + return; + } + my $testName = $XMLOutput->{name}; + my $fail = 0; + while (my($node_key, $node_valule) = each (%{$XMLOutput})) { + next if $node_key ne "TestFunction"; + while (my($function_key, $function_valule) = each (%{$node_valule})) { + while (my($test_key, $test_valule) = each (%{$function_valule})) { + next if $test_key ne "Incident"; + for my $incident (@{$test_valule}) { + if ($incident->{type} ne "pass") { + print "test $testName::$function_key failed $incident->{file}:$incident->{line}\n"; + $fail = 1; + } + } + } + } + } + print color 'reset'; + die "Stopping\n" if $stop_on_fail and $fail; +} + sub startTest { my $testName = shift; @@ -352,6 +387,7 @@ sub startTest sleep(3); system("$adb_tool $device_serial pull /data/data/$packageName/output.xml $output_dir/$output_file.xml") if ($get_xml); + system("$adb_tool $device_serial pull /data/data/$packageName/output.txt $output_dir/$output_file.txt") if ($get_txt); if ($get_txt){ print "Tesresults for $packageName:\n"; @@ -359,6 +395,8 @@ sub startTest print_output("$output_dir/$output_file.txt", $packageName, $insignificance); } system("$adb_tool $device_serial uninstall $packageName") if ($uninstall); + + checkXMLOutput("$output_dir/$output_file.xml") if ($get_xml); return 1; } @@ -439,6 +477,9 @@ runtests.pl [options] =head1 OPTIONS =over 8 +=item B<-f --fail> + +Stop the script when test fails. Default 0 =item B<-s --serial = serial> |