From 06b55c28f62b77be92f7b04ceadb64073461bd31 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eric=20M=C3=BCller?= <mueller@kip.uni-heidelberg.de>
Date: Fri, 10 Feb 2023 09:59:22 +0100
Subject: [PATCH] BrainScaleS: Add tests

---
 packages/hxtorch/package.py          | 10 ++++++++++
 packages/oppulance/package.py        |  6 ++++++
 packages/pynn-brainscales/package.py | 10 ++++++++++
 3 files changed, 26 insertions(+)

diff --git a/packages/hxtorch/package.py b/packages/hxtorch/package.py
index 240e09ee..efd1b729 100644
--- a/packages/hxtorch/package.py
+++ b/packages/hxtorch/package.py
@@ -166,5 +166,15 @@ class Hxtorch(WafPackage):
 
     def build_args(self):
         args = ['--keep', '--test-execnone', '-v']
+        return args
+
+    def build_test(self):
+        self.waf('install', '--test-execall')
 
+    def install_args(self):
+        args = ['--test-execnone']
         return args
+
+    def install_test(self):
+        with working_dir('spack-test', create=True):
+            python('-c', 'import hxtorch; print(hxtorch.__file__)')
diff --git a/packages/oppulance/package.py b/packages/oppulance/package.py
index 09e39753..697e3e79 100644
--- a/packages/oppulance/package.py
+++ b/packages/oppulance/package.py
@@ -85,3 +85,9 @@ class Oppulance(Package):
         bash('ci/00_build_install_libstdc++.sh')
         mkdirp(spec.prefix)
         install_tree('install/.', spec.prefix)
+
+    @run_after('install')
+    @on_package_attributes(run_tests=True)
+    def check_install(self):
+        ppu_gcc = which('powerpc-ppu-gcc')
+        ppu_gcc('--version')
diff --git a/packages/pynn-brainscales/package.py b/packages/pynn-brainscales/package.py
index d90a7e37..49bb2e59 100644
--- a/packages/pynn-brainscales/package.py
+++ b/packages/pynn-brainscales/package.py
@@ -145,5 +145,15 @@ class PynnBrainscales(WafPackage):
 
     def build_args(self):
         args = ['--keep', '--test-execnone', '-v']
+        return args
+
+    def build_test(self):
+        self.waf('install', '--test-execall')
 
+    def install_args(self):
+        args = ['--test-execnone']
         return args
+
+    def install_test(self):
+        with working_dir('spack-test', create=True):
+            python('-c', 'import pynn_brainscales; print(pynn_brainscales.__file__)')
-- 
GitLab