Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-10754

Improve testutil_system() and use it instead of system() in tests

    • Storage Engines
    • 3
    • 2024-01-09 - I Grew Tired

      Summary

      WT-10626 introduced a new function called testutil_system(), which simplifies lines such as:

          char buf[4096];
          testutil_check(__wt_snprintf(buf, sizeof(buf), ...));
          testutil_check(system(buf));
      

      into a single statement. We should be using this convenience function in other tests as well.

      We might also want to consider turning testutil_system() into a macro, so that when a assertion gets triggered, the error output mentions the line on which testutil_system() was called instead of just the line within testutil_system() that failed.

      Acceptance criteria

      The remaining tests that use the system() function directly should use the new convenience function for simplicity and consistency. When the call fails, the stderr output should ideally mention the line in the test where we failed, not a line within testutil_system() itself.

            Assignee:
            adeline.chen@mongodb.com Adeline Chen (Inactive)
            Reporter:
            peter.macko@mongodb.com Peter Macko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: