blob: c7d1364ad539389723d4dd3dff4fd7de1695aba3 [file] [log] [blame]
#!/bin/bash
# Copyright 2016 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
root_out_dir=${1}
target_cpu=${2}
host_cpu=${3}
host_os=${4}
fuchsia_root=$root_out_dir/../..
tools_path=$fuchsia_root/buildtools
cmake=$tools_path/$host_os-$host_cpu/cmake/bin/cmake
build_dir=$root_out_dir/build-vulkancts
caselist_build_dir=$root_out_dir/build-vulkancts/cases-build
caselist_out_dir=$root_out_dir/build-vulkancts/cases
if [[ $target_cpu == "arm64" ]]; then
extra_args="-DFUCHSIA_SYSTEM_PROCESSOR=aarch64 -DDE_CPU=DE_CPU_ARM_64 -DDE_PTR_SIZE=8"
else
extra_args="-DFUCHSIA_SYSTEM_PROCESSOR=x86_64"
fi
fuchsia_lib_path=$root_out_dir/$target_cpu-shared
fuchsia_libfdio=$root_out_dir/gen/zircon/public/lib/fdio/libfdio.so
sysroot=$root_out_dir/sdk/exported/zircon_sysroot/arch/$target_cpu/sysroot
if [ ! -d "$sysroot" ]; then
echo "Can't find sysroot: $sysroot"
exit 1
fi
# Export buildtools' cmake to the scripts below.
export PATH="$PATH:$(dirname $cmake)"
pushd $fuchsia_root/third_party/vulkan-cts
python external/fetch_sources.py
popd
# builds the test executable for the host in order to write out test cases
pushd $fuchsia_root/third_party/vulkan-cts
mkdir -p $caselist_out_dir
mkdir -p $caselist_build_dir
python scripts/build_caselists.py -b $caselist_build_dir -m dEQP-VK $caselist_out_dir
popd
mkdir -p $build_dir
$fuchsia_root/third_party/vulkan-cts/fuchsia/gendepsfile.py $build_dir/vulkan-cts.d $fuchsia_root/third_party/vulkan-cts
pushd $build_dir
$cmake $fuchsia_root/third_party/vulkan-cts -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=$tools_path/ninja -DFUCHSIA_SYSROOT=$sysroot -DCMAKE_TOOLCHAIN_FILE=$fuchsia_root/build/Fuchsia.cmake -DDE_OS=DE_OS_FUCHSIA -DDEQP_TARGET=fuchsia -DFUCHSIA_ROOT=$fuchsia_root -DFUCHSIA_LIB_DIR=$fuchsia_lib_path -DFUCHSIA_LIBFDIO=$fuchsia_libfdio $extra_args
$tools_path/ninja deqp-vk executor execserver
popd