1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-27 15:12:30 +02:00

Test windows integration for travis-ci

This commit is contained in:
Guillaume Chatelet 2019-01-15 17:39:44 +01:00
parent 94838120ec
commit 1da4bf25c8
3 changed files with 50 additions and 22 deletions

View File

@ -12,32 +12,42 @@ matrix:
compiler: gcc
env:
TOOLCHAIN=NATIVE
TARGET=native
TARGET=x86_64-linux-gnu
- os: linux
compiler: clang
env:
TOOLCHAIN=NATIVE
TARGET=native
TARGET=x86_64-linux-gnu
- os: osx
compiler: gcc
env:
TOOLCHAIN=NATIVE
TARGET=native
TARGET=x86_64-osx
- os: osx
compiler: clang
env:
TOOLCHAIN=NATIVE
TARGET=native
TARGET=x86_64-osx
- os: windows
compiler: gcc
env:
TOOLCHAIN=NATIVE
TARGET=x86_64-windows
- os: windows
compiler: clang
env:
TOOLCHAIN=NATIVE
TARGET=x86_64-windows
- os: linux-ppc64le
compiler: gcc
env:
TOOLCHAIN=NATIVE
TARGET=native
TARGET=ppc64le-linux-gnu
- os: linux-ppc64le
compiler: clang
env:
TOOLCHAIN=NATIVE
TARGET=native
TARGET=ppc64le-linux-gnu
# Toolchains for little-endian, 64-bit ARMv8 for GNU/Linux systems
- os: linux
env:

View File

@ -75,24 +75,39 @@ function assert_defined(){
}
function integrate() {
cd "${PROJECT_FOLDER}" || exit
cmake -H. -B"${BUILD_DIR}" ${DEFAULT_CMAKE_ARGS} ${CMAKE_ADDITIONAL_ARGS}
cmake --build "${BUILD_DIR}" --target all
cd "${PROJECT_FOLDER}"
case "${OS}" in
"Windows_NT") CMAKE_BUILD_ARGS="--config Debug --target ALL_BUILD"
CMAKE_TEST_ARGS="--config Debug --target RUN_TESTS"
DEMO=${BUILD_DIR}/Debug/list_cpu_features.exe
;;
*) CMAKE_BUILD_ARGS="--target all"
CMAKE_TEST_ARGS="--target test"
DEMO=${BUILD_DIR}/list_cpu_features
;;
esac
if [[ -n "${QEMU_ARCH}" ]]; then
if [[ "${QEMU_ARCH}" == "DISABLED" ]]; then
QEMU="true || "
else
installqemuifneeded
QEMU="${QEMU_INSTALL}/bin/qemu-${QEMU_ARCH} ${QEMU_ARGS}"
fi
else
QEMU=""
# Generating CMake configuration
cmake -H. -B"${BUILD_DIR}" ${DEFAULT_CMAKE_ARGS} ${CMAKE_ADDITIONAL_ARGS}
# Building
cmake --build "${BUILD_DIR}" ${CMAKE_BUILD_ARGS}
# Running tests if needed
if [[ "${QEMU_ARCH}" == "DISABLED" ]]; then
return
fi
if [[ -n "${QEMU_ARCH}" ]]; then
installqemuifneeded
QEMU="${QEMU_INSTALL}/bin/qemu-${QEMU_ARCH} ${QEMU_ARGS}"
for test_binary in ${BUILD_DIR}/test/*_test; do
${QEMU} ${test_binary}
done
${QEMU} ${DEMO}
else
cmake --build "${BUILD_DIR}" ${CMAKE_TEST_ARGS}
${DEMO}
fi
# Run tests
for test_binary in ${BUILD_DIR}/test/*_test; do ${QEMU} ${test_binary}; done
# Run demo program
${QEMU} "${BUILD_DIR}/list_cpu_features"
}
function expand_linaro_config() {

View File

@ -76,6 +76,9 @@ ENVIRONMENTS="
set_mips
"
set -v
set -e
for SET_ENVIRONMENT in ${ENVIRONMENTS}; do
${SET_ENVIRONMENT}
expand_environment_and_integrate