     threads: {}
     running: ->
       sum = 0
-      sum += Math.abs(count) for _, count of this.threads
+      sum += count for _, count of this.threads
       sum > 0
     status: ->
       if this.success

mpd = null

results = []
cur_test = null

render = ->
  pass_count = 0

  if not cur_test.running()
    # test is over
    mpd.close()
    runNextTest()
  render()

runNextTest = ->
  if test_index < tests.length
    mpd = new Mpd()
    runTest(tests[test_index++])

$(document).ready ->
  Handlebars.registerHelper 'hash', (context, options) ->
