hawktracer icon indicating copy to clipboard operation
hawktracer copied to clipboard

Unit tests for chrome trace converter

Open nkhlktn opened this issue 4 years ago • 2 comments

Issue #15

Added unit tests for the chrome trace converter module.

[----------] 9 tests from TestChromeTraceConverter
[ RUN      ] TestChromeTraceConverter.CheckFileAfterOpenButNoEvents
[       OK ] TestChromeTraceConverter.CheckFileAfterOpenButNoEvents (0 ms)
[ RUN      ] TestChromeTraceConverter.CheckWhenEmptyEventProcessed
[       OK ] TestChromeTraceConverter.CheckWhenEmptyEventProcessed (1 ms)
[ RUN      ] TestChromeTraceConverter.CheckWhenOnlyTimeStampAdded
[       OK ] TestChromeTraceConverter.CheckWhenOnlyTimeStampAdded (0 ms)
[ RUN      ] TestChromeTraceConverter.CheckWhenNameTimeStampAdded
[       OK ] TestChromeTraceConverter.CheckWhenNameTimeStampAdded (0 ms)
[ RUN      ] TestChromeTraceConverter.CheckWhenLabelTimeStampAdded
[       OK ] TestChromeTraceConverter.CheckWhenLabelTimeStampAdded (1 ms)
[ RUN      ] TestChromeTraceConverter.CheckWhenNameAndDurationAdded
[       OK ] TestChromeTraceConverter.CheckWhenNameAndDurationAdded (0 ms)
[ RUN      ] TestChromeTraceConverter.CheckWhenLabelAndDurationAdded
[       OK ] TestChromeTraceConverter.CheckWhenLabelAndDurationAdded (1 ms)
[ RUN      ] TestChromeTraceConverter.CheckWithNameAndMultipleArgsAdded
[       OK ] TestChromeTraceConverter.CheckWithNameAndMultipleArgsAdded (0 ms)
[ RUN      ] TestChromeTraceConverter.CheckWithLabelAndMultipleArgsAdded
[       OK ] TestChromeTraceConverter.CheckWithLabelAndMultipleArgsAdded (0 ms)
[----------] 9 tests from TestChromeTraceConverter (4 ms total)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

nkhlktn avatar Nov 04 '20 20:11 nkhlktn

@nikhilkotian22 thanks a lot for the contribution! I noticed that the tests sometimes fail (see CI results). Would you be able to have a look? Thank you

loganek avatar Nov 04 '20 23:11 loganek

@loganek I will fix this. I now realise that arguments are stored in an std::unordered_map and a string comparison therefore will not work. It will be better to do a json parse and compare.

nkhlktn avatar Nov 06 '20 11:11 nkhlktn