[Pkg-mozext-commits] [compactheader] 241/441: Use a perl script to execute tests

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 010204436ee129b47822186d8f451a4d9b7f2e19
Author: joachim <none at none>
Date:   Wed Aug 3 00:17:26 2011 +0200

    Use a perl script to execute tests
    
    --HG--
    branch : mozmill
---
 .hgignore            |  4 ++-
 install.rdf          |  2 +-
 test/executeTests.pl | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 test/testapps.csv    | 13 ++++++++
 4 files changed, 109 insertions(+), 2 deletions(-)

diff --git a/.hgignore b/.hgignore
index 32e23f8..ca398e2 100644
--- a/.hgignore
+++ b/.hgignore
@@ -4,4 +4,6 @@ syntax: regexp
 syntax: regexp
 ^test/ftp$
 syntax: regexp
-^test/test-.*
\ No newline at end of file
+^test/test-.*
+syntax: regexp
+log-.*.txt
\ No newline at end of file
diff --git a/install.rdf b/install.rdf
index 1daf67f..05a6af8 100644
--- a/install.rdf
+++ b/install.rdf
@@ -24,7 +24,7 @@
 			<RDF:Description>
 				<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
 				<em:minVersion>5.0</em:minVersion>
-				<em:maxVersion>6.*</em:maxVersion>
+				<em:maxVersion>8.*</em:maxVersion>
 			</RDF:Description>
 		</em:targetApplication>
 	</RDF:Description>
diff --git a/test/executeTests.pl b/test/executeTests.pl
new file mode 100644
index 0000000..b80c8eb
--- /dev/null
+++ b/test/executeTests.pl
@@ -0,0 +1,92 @@
+#! perl -w
+
+use strict;
+use warnings;
+use File::Copy;
+
+my $file = 'testapps.csv';
+my $xpi = "../../../AMO/CompactHeader-1.4.2beta3.xpi";
+my $ftpdir = "ftp";
+
+my ($ostype,$hosttype,$version,$ftppath,$app,$tests);
+my ($unpack, $unpackargs, $unpacktargetargs, $appbin);
+
+open (F, $file) || die ("Could not open $file!");
+
+mkdir "$ftpdir";
+
+if ($ENV{"OSTYPE"} 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";
+}
+
+
+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'})
+      ) {
+    print "$ostype\t$hosttype\t$version\t$ftppath\t$app\t$tests\n";
+
+    my $testdir = "test-$version";
+
+    mkdir "$testdir";
+    system "wget", "-P", "$ftpdir", "-N", "$ftppath/$app";
+    system "wget", "-P", "$ftpdir", "-N", "$ftppath/$tests";
+
+    system $unpack, $unpackargs, "$ftpdir/$app", $unpacktargetargs, $testdir;
+    system "unzip", "-o", "$ftpdir/$tests", "-d", $testdir, "-x", "*mochitest*", "*xpcshell*";
+
+    if ($ENV{"OSTYPE"} 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];
+    }
+
+    # copy drag'n'drop helpers to shared-modules until they are added to thunderbird source
+    my @shared_files = glob("shared-modules/*");
+    foreach (@shared_files) {
+      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`;
+
+    chdir "$currentdir";
+    open (LOG, ">log-$version-$ostype-$hosttype.txt");
+    print LOG "$log";
+    close(LOG);
+  }
+}
+
+close (F);
+
+sub parse_csv {
+  my $text = shift;
+  my @new = ();
+  push (@new, $+) while $text =~ m{
+          "([^\"\\]*(?:\\.[^\"\\]*)*)",?
+          | ([^,]+),?
+          | ,
+      }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
new file mode 100644
index 0000000..a6a23b5
--- /dev/null
+++ b/test/testapps.csv
@@ -0,0 +1,13 @@
+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,
+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,
+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,
+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,
+

-- 
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