llvm-lit.in 893 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import os
  4. import sys
  5. config_map = {}
  6. def map_config(source_dir, site_config):
  7. global config_map
  8. source_dir = os.path.realpath(source_dir)
  9. source_dir = os.path.normcase(source_dir)
  10. site_config = os.path.normpath(site_config)
  11. config_map[source_dir] = site_config
  12. # Variables configured at build time.
  13. llvm_source_root = "@LLVM_SOURCE_DIR@"
  14. llvm_obj_root = "@LLVM_BINARY_DIR@"
  15. # Make sure we can find the lit package.
  16. sys.path.insert(0, os.path.join(llvm_source_root, 'utils', 'lit'))
  17. # Set up some builtin parameters, so that by default the LLVM test suite
  18. # configuration file knows how to find the object tree.
  19. builtin_parameters = { 'build_mode' : "@BUILD_MODE@" }
  20. @LLVM_LIT_CONFIG_MAP@
  21. builtin_parameters['config_map'] = config_map
  22. if __name__=='__main__':
  23. from lit.main import main
  24. main(builtin_parameters)