Skip to content
Closed
Show file tree
Hide file tree
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
16 changes: 14 additions & 2 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ CoffeeScript = require './lib/coffee-script'
{spawn, exec} = require 'child_process'
helpers = require './lib/coffee-script/helpers'

require("coffee-coverage/register-istanbul")

# ANSI Terminal Colors.
bold = red = green = reset = ''
unless process.env.NODE_DISABLE_COLORS
Expand Down Expand Up @@ -288,16 +290,26 @@ runTests = (CoffeeScript) ->
for file in files when helpers.isCoffee file
literate = helpers.isLiterate file
currentFile = filename = path.join 'test', file
code = fs.readFileSync filename
#code = fs.readFileSync filename

console.log "start", filename
code = fs.instrumentFile(filename)

try
CoffeeScript.run code.toString(), {filename, literate}
#eval(code)
mainModule = require.main
mainModule._compile code, mainModule.filename
console.log "end", filename
#CoffeeScript.run code.toString(), {filename, literate}
catch error
failures.push {filename, error}
console.log "finish!"
return !failures.length


task 'test', 'run the CoffeeScript language test suite', ->
runTests CoffeeScript
process.exit()


task 'test:browser', 'run the test suite against the merged browser script', ->
Expand Down
9 changes: 8 additions & 1 deletion lib/coffee-script/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
],
"preferGlobal": true,
"scripts": {
"test": "node ./bin/cake test",
"test": "node ./bin/cake test",
"test-harmony": "node --harmony ./bin/cake test"
},
"homepage": "http://coffeescript.org",
Expand All @@ -39,10 +39,12 @@
"url": "git://github.com/jashkenas/coffeescript.git"
},
"devDependencies": {
"uglify-js": "~2.2",
"jison": ">=0.2.0",
"coffee-coverage": "^1.0.1",
"docco": "~0.7.0",
"highlight.js": "~9.6.0",
"underscore": "~1.5.2",
"docco": "~0.7.0"
"istanbul": "^0.4.5",
"jison": ">=0.2.0",
"uglify-js": "~2.2",
"underscore": "~1.5.2"
}
}
7 changes: 7 additions & 0 deletions src/command.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ exports.run = ->

'''
for source in opts.arguments
console.error("hello!")
source = path.resolve source
compilePath source, yes, source

Expand Down Expand Up @@ -189,6 +190,12 @@ compileScript = (file, input, base = null) ->
if o.map
t.output = compiled.js
t.sourceMap = compiled.v3SourceMap
if process.env.COFFEE_BUILD
require("coffee-coverage/register-istanbul")
code = fs.instrumentFile(t.file)
#console.error(code[1..100])
#console.error(t.output[1..100])
t.output = code

CoffeeScript.emit 'success', task
if o.print
Expand Down
Loading