aboutsummaryrefslogtreecommitdiff
path: root/crosperf/crosperf_test.py
blob: 09aefcb6a277e3cb6f5df1af5450016b27a1e3c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/python

# Copyright 2011 Google Inc. All Rights Reserved.

import os
import tempfile
import unittest
import crosperf
from utils.file_utils import FileUtils

EXPERIMENT_FILE_1 = """
  board: x86-alex
  remote: chromeos-alex3

  benchmark: PageCycler {
    iterations: 3
  }

  image1 {
    chromeos_image: /usr/local/google/cros_image1.bin
  }

  image2 {
    chromeos_image: /usr/local/google/cros_image2.bin
  }
  """


class CrosPerfTest(unittest.TestCase):

  def testDryRun(self):
    filehandle, filename = tempfile.mkstemp()
    os.write(filehandle, EXPERIMENT_FILE_1)
    crosperf.Main(['', filename, '--dry_run'])
    os.remove(filename)


if __name__ == '__main__':
  FileUtils.Configure(True)
  unittest.main()