Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing tests exit code; separate building and testing browser compiler #4507

Merged
merged 2 commits into from
Apr 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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