Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: platform_tools/android/tests/utils.py

Issue 198063002: Updates to Android.mk generation. (Closed) Base URL: https://skia.googlesource.com/skia.git@android_mk
Patch Set: Add a comment explaining the motivation of OrderedSet. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/python
2
3 # Copyright 2014 Google Inc.
4 #
5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file.
7
8 """
9 Common code for tests.
10 """
11 import filecmp
12 import os
13
14 EXPECTATIONS_DIR = os.path.join(os.path.dirname(__file__), 'expectations')
15
16 def compare_to_expectation(actual_name, expectation_name, assert_true,
17 msg=None):
18 """Check that a generated file matches its expectation in EXPECTATIONS_DIR.
19
20 Assert that the generated file and expectation file are identical.
21
22 Args:
23 actual_name: Full path to the test file.
24 expectation_name: Basename of the expectations file within which
25 to compare. The file is expected to be in
26 platform_tools/android/tests/expectations.
27 assert_true: function for asserting a statement is True
28
29 Args:
30 condition: statement to check for True.
31 msg: message to print if the files are not equal.
32
33 msg: Message to pass to assert_true.
34 """
35 full_expectations_path = os.path.join(EXPECTATIONS_DIR, expectation_name)
36 assert_true(filecmp.cmp(actual_name, full_expectations_path), msg)
OLDNEW
« no previous file with comments | « platform_tools/android/tests/ordered_set_tests.py ('k') | platform_tools/android/tests/var_dict_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698