title: Is there a way to run a test using XCTest multiple times just with different values?
body: <p>I'm currently working on a project trying to determine the how long different sorting algorithms take to sort different sized arrays. To measure the time, I've decided to use XCTest in Swift Playgrounds since it can automate the process of running the algorithm multiple times and averaging it out. But I have an issue with this method because I have to test a large variety array sizes from 15 elements up to 1500 or so, at 5 element intervals (ie. 15 elements, 20 elements, 25 elements...).</p>
  <p>The only way I've been able to do this with one test is multiple functions with the different size and measuring the performance. Here is a sample of what that looks like:</p>
  <pre><code>class insertionSortPerformanceTest: XCTestCase {
      func testMeasure10() {
          measure {
              _ = insertionSort(arrLen: 10)
          }
      }
      func testMeasure15() {
          measure {
              _ = insertionSort(arrLen: 15)
          }
      }
      func testMeasure20() {
          measure {
              _ = insertionSort(arrLen: 20)
          }
      }
  }
  </code></pre>
  <p><code>insertionSort()</code> works by generating an array of length <code>arrLen</code> and populating it with random numbers.</p>
  <p>Is there a way to automate this process somehow?</p>
  <p>Also, is there a way to take the output in the console and save it as a string so I can parse it for the relevant information later?</p>