Test RUSTFLAGS addition
This commit is contained in:
parent
9fb7ec9c17
commit
4d945d4291
7
tests/rustflags/main.fmf
Normal file
7
tests/rustflags/main.fmf
Normal file
@ -0,0 +1,7 @@
|
||||
summary: Test that conditional support for RUSTFLAGS works
|
||||
|
||||
require:
|
||||
- redhat-rpm-config
|
||||
- rpm
|
||||
- rust-packaging
|
||||
test: ./runtest.sh
|
22
tests/rustflags/runtest.sh
Executable file
22
tests/rustflags/runtest.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/bash
|
||||
set -e -u -o pipefail
|
||||
|
||||
# Allow for local testing
|
||||
rargs=()
|
||||
if [ -n "${MACROS_PATH:-}" ]; then
|
||||
default_macros_path="$(rpm --showrc | grep 'Macro path' | awk -F ': ' '{print $2}')"
|
||||
rargs+=("--macros" "${default_macros_path}:${MACROS_PATH}")
|
||||
fi
|
||||
|
||||
build_rustflags="$(rpm -E '%{build_rustflags}')"
|
||||
# For good measure
|
||||
[ "${build_rustflags}" != "%{build_rustflags}" ]
|
||||
#
|
||||
flags="$(rpm "${rargs[@]}" -E '%set_build_flags')"
|
||||
|
||||
echo 'Check that RUSTFLAGS is set after evaluating %set_build_flags'
|
||||
(
|
||||
eval "${flags}"
|
||||
# set -u will make this fail if $RUSTFLAGS isn't defined
|
||||
[ "${RUSTFLAGS}" = "${build_rustflags}" ]
|
||||
)
|
Loading…
Reference in New Issue
Block a user