From d8a72b68ddcc0fcd5861e0648d0412bba7828873 Mon Sep 17 00:00:00 2001 From: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Date: Thu, 11 May 2023 05:39:09 -0700 Subject: bricks: convert to new stand-alone test process (#35694) --- var/spack/repos/builtin/packages/bricks/package.py | 34 +++++++++------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/var/spack/repos/builtin/packages/bricks/package.py b/var/spack/repos/builtin/packages/bricks/package.py index d20d9f170f..be5023304e 100644 --- a/var/spack/repos/builtin/packages/bricks/package.py +++ b/var/spack/repos/builtin/packages/bricks/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack.package import * @@ -71,25 +73,17 @@ class Bricks(CMakePackage): ] self.cache_extra_test_sources(srcs) - def test(self): - """Test bricklib package""" - # Test prebuilt binary + def test_bricklib_example(self): + """build and run pre-built example""" source_dir = join_path(self.test_suite.current_test_cache_dir, "examples", "external") + if not os.path.exists(source_dir): + raise SkipTest("{0} is missing".format(source_dir)) + + with working_dir(source_dir): + cmake = which(self.spec["cmake"].prefix.bin.cmake) + cmake(".") + + cmake("--build", ".") - self.run_test( - exe="cmake", options=["."], purpose="Configure bricklib example", work_dir=source_dir - ) - - self.run_test( - exe="cmake", - options=["--build", "."], - purpose="Build bricklib example", - work_dir=source_dir, - ) - - self.run_test( - exe=join_path(source_dir, "example"), - options=[], - purpose="Execute bricklib example", - work_dir=source_dir, - ) + example = which("example") + example() -- cgit v1.2.3-70-g09d2