add performance test
This commit is contained in:
parent
799e6bf61c
commit
dac0a18558
@ -36,7 +36,10 @@ BuildTest =
|
|||||||
Build.spoilerRange[post.board.ID] = posts[0].custom_spoiler
|
Build.spoilerRange[post.board.ID] = posts[0].custom_spoiler
|
||||||
for postData in posts
|
for postData in posts
|
||||||
if postData.no is post.ID
|
if postData.no is post.ID
|
||||||
|
t1 = new Date().getTime()
|
||||||
root = Build.postFromObject postData, post.board.ID
|
root = Build.postFromObject postData, post.board.ID
|
||||||
|
t2 = new Date().getTime()
|
||||||
|
BuildTest.time += t2 - t1
|
||||||
post2 = new Post root, post.thread, post.board
|
post2 = new Post root, post.thread, post.board
|
||||||
x = post.normalizedOriginal
|
x = post.normalizedOriginal
|
||||||
y = post2.normalizedOriginal
|
y = post2.normalizedOriginal
|
||||||
@ -63,13 +66,14 @@ BuildTest =
|
|||||||
|
|
||||||
postsRemaining: 0
|
postsRemaining: 0
|
||||||
postsFailed: 0
|
postsFailed: 0
|
||||||
|
time: 0
|
||||||
|
|
||||||
report: ->
|
report: ->
|
||||||
if BuildTest.postsFailed
|
if BuildTest.postsFailed
|
||||||
new Notice 'warning', "#{BuildTest.postsFailed} post(s) differ", 30
|
new Notice 'warning', "#{BuildTest.postsFailed} post(s) differ (#{BuildTest.time} ms)", 30
|
||||||
else
|
else
|
||||||
new Notice 'success', 'All correct', 5
|
new Notice 'success', "All correct (#{BuildTest.time} ms)", 5
|
||||||
BuildTest.postsFailed = 0
|
BuildTest.postsFailed = BuildTest.time = 0
|
||||||
|
|
||||||
cb:
|
cb:
|
||||||
testOne: ->
|
testOne: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user