Skip to content

Commit

Permalink
removing old changes
Browse files Browse the repository at this point in the history
  • Loading branch information
disnet committed Oct 7, 2011
1 parent c20a8ff commit 0ded5b3
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions Cakefile
Expand Up @@ -9,10 +9,12 @@ enableColors = no
unless process.platform is 'win32'
enableColors = not process.env.NODE_DISABLE_COLORS

bold = if enableColors then '\033[0;1m' else ""
red = if enableColors then '\033[0;31m' else ""
green = if enableColors then '\033[0;32m' else ""
reset = if enableColors then '\033[0m' else ""
bold = red = green = reset = ''
if enableColors
bold = '\033[0;1m'
red = '\033[0;31m'
green = '\033[0;32m'
reset = '\033[0m'

# Built file header.
header = """
Expand Down Expand Up @@ -70,12 +72,12 @@ task 'build', 'build the CoffeeScript language from source', build = (cb) ->
run ['-c', '-o', 'lib/coffee-script'].concat(files), cb


task 'build:full', 'rebuild the source twice, and run the tests', (options) ->
task 'build:full', 'rebuild the source twice, and run the tests', ->
build ->
build ->
csPath = './lib/coffee-script'
delete require.cache[require.resolve csPath]
unless runTests (require csPath), options
unless runTests require csPath
process.exit 1


Expand Down Expand Up @@ -130,9 +132,8 @@ task 'doc:underscore', 'rebuild the Underscore.coffee documentation page', ->
exec 'docco examples/underscore.coffee && cp -rf docs documentation && rm -r docs', (err) ->
throw err if err

task 'bench', 'quick benchmark of compilation time', (options) ->
task 'bench', 'quick benchmark of compilation time', ->
{Rewriter} = require './lib/coffee-script/rewriter'

co = sources.map((name) -> fs.readFileSync name).join '\n'
fmt = (ms) -> " #{bold}#{ " #{ms}".slice -4 }#{reset} ms"
total = 0
Expand All @@ -154,7 +155,7 @@ task 'loc', 'count the lines of source code in the CoffeeScript compiler', ->


# Run the CoffeeScript test suite.
runTests = (CoffeeScript, options) ->
runTests = (CoffeeScript) ->
startTime = Date.now()
currentFile = null
passedTests = 0
Expand Down Expand Up @@ -205,8 +206,7 @@ runTests = (CoffeeScript, options) ->
# If a stacktrace is available, output the compiled function source.
process.on 'exit', ->
time = ((Date.now() - startTime) / 1000).toFixed(2)
message = "passed #{passedTests} tests in #{time} seconds"

message = "passed #{passedTests} tests in #{time} seconds#{reset}"
return log(message, green) unless failures.length
log "failed #{failures.length} and #{message}", red
for fail in failures
Expand Down Expand Up @@ -234,13 +234,13 @@ runTests = (CoffeeScript, options) ->
return !failures.length


task 'test', 'run the CoffeeScript language test suite', (options) ->
runTests CoffeeScript, options
task 'test', 'run the CoffeeScript language test suite', ->
runTests CoffeeScript


task 'test:browser', 'run the test suite against the merged browser script', (options) ->
task 'test:browser', 'run the test suite against the merged browser script', ->
source = fs.readFileSync 'extras/coffee-script.js', 'utf-8'
result = {}
global.testingBrowser = yes
(-> eval source).call result
runTests result.CoffeeScript, options
runTests result.CoffeeScript

0 comments on commit 0ded5b3

Please sign in to comment.