[Pkg-mozext-commits] [adblock-plus] 294/464: Convert some unit tests as well

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:27 UTC 2014


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

taffit pushed a commit to branch master
in repository adblock-plus.

commit 7c7781a519709c78d6cc3979ac90c9bcd4c9432b
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Tue Aug 28 13:47:16 2012 +0200

    Convert some unit tests as well
---
 abp_rewrite.py | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/abp_rewrite.py b/abp_rewrite.py
index b25168b..86874fe 100644
--- a/abp_rewrite.py
+++ b/abp_rewrite.py
@@ -8,15 +8,16 @@
 import sys, os, subprocess
 
 def doRewrite():
-  if len(sys.argv) < 3:
+  if len(sys.argv) < 4:
     print '''Usage:
 
-%s <abp_firefox_dir> <abp_chrome_dir>
+%s <abp_firefox_dir> <abptests_dir> <abp_chrome_dir>
 ''' % sys.argv[0]
     sys.exit(2)
 
   sourceDir = sys.argv[1]
-  targetDir = sys.argv[2]
+  testsDir = sys.argv[2]
+  targetDir = sys.argv[3]
 
   basedir = os.path.dirname(sys.argv[0])
   if not basedir:
@@ -37,5 +38,16 @@ def doRewrite():
   out = open(os.path.join(targetDir, 'lib', 'adblockplus.js'), 'wb')
   subprocess.Popen(command, stdout=out).communicate()
 
+  command = [application, os.path.join(basedir, 'jshydra.js'), os.path.join(basedir, 'scripts', 'abprewrite.js')]
+  for test in ('domainRestrictions', 'filterClasses', 'subscriptionClasses', 'matcher'):
+    sourceFile = os.path.join(testsDir, 'chrome', 'content', 'tests', test + '.js')
+    if not os.path.exists(sourceFile):
+      print 'Source file %s could not be found' % sourceFile
+      sys.exit(2)
+    command.append(sourceFile)
+
+  out = open(os.path.join(targetDir, 'qunit', 'tests', 'adblockplus.js'), 'wb')
+  subprocess.Popen(command, stdout=out).communicate()
+
 if __name__ == '__main__':
   doRewrite()

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



More information about the Pkg-mozext-commits mailing list