Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

98 linhas
1.9 KiB

  1. #!/usr/bin/env bats
  2. load test_helper
  3. export MAKE=make
  4. export MAKE_OPTS='-j 2'
  5. export -n CFLAGS
  6. export -n CC
  7. export -n PYTHON_CONFIGURE_OPTS
  8. @test "require_gcc on OS X 10.9" {
  9. # yyuu/pyenv#222
  10. stub uname '-s : echo Darwin'
  11. stub sw_vers '-productVersion : echo 10.9.5'
  12. stub uname '-s : echo Darwin'
  13. stub sw_vers '-productVersion : echo 10.9.5'
  14. stub gcc '--version : echo 4.2.1'
  15. run_inline_definition <<DEF
  16. require_gcc
  17. echo CC=\$CC
  18. echo MACOSX_DEPLOYMENT_TARGET=\${MACOSX_DEPLOYMENT_TARGET-no}
  19. DEF
  20. assert_success
  21. assert_output <<OUT
  22. CC=${TMP}/bin/gcc
  23. MACOSX_DEPLOYMENT_TARGET=10.9
  24. OUT
  25. }
  26. @test "require_gcc on OS X 10.10" {
  27. # yyuu/pyenv#222
  28. stub uname '-s : echo Darwin'
  29. stub sw_vers '-productVersion : echo 10.10'
  30. stub uname '-s : echo Darwin'
  31. stub sw_vers '-productVersion : echo 10.10'
  32. stub gcc '--version : echo 4.2.1'
  33. run_inline_definition <<DEF
  34. require_gcc
  35. echo CC=\$CC
  36. echo MACOSX_DEPLOYMENT_TARGET=\${MACOSX_DEPLOYMENT_TARGET-no}
  37. DEF
  38. assert_success
  39. assert_output <<OUT
  40. CC=${TMP}/bin/gcc
  41. MACOSX_DEPLOYMENT_TARGET=10.9
  42. OUT
  43. }
  44. @test "require_gcc silences warnings" {
  45. stub gcc '--version : echo warning >&2; echo 4.2.1'
  46. run_inline_definition <<DEF
  47. require_gcc
  48. echo \$CC
  49. DEF
  50. assert_success "${TMP}/bin/gcc"
  51. }
  52. @test "CC=clang by default on OS X 10.10" {
  53. mkdir -p "$INSTALL_ROOT"
  54. cd "$INSTALL_ROOT"
  55. # yyuu/pyenv#222
  56. stub uname '-s : echo Darwin'
  57. stub sw_vers '-productVersion : echo 10.10'
  58. stub uname '-s : echo Darwin'
  59. stub sw_vers '-productVersion : echo 10.10'
  60. stub cc 'false'
  61. stub brew 'false'
  62. stub make \
  63. 'echo make $@' \
  64. 'echo make $@'
  65. cat > ./configure <<CON
  66. #!${BASH}
  67. echo ./configure "\$@"
  68. echo CC=\$CC
  69. echo CFLAGS=\${CFLAGS-no}
  70. CON
  71. chmod +x ./configure
  72. run_inline_definition <<DEF
  73. exec 4<&1
  74. build_package_standard python
  75. DEF
  76. assert_success
  77. assert_output <<OUT
  78. ./configure --prefix=$INSTALL_ROOT --libdir=${TMP}/install/lib
  79. CC=clang
  80. CFLAGS=no
  81. make -j 2
  82. make install
  83. OUT
  84. }