Skip to content

Commit

Permalink
Merge pull request #4507 from GeoffreyBooth/tests-exit-code
Browse files Browse the repository at this point in the history
Failing tests exit code; separate building and testing browser compiler
  • Loading branch information
lydell authored Apr 16, 2017
2 parents a36b454 + faf6d17 commit 473e8a1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ task 'build:full', 'build the CoffeeScript compiler from source twice, and run t
build ->
build testBuiltCode

task 'build:browser', 'build the merged script for inclusion in the browser', ->
task 'build:browser', 'merge the built scripts into a single file for use in a browser', ->
code = """
require['../../package.json'] = (function() {
return #{fs.readFileSync "./package.json"};
Expand Down Expand Up @@ -154,6 +154,9 @@ task 'build:browser', 'build the merged script for inclusion in the browser', ->
outputFolder = "docs/v#{majorVersion}/browser-compiler"
fs.mkdirSync outputFolder unless fs.existsSync outputFolder
fs.writeFileSync "#{outputFolder}/coffee-script.js", header + '\n' + code

task 'build:browser:full', 'merge the built scripts into a single file for use in a browser, and test it', ->
invoke 'build:browser'
console.log "built ... running browser tests:"
invoke 'test:browser'

Expand Down Expand Up @@ -321,7 +324,7 @@ task 'doc:source:watch', 'watch and continually rebuild the annotated source doc

task 'release', 'build and test the CoffeeScript source, and build the documentation', ->
invoke 'build:full'
invoke 'build:browser'
invoke 'build:browser:full'
invoke 'doc:site'
invoke 'doc:test'
invoke 'doc:source'
Expand Down Expand Up @@ -407,12 +410,14 @@ runTests = (CoffeeScript) ->


task 'test', 'run the CoffeeScript language test suite', ->
runTests CoffeeScript
testResults = runTests CoffeeScript
process.exit 1 unless testResults


task 'test:browser', 'run the test suite against the merged browser script', ->
source = fs.readFileSync "docs/v#{majorVersion}/browser-compiler/coffee-script.js", 'utf-8'
result = {}
global.testingBrowser = yes
(-> eval source).call result
runTests result.CoffeeScript
testResults = runTests result.CoffeeScript
process.exit 1 unless testResults

0 comments on commit 473e8a1

Please sign in to comment.