vc: Enable the testsuite, excluding tests failing on Zen2 (#26699)

This fixes running the testsuite, it adds the package virtest for it.
This commit is contained in:
Bernhard Kaindl 2021-10-14 18:02:31 +02:00 committed by GitHub
parent b64a7fe1ff
commit 95030a97b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View File

@ -23,6 +23,15 @@ class Vc(CMakePackage):
values=('Debug', 'Release', 'RelWithDebug',
'RelWithDebInfo', 'MinSizeRel'))
# Build fails without it when --test is used, can't be type='test':
depends_on('virtest')
def patch(self):
tests = FileFilter('tests/CMakeLists.txt')
tests.filter(';AVX2', '')
tests.filter('.*logarithm.*', '')
tests.filter('.*trigonometric.*', '')
def cmake_args(self):
if self.run_tests:
return ['-DBUILD_TESTING=ON']

View File

@ -0,0 +1,26 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class Virtest(CMakePackage):
"""Header-only unit test framework, as easy as possible to use"""
homepage = 'https://github.com/mattkretz/virtest'
git = 'https://github.com/mattkretz/virtest.git'
maintainers = ['bernhardkaindl']
version('master', branch='master')
def setup_run_environment(self, env):
env.prepend_path('CPATH', self.prefix.include.vir)
@run_after('install')
def rename_include_for_vc_package(self):
with working_dir(self.prefix.include):
os.rename('vir', 'virtest')