Skip to content

Commit

Permalink
Some testing for the llvm_state memcache.
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Biscani authored and Francesco Biscani committed Sep 6, 2023
1 parent a401f8a commit 29475e1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions heyoka/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set(HEYOKA_PY_PYTHON_FILES
_test_scalar_integrator.py
_test_batch_integrator.py
_test_ensemble.py
_test_memcache.py
model/__init__.py
)

Expand Down
22 changes: 22 additions & 0 deletions heyoka/_test_memcache.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2020, 2021, 2022, 2023 Francesco Biscani ([email protected]), Dario Izzo ([email protected])
#
# This file is part of the heyoka.py library.
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


import unittest as _ut


class memcache_test_case(_ut.TestCase):
def test_basic(self):
from . import llvm_state

self.assertTrue(llvm_state.memcache_limit != 0)
self.assertTrue(llvm_state.memcache_size != 0)
llvm_state.clear_memcache()
self.assertTrue(llvm_state.memcache_size == 0)
llvm_state.memcache_limit = 1024*1024*1024
self.assertTrue(llvm_state.memcache_limit == 1024*1024*1024)
2 changes: 2 additions & 0 deletions heyoka/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2912,6 +2912,7 @@ def run_test_suite():
_test_scalar_integrator,
_test_batch_integrator,
_test_ensemble,
_test_memcache,
)
import numpy as np
from .model import nbody
Expand Down Expand Up @@ -2948,6 +2949,7 @@ def run_test_suite():
suite.addTest(tl.loadTestsFromTestCase(event_detection_test_case))
suite.addTest(tl.loadTestsFromTestCase(kepE_test_case))
suite.addTest(tl.loadTestsFromTestCase(sympy_test_case))
suite.addTest(tl.loadTestsFromTestCase(_test_memcache.memcache_test_case))

test_result = _ut.TextTestRunner(verbosity=2).run(suite)

Expand Down

0 comments on commit 29475e1

Please sign in to comment.