Automatic Testing

Currently we have a handful of core printers working correctly, the intention is to make sure they stay working after adding new printers.

This is where testing comes in. before now testing had to be done manually by comparing the result from the gdb console to the expected output. This becomes inconvenient real quick if this is repeated for every class and its output. With manual testing you cannot test if the display_hint strings works correctly and if the index of a list, map or set shown correctly.

I reached out to my mentors Ralf Habacker and Thomas Baumgart, which we decided to use gdb batch argument pipe it to a file and compare. But the problem of testing when the variable is initialized, empty or assigned is still there although possible would take too much testing to get the tester working, we came up with a solution.

Solution

Inspiration for this was gotten from boost tests.

The test steps where

  • Write a script to build the test source code
  • run gdb from the script
  • disable other printers in the system
  • enable the printers to test
  • attach the test script to gdb

this way we can add more or group test without worrying about if the break point changes in the source code.

New Printers

Fixes & Tests

That’s it for now, see you next week.