lit.cfg 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # -*- Python -*-
  2. #
  3. # Copyright (C) 2012 The Android Open Source Project
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. #
  18. ### Configuration file for target side debugger integration tests
  19. #
  20. # Parameters available through lit --param options:
  21. # android_sdk - Path to the android SDK directory
  22. # sdk_version - SDK target to pass to 'android' for creating test projects
  23. # minimum_sdk - SDK minimum version to embed in AndroidManifest.xml
  24. # If the user is running an individual tests directory, we have to load
  25. # the libbcc site configuration first
  26. build_top = getattr(config, 'build_top', None)
  27. if build_top is None:
  28. lit.load_config(config, os.path.join(os.getenv('ANDROID_BUILD_TOP',
  29. '../../../../../'), 'frameworks', 'compile', 'libbcc', 'tests',
  30. 'debuginfo', 'lit.site.cfg'))
  31. build_top = config.build_top
  32. # Default SDK path and version
  33. default_sdk_dir = os.path.join(config.base_build_path, 'sdk', 'android-sdk_' \
  34. + os.getenv('TARGET_BUILD_VARIANT') + '.' \
  35. + os.getenv('USER') + '_linux-x86')
  36. default_sdk_version = "android-JellyBean"
  37. default_minimum_sdk = "JellyBean"
  38. # Set up the suite name, extensions that are recognized as testcases, and
  39. # the target triple string that must be used in cases marked expected failures
  40. config.name = 'target_renderscript_debug'
  41. config.suffixes = ['.rs']
  42. config.target_triple = 'target-bcc'
  43. # Output directory in the android source tree
  44. if os.getenv('TARGET_BUILD_TYPE', None) == 'debug':
  45. config.test_exec_root = os.path.join(config.build_top, 'out', 'debug',
  46. 'target', 'tests', 'rsdebug')
  47. else:
  48. config.test_exec_root = os.path.join(config.build_top, 'out', 'target',
  49. 'tests', 'rsdebug')
  50. #
  51. ## Set up SDK path and version
  52. #
  53. config.sdk_dir = lit.params.get('android_sdk', default_sdk_dir)
  54. if not os.path.isdir(config.sdk_dir):
  55. lit.fatal("Android SDK directory " + config.sdk_dir + " does " \
  56. + "not exist. Check --param android_sdk=<path> lit parameter in test " \
  57. + "suite invocation.")
  58. config.sdk_version = lit.params.get('sdk_version', default_sdk_version)
  59. config.minimum_sdk = lit.params.get('minimum_sdk', default_minimum_sdk)
  60. #
  61. ## Set up environment variables
  62. #
  63. # Propagate ANDROID_PRODUCT_OUT to child environment
  64. config.environment['ANDROID_PRODUCT_OUT'] = os.getenv('ANDROID_PRODUCT_OUT')
  65. config.environment['ANDROID_BUILD_TOP'] = os.getenv('ANDROID_BUILD_TOP')
  66. config.environment['DEBUGGER'] = config.gdb
  67. config.environment['DEBUGGER_ARGS'] = "-d " + config.gdb_plugin_directory + ' '
  68. if not lit.quiet:
  69. lit.note('using Android SDK: %r' % config.sdk_dir)
  70. lit.note('using Android SDK Version: %r' % config.sdk_version)
  71. lit.note('using test apk builder: %r' % config.build_test_apk)
  72. lit.note('using GDB plugin directory: %r' % config.gdb_plugin_directory)
  73. # Apply target-side test macro substitutions
  74. config.substitutions.append( ('%build_test_apk_opts', ' --sdk ' + config.sdk_dir \
  75. + ' --target ' + config.sdk_version \
  76. + ' --minsdk ' + config.minimum_sdk))
  77. config.substitutions.append( ('%build_test_apk', ' ' + config.sh \
  78. + ' ' + config.build_test_apk + ' '))