-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCakefile
54 lines (40 loc) · 1.22 KB
/
Cakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{print} = require 'sys'
{spawn} = require 'child_process'
exec = (command, options) ->
options = [options] if not (options instanceof Array)
cmd = spawn command, options
cmd.stdout.on 'data', (data) -> print data.toString()
cmd.stderr.on 'data', (data) -> print data.toString()
brew = (options) ->
exec 'coffee', options
build = (watch) ->
options = ['-c', '-o', 'lib', 'src']
options.unshift '-w' if watch
brew options
test = (suite) ->
exec 'vows', 'test/' + suite
task 'build', 'Compile source code', ->
build()
task 'dev', 'Compile source code (watch)', ->
build(true)
task 'benchmark', 'Benchmarks the library', ->
brew ['test/benchmark.coffee']
task 'test', 'Run all tests', ->
invoke 'test-connection'
invoke 'test-decoder'
invoke 'test-downloader'
invoke 'test-nzb'
invoke 'test-parser'
invoke 'test-pool'
task 'test-connection', 'Run connection tests', ->
test 'connection'
task 'test-decoder', 'Run decoder tests', ->
test 'decoder'
task 'test-downloader', 'Run downloader tests', ->
test 'downloader'
task 'test-nzb', 'Run base library tests', ->
test 'nzb'
task 'test-parser', 'Run parser tests', ->
test 'parser'
task 'test-pool', 'Run pool tests', ->
test 'pool'