Index: packagerChrome.py diff --git a/packagerChrome.py b/packagerChrome.py index be749d697775900fc42f64a454ca5e7a01e54775..95b0118921719bb5c0d7d763f4dee7a8c394d12f 100644 --- a/packagerChrome.py +++ b/packagerChrome.py @@ -150,7 +150,7 @@ def toJson(data): ).encode('utf-8') + '\n' -def create_bundles(params, files): +def create_bundles(params, files, bundle_tests): base_extension_path = params['baseDir'] info_templates = { 'chrome': 'chromeInfo.js.tmpl', @@ -191,6 +191,15 @@ def create_bundles(params, files): 'entry_points': entry_files, }) + if bundle_tests: + qunit_path = os.path.join(base_extension_path, 'qunit') + qunit_files = ([os.path.join(qunit_path, 'common.js')] + + glob.glob(os.path.join(qunit_path, 'tests', '*.js'))) + configuration['bundles'].append({ + 'bundle_name': 'qunit/tests.js', + 'entry_points': qunit_files + }) + cmd = ['node', os.path.join(os.path.dirname(__file__), 'webpack_runner.js')] process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE) @@ -364,7 +373,8 @@ def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil files.read(baseDir, skip=[opt for opt, _ in mapped]) if metadata.has_section('bundles'): - create_bundles(params, files) + bundle_tests = devenv and metadata.has_option('general', 'testScripts') + create_bundles(params, files, bundle_tests) if metadata.has_section('preprocess'): files.preprocess( Index: packagerEdge.py diff --git a/packagerEdge.py b/packagerEdge.py index 8006a9ef5ef96f5702307ffb72f83e9f2ef304e8..766baae91807072a50a5bfa7aa91b723071f99dc 100644 --- a/packagerEdge.py +++ b/packagerEdge.py @@ -178,7 +178,8 @@ def createBuild(baseDir, type='edge', outFile=None, # noqa: preserve API. files.read(baseDir) if metadata.has_section('bundles'): - packagerChrome.create_bundles(params, files) + bundle_tests = devenv and metadata.has_option('general', 'testScripts') + packagerChrome.create_bundles(params, files, bundle_tests) if metadata.has_section('preprocess'): files.preprocess(metadata.options('preprocess'), {'needsExt': True}) Index: templates/testIndex.html.tmpl diff --git a/templates/testIndex.html.tmpl b/templates/testIndex.html.tmpl index cc091974ad3cc3e11ffef5e6b8ae1a1505c0ae4c..dec9b398bfc9fa29117c6f6b257a2b806258e574 100644 --- a/templates/testIndex.html.tmpl +++ b/templates/testIndex.html.tmpl @@ -14,6 +14,7 @@ {%- for script in scripts %} {%- endfor %} +