MIR_PERFORMANCE_TESTS(1)

✨ mir_performance_tests(1) β€” the Mir Display Server runtime tests, bestie edition ✨

okay so real talk, this is the manual for mir_performance_tests, which lives in the Mir Display Server Runtime Tests section of your friendly neighborhood man pages. she's giving "benchmark but make it Google Test." let's get into it πŸ’…


🌸 NAME 🌸

mir_performance_tests β€” run Mir Display Server performance tests πŸƒβ™€οΈπŸ’¨


πŸ’– DESCRIPTION πŸ’–

bestie, this program is literally a bundle of Mir Display Server tests, and they're all written using Google Test. that's the whole vibe. πŸŽ€

and because Google Test is the icon it is, you get a whole toolbox of command line flags to boss it around with. here's every single one, no gatekeeping:


✨ OPTIONS ✨

πŸ§ͺ Test Selection πŸ§ͺ

like, which tests are we even running today?

  • --gtest_list_tests β€” don't run anything, just spill the names of all the tests. and heads up, a test called TEST(Foo, Bar) shows up as "Foo.Bar". cute, right? 🫢
  • --gtest_filter=POSTIVE_PATTERNS[-NEGATIVE_PATTERNS] β€” only run tests whose name matches one of the positive patterns and none of the negative ones. the wildcard rules are: '?' matches any single character, '*' matches any substring, and ':' separates two patterns. pattern-matching slay πŸ”₯
(and yes, the original really does spell it POSTIVE_PATTERNS β€” not a typo i made, i promise 😭 i keep the facts exactly as they are.)
  • --gtest_also_run_disabled_tests β€” the disabled tests said "not today" but you're saying "yes today" β€” this runs all of them too. πŸ‘‘

πŸƒ Test Execution πŸƒ

how many times, in what order, chaos level: adjustable.

  • --gtest_repeat=[COUNT] β€” run the tests over and over. use a negative count and it literally repeats forever. forever. no cap. ♾️
  • --gtest_shuffle β€” randomize the test order on every single iteration. keeps things spicy 🌢️
  • --gtest_random_seed=[NUMBER] β€” the random number seed used for shuffling test orders. pick a number between 1 and 99999, or use 0 to get a seed based on the current time. ⏰

πŸ“ Test Output πŸ“

the aesthetic of your results, basically.

  • --gtest_color=(yes|no|auto) β€” turn colored output on or off. the default is auto. 🌈
  • --gtest_print_time=0 β€” don't print how long each test took. clock stays quiet 🀫
  • --gtest_output=(json|xml)[:DIRECTORY_PATH/|:FILE_PATH] β€” generate a JSON or XML report, either dropped into the given directory or written to the given file name. and if you don't name the file? FILE_PATH defaults to test_detail.xml. πŸ“„
  • --gtest_stream_result_to=HOST:PORT β€” stream those test results straight to the given server. live feed energy πŸ“‘

πŸ’€ Assertion Behavior πŸ’€

when stuff fails, how dramatic are we being?

  • --gtest_death_test_style=(fast|threadsafe) β€” sets the default death test style. πŸ’€
  • --gtest_break_on_failure β€” turns assertion failures into debugger break-points. very "stop right there" of it πŸ›‘
  • --gtest_throw_on_failure β€” turns assertion failures into C++ exceptions, for when an external test framework is the one catching them. 🎣
  • --gtest_catch_exceptions=0 β€” do not report exceptions as test failures. instead, let them crash the program or throw a pop-up (on Windows). yeah. that's the deal. πŸ™ˆ

πŸ”‘ the environment variable hack πŸ”‘

except for --gtest_list_tests, you can alternatively set the corresponding environment variable of a flag β€” and it's just the flag name with all letters in upper-case. for example, to disable colored text output you can either pass --gtest_color=no or set the GTEST_COLOR environment variable to no. same energy, different door πŸšͺ✨


πŸ“š want more? πŸ“š

for more info, please read the Google Test documentation at https://github.com/google/googletest/. and if you find a bug in Google Test (not one in your own code or tests, bestie, let's be honest 😭), please report it to <googletestframework@googlegroups.com>. they'd love to hear from you 🫢


and that's the whole page!! this version is 1.8.0, dated April 2020, straight from the mir_performance_tests(1) manual β€” thanks for reading my little TED talk, go run some performance tests, and slay πŸ’–βœ¨πŸŽ€πŸ¦‹