Load the examples using PhantomJS
This commit adds a check-examples target to check that the hosted examples load without errors.
This commit is contained in:
13
build.py
13
build.py
@@ -95,7 +95,7 @@ def report_sizes(t):
|
||||
virtual('all', 'build-all', 'build', 'examples', 'precommit')
|
||||
|
||||
|
||||
virtual('precommit', 'lint', 'build-all', 'test', 'build', 'build-examples', 'doc')
|
||||
virtual('precommit', 'lint', 'build-all', 'test', 'build', 'build-examples', 'check-examples', 'doc')
|
||||
|
||||
|
||||
virtual('build', 'build/ol.css', 'build/ol.js', 'build/ol-simple.js', 'build/ol-whitespace.js')
|
||||
@@ -356,6 +356,17 @@ def hostexamples(t):
|
||||
t.cp('examples/example-list.js', 'examples/example-list.xml', 'examples/Jugl.js', 'build/gh-pages/%(BRANCH)s/examples/')
|
||||
|
||||
|
||||
@target('check-examples', 'hostexamples', phony=True)
|
||||
def check_examples(t):
|
||||
directory = 'build/gh-pages/%(BRANCH)s/'
|
||||
examples = ['build/gh-pages/%(BRANCH)s/' + e for e in EXAMPLES]
|
||||
all_examples = examples + \
|
||||
[e + '?mode=simple' for e in examples] + \
|
||||
[e + '?mode=whitespace' for e in examples]
|
||||
for example in all_examples:
|
||||
t.run('%(PHANTOMJS)s', 'bin/check-example.js', example)
|
||||
|
||||
|
||||
@target(PROJ4JS, PROJ4JS_ZIP)
|
||||
def proj4js(t):
|
||||
from zipfile import ZipFile
|
||||
|
||||
Reference in New Issue
Block a user