-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·51 lines (40 loc) · 1.44 KB
/
Copy pathtest.py
File metadata and controls
executable file
·51 lines (40 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python3
######################################################################################
# Idefix MHD astrophysical code
#
# Source file test.py
#
# Last modified : 09/2026
#
# Copyright(C) by :
# - Sébastien Valat <sebastien.valat@univ-grenoble-alpes.fr> (IPAG/UGA/CNRS - 2026)
# - Clément Robert <clement.robert@univ-grenoble-alpes.fr> (IPAG/UGA/CNRS - 2026)
# and other code contributors
#
# Licensed under CeCILL 2.1 License, see COPYING for more information
######################################################################################
import os
import sys
import pytest
# set IDEFIX_DIR
source_dir = os.path.dirname(__file__)
os.environ["IDEFIX_DIR"] = source_dir
# idefix test class
sys.path.append(source_dir)
from pytools.idfx_test_run import IdexPytestRunner
# should be global so it remember state (last build) and avoids
# to build for each run if we just changed the ini file and run options.
gblIdefixPytestRunner = IdexPytestRunner(__file__)
# if called directly as a script
if __name__ == "__main__" and "--validate-testme-jsons" in sys.argv:
if gblIdefixPytestRunner.validateTestmeJsons():
sys.exit(0)
else:
sys.exit(1)
# define the pytest test
@pytest.mark.parametrize("config", gblIdefixPytestRunner.genTests())
def test_idefix_build_run_check(config):
gblIdefixPytestRunner.run(config)
# if called directly as a script
if __name__ == "__main__":
gblIdefixPytestRunner.main(all=True)