main.swift 799 B

123456789101112131415161718192021222324
  1. // Performance/main.swift - Performance harness entry point
  2. //
  3. // Copyright (c) 2014 - 2016 Apple Inc. and the project authors
  4. // Licensed under Apache License v2.0 with Runtime Library Exception
  5. //
  6. // See LICENSE.txt for license information:
  7. // https://github.com/apple/swift-protobuf/blob/main/LICENSE.txt
  8. //
  9. // -----------------------------------------------------------------------------
  10. ///
  11. /// Entry point that creates the performance harness and runs it.
  12. ///
  13. // -----------------------------------------------------------------------------
  14. import Foundation
  15. let args = CommandLine.arguments
  16. let resultsFile = args.count > 1 ? FileHandle(forWritingAtPath: args[1]) : nil
  17. resultsFile?.seekToEndOfFile()
  18. let harness = Harness(resultsFile: resultsFile)
  19. harness.run()
  20. resultsFile?.closeFile()