| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # coding=utf-8 | 2 # coding=utf-8 |
| 3 # Copyright 2012 The LUCI Authors. All rights reserved. | 3 # Copyright 2012 The LUCI Authors. All rights reserved. |
| 4 # Use of this source code is governed under the Apache License, Version 2.0 | 4 # Use of this source code is governed under the Apache License, Version 2.0 |
| 5 # that can be found in the LICENSE file. | 5 # that can be found in the LICENSE file. |
| 6 | 6 |
| 7 import functools | 7 import functools |
| 8 import json | 8 import json |
| 9 import logging | 9 import logging |
| 10 import os | 10 import os |
| 11 import shutil | 11 import shutil |
| 12 import subprocess | 12 import subprocess |
| 13 import sys | 13 import sys |
| 14 import tempfile | 14 import tempfile |
| 15 import unicodedata | 15 import unicodedata |
| 16 import unittest | 16 import unittest |
| 17 | 17 |
| 18 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 18 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath( |
| 19 __file__.decode(sys.getfilesystemencoding())))) |
| 19 sys.path.insert(0, ROOT_DIR) | 20 sys.path.insert(0, ROOT_DIR) |
| 20 | 21 |
| 21 import trace_inputs | 22 import trace_inputs |
| 22 from third_party.depot_tools import fix_encoding | 23 from third_party.depot_tools import fix_encoding |
| 23 from utils import file_path | 24 from utils import file_path |
| 24 from utils import threading_utils | 25 from utils import threading_utils |
| 25 | 26 |
| 26 | 27 |
| 27 FILENAME = os.path.basename(__file__) | 28 FILENAME = os.path.basename(__file__.decode(sys.getfilesystemencoding())) |
| 28 REL_DATA = os.path.join(u'tests', 'trace_inputs') | 29 REL_DATA = os.path.join(u'tests', 'trace_inputs') |
| 29 VERBOSE = False | 30 VERBOSE = False |
| 30 | 31 |
| 31 # TODO(maruel): Have the kernel tracer on Windows differentiate between file | 32 # TODO(maruel): Have the kernel tracer on Windows differentiate between file |
| 32 # read or file write. | 33 # read or file write. |
| 33 MODE_R = trace_inputs.Results.File.READ if sys.platform != 'win32' else None | 34 MODE_R = trace_inputs.Results.File.READ if sys.platform != 'win32' else None |
| 34 MODE_W = trace_inputs.Results.File.WRITE if sys.platform != 'win32' else None | 35 MODE_W = trace_inputs.Results.File.WRITE if sys.platform != 'win32' else None |
| 35 MODE_T = trace_inputs.Results.File.TOUCHED | 36 MODE_T = trace_inputs.Results.File.TOUCHED |
| 36 | 37 |
| 37 | 38 |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 VERBOSE = '-v' in sys.argv | 728 VERBOSE = '-v' in sys.argv |
| 728 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) | 729 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) |
| 729 if VERBOSE: | 730 if VERBOSE: |
| 730 unittest.TestCase.maxDiff = None | 731 unittest.TestCase.maxDiff = None |
| 731 # Necessary for the dtrace logger to work around execve() hook. See | 732 # Necessary for the dtrace logger to work around execve() hook. See |
| 732 # trace_inputs.py for more details. | 733 # trace_inputs.py for more details. |
| 733 os.environ['TRACE_INPUTS_DTRACE_ENABLE_EXECVE'] = '1' | 734 os.environ['TRACE_INPUTS_DTRACE_ENABLE_EXECVE'] = '1' |
| 734 print >> sys.stderr, 'Test are currently disabled' | 735 print >> sys.stderr, 'Test are currently disabled' |
| 735 sys.exit(0) | 736 sys.exit(0) |
| 736 #unittest.main() | 737 #unittest.main() |
| OLD | NEW |