2014-10-27 12:47:33 +01:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load test_helper
|
|
|
|
export MAKE=make
|
2014-10-28 10:49:09 +01:00
|
|
|
export MAKE_OPTS='-j 2'
|
|
|
|
export -n CFLAGS
|
2014-10-28 18:03:14 +01:00
|
|
|
export -n CC
|
2014-11-17 01:07:39 +01:00
|
|
|
export -n RUBY_CONFIGURE_OPTS
|
2014-10-27 12:47:33 +01:00
|
|
|
|
2014-10-28 10:49:09 +01:00
|
|
|
@test "CC=clang by default on OS X 10.10" {
|
|
|
|
mkdir -p "$INSTALL_ROOT"
|
|
|
|
cd "$INSTALL_ROOT"
|
|
|
|
|
2023-03-06 18:58:00 +01:00
|
|
|
stub_repeated uname '-s : echo Darwin'
|
2014-10-28 10:49:09 +01:00
|
|
|
stub sw_vers '-productVersion : echo 10.10'
|
2023-03-06 18:58:00 +01:00
|
|
|
stub_repeated brew 'false'
|
2023-11-07 01:41:06 +01:00
|
|
|
# shellcheck disable=SC2016
|
|
|
|
stub_repeated make 'echo "make $(inspect_args "$@")" >> build.log'
|
2014-10-28 10:49:09 +01:00
|
|
|
|
|
|
|
cat > ./configure <<CON
|
|
|
|
#!${BASH}
|
2023-11-07 01:41:06 +01:00
|
|
|
echo ./configure "\$@" > build.log
|
|
|
|
echo CC=\$CC >> build.log
|
|
|
|
echo CFLAGS=\${CFLAGS-no} >> build.log
|
2014-10-28 10:49:09 +01:00
|
|
|
CON
|
|
|
|
chmod +x ./configure
|
|
|
|
|
|
|
|
run_inline_definition <<DEF
|
2023-11-24 22:08:28 +01:00
|
|
|
build_package_standard ruby-2.5.0
|
2014-10-28 10:49:09 +01:00
|
|
|
DEF
|
|
|
|
assert_success
|
2023-11-07 01:41:06 +01:00
|
|
|
run cat build.log
|
2014-10-28 10:49:09 +01:00
|
|
|
assert_output <<OUT
|
2023-11-07 12:13:46 +01:00
|
|
|
./configure --prefix=$INSTALL_ROOT --with-ext=openssl,psych,+
|
2014-10-28 10:49:09 +01:00
|
|
|
CC=clang
|
|
|
|
CFLAGS=no
|
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
2023-03-06 18:58:00 +01:00
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub sw_vers
|
|
|
|
unstub brew
|
|
|
|
unstub make
|
2014-10-28 10:49:09 +01:00
|
|
|
}
|