Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3692de49 authored by hhakim's avatar hhakim
Browse files

Add pyfaust.tests module (old tests pyfaust_simple_test.py) and integrate it...

Add pyfaust.tests module (old tests pyfaust_simple_test.py) and integrate it in the release pip package tests of gitlab ci.
parent fee124aa
No related branches found
No related tags found
No related merge requests found
Pipeline #834000 skipped
......@@ -491,6 +491,7 @@ test_macos_pkg_release:
- echo $MACOS_PASS | sudo -S installer -pkg build/faust-$CI_COMMIT_TAG.pkg -target /
- matlab -nojvm -nodisplay -r "disp(matfaust.version());disp(full(matfaust.rand(5,5))); exit;"
- python -c "import pyfaust; print(pyfaust.version()); print(pyfaust.rand(5,5).toarray());"
- python -c "import pyfaust.tests; pyfaust.tests.run_tests('cpu', 'real')"
only:
- tags
tags:
......@@ -504,6 +505,7 @@ test_macos_pkg_release:
- source test_pyfaust-$CI_COMMIT_TAG/bin/activate
- pip install build/wrapper/python/dist/pyfaust-$CI_COMMIT_TAG-*.whl
- $JOB_PYTHON -c "import pyfaust; print(pyfaust.version()); print(pyfaust.rand(5,5).toarray());"
- $JOB_PYTHON -c "import pyfaust.tests; pyfaust.tests.run_tests('cpu', 'real')"
only:
- tags
......@@ -537,6 +539,7 @@ test_win_purepy_pkg:
- 'call test_pyfaust-%CI_COMMIT_TAG%\Scripts\activate'
- 'pip install %PKG_NAME%'
- '%JOB_PYTHON% -c "import pyfaust; print(pyfaust.version()); print(pyfaust.rand(5,5).toarray());"'
- '%JOB_PYTHON% -c "import pyfaust.tests; pyfaust.tests.run_tests(\"cpu\", \"real\")"'
needs:
- job: pkg_win_purepy_release
artifacts: true
......
import sys
import unittest
from pyfaust import (rand as frand, Faust, vstack, hstack, isFaust, dot,
concatenate, pinv, eye, dft, wht)
concatenate, pinv, eye, dft, wht, is_gpu_mod_enabled)
from numpy.random import randint
import numpy as np
from scipy.sparse import csr_matrix
......@@ -323,7 +323,9 @@ class PyfaustSimpleTest(unittest.TestCase):
def test_optimize_time(self):
print("Faust.optimize_time")
if dev == 'cpu':
# test only if CPU and no gpu_mod enabled
# anyway the method is not yet implemented for GPU
if dev == 'cpu' and not is_gpu_mod_enabled():
oF = self.F.optimize_time()
self._assertAlmostEqual(oF, self.F)
......@@ -386,6 +388,15 @@ class PyfaustSimpleTest(unittest.TestCase):
np.eye(self.nrows,
self.ncols))
def run_tests(_dev, _field):
global dev, field
dev = _dev
field = _field
suite = unittest.makeSuite(PyfaustSimpleTest, 'test')
runner = unittest.TextTestRunner()
runner.run(suite)
if __name__ == "__main__":
nargs = len(sys.argv)
if(nargs > 1):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment