From 227d6a2049833f1f1c59a6a84507c322c1f83106 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 27 Jun 2014 20:42:37 -0700 Subject: [PATCH] BuildTest: show notification of results --- src/General/BuildTest.coffee | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/General/BuildTest.coffee b/src/General/BuildTest.coffee index b8af0f17b..1bb43b1f7 100644 --- a/src/General/BuildTest.coffee +++ b/src/General/BuildTest.coffee @@ -30,6 +30,7 @@ BuildTest = return [x2, y2] runTest: (post) -> + BuildTest.postsRemaining++ $.cache "//a.4cdn.org/#{post.board.ID}/thread/#{post.thread.ID}.json", -> {posts} = @response Build.spoilerRange[post.board.ID] = posts[0].custom_spoiler @@ -43,14 +44,27 @@ BuildTest = c.log "#{post.fullID} correct" else c.log "#{post.fullID} differs" + BuildTest.postsFailed++ [x2, y2] = BuildTest.firstDiff x, y c.log x2 c.log y2 c.log x.outerHTML c.log y.outerHTML + BuildTest.postsRemaining-- + BuildTest.report() if BuildTest.postsRemaining is 0 post2.isFetchedQuote = true Main.callbackNodes Post, [post2] + postsRemaining: 0 + postsFailed: 0 + + report: -> + if BuildTest.postsFailed + new Notice 'warning', "#{BuildTest.postsFailed} post(s) differ", 30 + else + new Notice 'success', 'All correct', 5 + BuildTest.postsFailed = 0 + testOne: -> BuildTest.runTest g.posts[@dataset.fullID] Menu.menu.close()