aboutsummaryrefslogtreecommitdiff
path: root/crosperf/experiment_file_unittest.py
diff options
context:
space:
mode:
authorcmtice <cmtice@google.com>2014-06-17 16:30:45 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-03 02:52:12 +0000
commit6367e17c2a01a67fe015f4a94a1cbb30d7958dfc (patch)
treed0ea87db69c375cd75ad6307bca287e54ea2f11e /crosperf/experiment_file_unittest.py
parent4f0309db0ba1f1d927d8c477afe253959180f6a7 (diff)
downloadtoolchain-utils-6367e17c2a01a67fe015f4a94a1cbb30d7958dfc.tar.gz
Adding/updating a few more unittests for Crosperf.
BUG=None Test=Ran all regression tests. Ran 'normal' crosperf. Change-Id: If1dcafee39f10c20c935908c466fbae8fdb23a35 Reviewed-on: https://chrome-internal-review.googlesource.com/166485 Reviewed-by: Han Shen <shenhan@google.com> Commit-Queue: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'crosperf/experiment_file_unittest.py')
-rwxr-xr-xcrosperf/experiment_file_unittest.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/crosperf/experiment_file_unittest.py b/crosperf/experiment_file_unittest.py
index 335a516b..41e4a4c6 100755
--- a/crosperf/experiment_file_unittest.py
+++ b/crosperf/experiment_file_unittest.py
@@ -64,6 +64,23 @@ EXPERIMENT_FILE_3 = """
}
"""
+OUTPUT_FILE="""remote: chromeos-alex3
+board: x86-alex
+perf_args: record -a -e cycles
+
+benchmark: PageCycler {
+\titerations: 3
+}
+
+label: image1 {
+\tremote: chromeos-alex3
+\tchromeos_image: /usr/local/google/cros_image1.bin
+}
+
+label: image2 {
+\tremote: chromeos-lumpy1
+\tchromeos_image: /usr/local/google/cros_image2.bin
+}\n\n"""
class ExperimentFileTest(unittest.TestCase):
def testLoadExperimentFile1(self):
@@ -103,6 +120,11 @@ class ExperimentFileTest(unittest.TestCase):
input_file = StringIO.StringIO(EXPERIMENT_FILE_3)
self.assertRaises(Exception, ExperimentFile, input_file)
+ def testCanonicalize(self):
+ input_file = StringIO.StringIO(EXPERIMENT_FILE_1)
+ experiment_file = ExperimentFile(input_file)
+ res = experiment_file.Canonicalize()
+ self.assertEqual(res, OUTPUT_FILE)
if __name__ == "__main__":
unittest.main()