 public var registeredBenchmarks = [TestsUtils.BenchmarkInfo]()
 
 enum TestAction {
-  case Run
-  case ListTests
-  case Fail(String)
+  case run
+  case listTests
+  case fail(String)
 }
 
 struct TestConfig {

func runBenchmarks(_ c: TestConfig) {
  let units = "us"
  print("#\(c.delim)TEST\(c.delim)SAMPLES\(c.delim)MIN(\(units))\(c.delim)MAX(\(units))\(c.delim)MEAN(\(units))\(c.delim)SD(\(units))\(c.delim)MEDIAN(\(units))")
  var SumBenchResults = BenchResults()
  SumBenchResults.sampleCount = 0

  for t in c.tests {
    if !t.run {
      continue
    }
    let BenchIndex = t.index
    let BenchName = t.name
    let BenchFunc = t.f
    let results = runBench(BenchName, BenchFunc, c)
    print("\(BenchIndex)\(c.delim)\(BenchName)\(c.delim)\(results.description)")
    fflush(stdout)

    SumBenchResults.min += results.min
    SumBenchResults.max += results.max
    SumBenchResults.mean += results.mean
    SumBenchResults.sampleCount += 1
    // Don't accumulate SD and Median, as simple sum isn't valid for them.
    // TODO: Compute SD and Median for total results as well.
    // SumBenchResults.sd += results.sd
    // SumBenchResults.median += results.median
  }

  print("")
  print("Totals\(c.delim)\(SumBenchResults.description)")
}

public func main() {
  var config = TestConfig()

  switch (config.processArguments()) {
    case let .Fail(msg):
      // We do this since we need an autoclosure...
      fatalError("\(msg)")
    case .ListTests:
      config.findTestsToRun()
      print("Enabled Tests\(config.delim)Tags")
      for t in config.tests where t.run == true {
        print("\(t.name)\(config.delim)\(t.tags)")
      }
    case .Run:
      config.findTestsToRun()
      printRunInfo(config)
      runBenchmarks(config)

    }

    if let x = benchArgs.optionalArgsMap["--delim"] {
      if x.isEmpty { return .fail("--delim requires a value") }
      delim = x
    }

    if let x = benchArgs.optionalArgsMap["--tags"] {
      if x.isEmpty { return .fail("--tags requires a value") }
      if x.contains("cpubench") {
        tags.insert(.cpubench)
      }
      if x.contains("unstable") {
        tags.insert(.unstable)
      }
      if x.contains("validation") {
        tags.insert(.validation)
      }
      if x.contains("api") {
        tags.insert(.api)
      }
      if x.contains("Array") {
        tags.insert(.Array)
      }
      if x.contains("String") {
        tags.insert(.String)
      }
      if x.contains("Dictionary") {
        tags.insert(.Dictionary)
      }
      if x.contains("Codable") {
        tags.insert(.Codable)
      }
      if x.contains("Set") {
        tags.insert(.Set)
      }
      if x.contains("sdk") {
        tags.insert(.sdk)
      }
      if x.contains("runtime") {
        tags.insert(.runtime)
      }
      if x.contains("refcount") {
        tags.insert(.refcount)
      }
      if x.contains("metadata") {
        tags.insert(.metadata)
      }
      if x.contains("abstraction") {
        tags.insert(.abstraction)
      }
      if x.contains("safetychecks") {
        tags.insert(.safetychecks)
      }
      if x.contains("exceptions") {
        tags.insert(.exceptions)
      }
      if x.contains("bridging") {
        tags.insert(.bridging)
      }
      if x.contains("concurrency") {
        tags.insert(.concurrency)
      }
      if x.contains("algorithm") {
        tags.insert(.algorithm)
      }
      if x.contains("miniapplication") {
        tags.insert(.miniapplication)
      }
      if x.contains("regression") {
        tags.insert(.regression)
      }
    }

