私はテストが0.5秒より遅く実行されますが、平均時間は単にコンソールに表示され、アクセスする方法が見つからない場合、テストを失敗させたいと思います。このデータにアクセスする方法はありますか?パフォーマンステストが遅すぎると失敗する方法を教えてください。
コード
//Measures the time it takes to parse the participant codes from the first 100 events in our test data.
func testParticipantCodeParsingPerformance()
{
var increment = 0
self.measureBlock
{
increment = 0
while increment < 100
{
Parser.parseParticipantCode(self.fields[increment], hostCodes: MasterCalendarArray.getHostCodeArray()[increment])
increment++
}
}
print("Events measured: \(increment)")
}
テストデータ
[Tests.ParserTest testParticipantCodeParsingPerformance]」測定[時間(秒)]平均:0.203、相対標準偏差:19.951パーセント、値: [0.186405,0.182292,0.179966,0.177797,0.175820,0.205763,0.315636,0.223014,0.200362,0.178165]
これらがうまく働いているが、彼らは唯一の私は私のプロジェクトと他のすべてのユーザーのためのGitを使用しています、私のマシン上でローカルに動作しますベースラインを設定しないでください。このベースラインをgitプロジェクトに含める方法はありますか? – Deco
私はこれを発見しました https://stackoverflow.com/a/46563991/957245 – Deco