#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys

config_map = {}

def map_config(source_dir, site_config):
    global config_map
    source_dir = os.path.realpath(source_dir)
    source_dir = os.path.normcase(source_dir)
    site_config = os.path.normpath(site_config)
    config_map[source_dir] = site_config

# Variables configured at build time.
llvm_source_root = "/Users/wangyan/Documents/OCLint/oclint-0.15/llvm"
llvm_obj_root = "/Users/wangyan/Documents/OCLint/oclint-0.15/build/llvm"

# Make sure we can find the lit package.
sys.path.insert(0, os.path.join(llvm_source_root, 'utils', 'lit'))

# Set up some builtin parameters, so that by default the LLVM test suite
# configuration file knows how to find the object tree.
builtin_parameters = { 'build_mode' : "." }


map_config('/Users/wangyan/Documents/OCLint/oclint-0.15/llvm/tools/clang/test/lit.cfg.py', '/Users/wangyan/Documents/OCLint/oclint-0.15/build/llvm/tools/clang/test/lit.site.cfg.py')
map_config('/Users/wangyan/Documents/OCLint/oclint-0.15/llvm/tools/clang/test/Unit/lit.cfg.py', '/Users/wangyan/Documents/OCLint/oclint-0.15/build/llvm/tools/clang/test/Unit/lit.site.cfg.py')
map_config('/Users/wangyan/Documents/OCLint/oclint-0.15/llvm/tools/clang/utils/perf-training/lit.cfg', '/Users/wangyan/Documents/OCLint/oclint-0.15/build/llvm/tools/clang/utils/perf-training/order-files/lit.site.cfg')
map_config('/Users/wangyan/Documents/OCLint/oclint-0.15/llvm/utils/lit/tests/lit.cfg', '/Users/wangyan/Documents/OCLint/oclint-0.15/build/llvm/utils/lit/lit.site.cfg')
map_config('/Users/wangyan/Documents/OCLint/oclint-0.15/llvm/test/lit.cfg.py', '/Users/wangyan/Documents/OCLint/oclint-0.15/build/llvm/test/lit.site.cfg.py')
map_config('/Users/wangyan/Documents/OCLint/oclint-0.15/llvm/test/Unit/lit.cfg.py', '/Users/wangyan/Documents/OCLint/oclint-0.15/build/llvm/test/Unit/lit.site.cfg.py')

builtin_parameters['config_map'] = config_map

if __name__=='__main__':
    from lit.main import main
    main(builtin_parameters)
