[Pkg-mozext-commits] [compactheader] 242/441: Test script ported to linux

David Prévot taffit at moszumanska.debian.org
Wed Mar 18 12:29:03 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository compactheader.

commit d2ab0e5d40a11738e0cf27833bb48872cba5eeae
Author: Joachim Herb <Joachim.Herb at gmx.de>
Date:   Wed Aug 3 20:40:57 2011 +0200

    Test script ported to linux
    
    --HG--
    branch : mozmill
---
 test/executeTests.pl | 43 ++++++++++++++++++++++++++-----------------
 test/testapps.csv    | 17 ++++++++---------
 2 files changed, 34 insertions(+), 26 deletions(-)

diff --git a/test/executeTests.pl b/test/executeTests.pl
old mode 100644
new mode 100755
index b80c8eb..87d2d17
--- a/test/executeTests.pl
+++ b/test/executeTests.pl
@@ -1,8 +1,10 @@
-#! perl -w
+#! /usr/bin/env perl 
 
 use strict;
 use warnings;
 use File::Copy;
+use POSIX;
+use Cwd;
 
 my $file = 'testapps.csv';
 my $xpi = "../../../AMO/CompactHeader-1.4.2beta3.xpi";
@@ -10,22 +12,23 @@ my $ftpdir = "ftp";
 
 my ($ostype,$hosttype,$version,$ftppath,$app,$tests);
 my ($unpack, $unpackargs, $unpacktargetargs, $appbin);
+my ($sysname, $nodename, $release, $osversion, $machine) = POSIX::uname();
 
 open (F, $file) || die ("Could not open $file!");
 
 mkdir "$ftpdir";
 
-if ($ENV{"OSTYPE"} eq "msys") {
+if ($^O eq "msys") {
   $unpack ="unzip";
   $unpackargs="-o";
   $unpacktargetargs="-d";
   $appbin="thunderbird.exe";
 }
-elsif ($ENV{"OSTYPE"} eq "linux-gnu") {
-  $unpack ="unzip";
-  $unpackargs="-o";
-  $unpacktargetargs="-d";
-  $appbin="thunderbird.exe";
+elsif ($^O eq "linux") {
+  $unpack ="tar";
+  $unpackargs="xjvf";
+  $unpacktargetargs="-C";
+  $appbin="thunderbird";
 }
 
 
@@ -33,10 +36,12 @@ while (my $line = <F>)
 {
   ($ostype,$hosttype,$version,$ftppath,$app,$tests) =
     parse_csv($line);
-  #print "$ostype\t$hosttype\t$version\t$ftppath\t$app\t$tests\n"
 
-  if (($ostype eq $ENV{'OSTYPE'})
-      && ($hosttype eq $ENV{'HOSTTYPE'})
+  next if (not defined($ostype));
+  print "$ostype\t$hosttype\t$version\t$ftppath\t$app\t$tests\n";
+
+  if (($ostype eq $^O)
+      && ($hosttype eq $machine)
       ) {
     print "$ostype\t$hosttype\t$version\t$ftppath\t$app\t$tests\n";
 
@@ -49,12 +54,14 @@ while (my $line = <F>)
     system $unpack, $unpackargs, "$ftpdir/$app", $unpacktargetargs, $testdir;
     system "unzip", "-o", "$ftpdir/$tests", "-d", $testdir, "-x", "*mochitest*", "*xpcshell*";
 
-    if ($ENV{"OSTYPE"} eq "msys") {
+    my $currentdir = getcwd;
+
+    if ($^O eq "msys") {
       system "junction", "-d", "$testdir/mozmill/compactheader";
       system "junction", "$testdir/mozmill/compactheader", "compactheader";
     }
     else {
-      system "ln", "-sfn", qq[$ENV{"PWD"}/compactheader $testdir/mozmill/compactheader];
+      system "ln", "-sfn", qq[$currentdir/compactheader], qq[$testdir/mozmill/compactheader];
     }
 
     # copy drag'n'drop helpers to shared-modules until they are added to thunderbird source
@@ -63,15 +70,17 @@ while (my $line = <F>)
       copy("$_","$testdir/mozmill/shared-modules");
     }
 
-    my $currentdir = $ENV{"PWD"};
-
     chdir "$testdir/mozmill";
     system "pwd";
 
-    my $log = `python runtest.py --binary=../thunderbird/$appbin --showall --show-errors -a $xpi -t compactheader 2>&1`;
+#    my $log = `python runtest.py --binary=../thunderbird/$appbin --showall --show-errors -a $xpi -t compactheader 2>&1`;
+    my $log = `python runtest.py --binary=../thunderbird/$appbin --showall --show-errors -a $xpi -t compactheader/test-compactheader-toolbar.js 2>&1`;
 
     chdir "$currentdir";
-    open (LOG, ">log-$version-$ostype-$hosttype.txt");
+    my @timeData = localtime(time);
+    my $datestr = sprintf "%04d%02d%02d%02d%02d", 1900+ at timeData[5],
+      1+ at timeData[4], @timeData[3], @timeData[2], @timeData[1]; 
+    open (LOG, ">log-$version-$ostype-$hosttype-$datestr.txt");
     print LOG "$log";
     close(LOG);
   }
@@ -89,4 +98,4 @@ sub parse_csv {
       }gx;
   push (@new, undef) if substr($text, -1, 1) eq ",";
   return @new;
-}
\ No newline at end of file
+}
diff --git a/test/testapps.csv b/test/testapps.csv
index a6a23b5..92329dc 100644
--- a/test/testapps.csv
+++ b/test/testapps.csv
@@ -1,13 +1,12 @@
 msys,i686,5.0,https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/5.0-candidates/build1/unsigned/win32/en-US/,thunderbird-5.0.zip,thunderbird-5.0.tests.zip,
-linux-gnu,i686,5.0,https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/5.0-candidates/build1/linux-i686/en-US/,thunderbird-5.0.tar.bz2,thunderbird-5.0.tests.zip,
-linux-gnu,x86_64,5.0,https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/5.0-candidates/build1/linux-x86_64/en-US/,thunderbird-5.0.tar.bz2,thunderbird-5.0.tests.zip,
+linux,i686,5.0,https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/5.0-candidates/build1/linux-i686/en-US/,thunderbird-5.0.tar.bz2,thunderbird-5.0.tests.zip,
+linux,x86_64,5.0,https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/5.0-candidates/build1/linux-x86_64/en-US/,thunderbird-5.0.tar.bz2,thunderbird-5.0.tests.zip,
 msys,i686,6.0b2,https://ftp.mozilla.org/pub/thunderbird/nightly/6.0b2-candidates/build1/unsigned/win32/en-US/,thunderbird-6.0b2.zip,thunderbird-6.0b2.tests.zip,
-linux-gnu,i686,6.0b2,https://ftp.mozilla.org/pub/thunderbird/nightly/6.0b2-candidates/build1/linux-i686/en-US/,thunderbird-6.0b2.tar.bz2,thunderbird-6.0b2.tests.zip,
-linux-gnu,x86_64,6.0b2,https://ftp.mozilla.org/pub/thunderbird/nightly/6.0b2-candidates/build1/linux-x86_64/en-US/,thunderbird-6.0b2.tar.bz2,thunderbird-6.0b2.tests.zip,
+linux,i686,6.0b2,https://ftp.mozilla.org/pub/thunderbird/nightly/6.0b2-candidates/build1/linux-i686/en-US/,thunderbird-6.0b2.tar.bz2,thunderbird-6.0b2.tests.zip,
+linux,x86_64,6.0b2,https://ftp.mozilla.org/pub/thunderbird/nightly/6.0b2-candidates/build1/linux-x86_64/en-US/,thunderbird-6.0b2.tar.bz2,thunderbird-6.0b2.tests.zip,
 msys,i686,7.0a2,https://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-aurora/,thunderbird-7.0a2.en-US.win32.zip,thunderbird-7.0a2.en-US.win32.tests.zip,
-linux-gnu,i686,7.0a2,https://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-aurora/,thunderbird-7.0a2.en-US.linux-i686.tar.bz2,thunderbird-7.0a2.en-US.linux-i686.tests.zip,
-linux-gnu,x86_64,7.0a2,https://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-aurora/,thunderbird-7.0a2.en-US.linux-x86_64.tar.bz2,thunderbird-7.0a2.en-US.linux-x86_64.tests.zip,
+linux,i686,7.0a2,https://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-aurora/,thunderbird-7.0a2.en-US.linux-i686.tar.bz2,thunderbird-7.0a2.en-US.linux-i686.tests.zip,
+linux,x86_64,7.0a2,https://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-aurora/,thunderbird-7.0a2.en-US.linux-x86_64.tar.bz2,thunderbird-7.0a2.en-US.linux-x86_64.tests.zip,
 msys,i686,8.0a1,https://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-central/,thunderbird-8.0a1.en-US.win32.zip,thunderbird-8.0a1.en-US.win32.tests.zip,
-linux-gnu,i686,8.0a1,https://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-central/,thunderbird-8.0a1.en-US.linux-i686.tar.bz2,thunderbird-8.0a1.en-US.linux-i686.tests.zip,
-linux-gnu,x86_64,8.0a1,https://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-central/,thunderbird-8.0a1.en-US.linux-x86_64.tar.bz2,thunderbird-8.0a1.en-US.linux-x86_64.tests.zip,
-
+linux,i686,8.0a1,https://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-central/,thunderbird-8.0a1.en-US.linux-i686.tar.bz2,thunderbird-8.0a1.en-US.linux-i686.tests.zip,
+linux,x86_64,8.0a1,https://ftp.mozilla.org/pub/thunderbird/nightly/latest-comm-central/,thunderbird-8.0a1.en-US.linux-x86_64.tar.bz2,thunderbird-8.0a1.en-US.linux-x86_64.tests.zip,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/compactheader.git



More information about the Pkg-mozext-commits mailing list