Beispiel #1
0
def get_debug_flags():
    """Parse the TRACKER_DEBUG environment variable and return flags."""
    global _debug_flags
    if _debug_flags is None:
        flag_tests = GLib.DebugKey()
        flag_tests.key = 'tests'
        flag_tests.value = DEBUG_TESTS

        flag_tests_no_cleanup = GLib.DebugKey()
        flag_tests_no_cleanup.key = 'tests-no-cleanup'
        flag_tests_no_cleanup.value = DEBUG_TESTS_NO_CLEANUP

        flags = [flag_tests, flag_tests_no_cleanup]
        flags_str = os.environ.get('TRACKER_DEBUG', '')

        _debug_flags = GLib.parse_debug_string(flags_str, flags)
    return _debug_flags
Beispiel #2
0
def tests_verbose():
    tracker_debug_tests = GLib.DebugKey()
    tracker_debug_tests.key = "tests"
    tracker_debug_tests.value = TRACKER_DEBUG_TESTS

    flags = GLib.parse_debug_string(os.environ.get('TRACKER_DEBUG', ''),
                                    [tracker_debug_tests])
    return (flags & TRACKER_DEBUG_TESTS)