Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hysop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
particle_methods
hysop
Merge requests
!2
Resolve "Tests"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Tests"
18-tests
into
master
Overview
0
Commits
1
Pipelines
2
Changes
2
Merged
Jean-Baptiste Keck
requested to merge
18-tests
into
master
6 years ago
Overview
0
Commits
1
Pipelines
2
Changes
2
Expand
Closes
#18 (closed)
Edited
6 years ago
by
Jean-Baptiste Keck
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
e831d8ec
1 commit,
6 years ago
2 files
+
15
−
18
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
cmake/hysop_tests.cmake
+
11
−
14
Options
@@ -13,11 +13,17 @@ enable_testing()
find_python_module
(
pytest REQUIRED
)
# === Tests options ===
set
(
pytest_opt
"-v"
CACHE INTERNAL
"extra options for py.test"
)
# Force create data directory for tests event if no tests needs it
# because this will we the working directory for all tests.
file
(
MAKE_DIRECTORY
${
CMAKE_BINARY_DIR
}
/dataForTests
)
# Declaration of python test
# Usage:
# add_python_test(name file)
# with 'name' is the name of the test and file the source
# file for the test.
# Add_python_test(name file) with 'name' is the name of the test
# and file the source file for the test.
macro
(
add_python_test test_name test_file
)
add_test
(
${
test_name
}
py.test
"
${
pytest_opt
}
"
${
test_file
}
)
set_tests_properties
(
${
test_name
}
PROPERTIES FAIL_REGULAR_EXPRESSION
"FAILURE;Exception;[^x]failed;ERROR;Assertion"
)
@@ -45,16 +51,8 @@ endmacro()
# --> set test dir
set
(
testDir
${
HYSOP_BUILD_PYTHONPATH
}
)
# === Tests options ===
if
(
FULL_TEST
)
set
(
pytest_opt
"-s -v -pep8"
CACHE INTERNAL
"extra options for py.test"
)
else
()
set
(
pytest_opt
"-v"
CACHE INTERNAL
"extra options for py.test"
)
endif
()
# === Set the list of all directories which may contain tests ===
set
(
py_src_dirs operator
)
set
(
py_src_dirs
core/arrays fields
operator
)
# === Create the files list from all directories in py_src_dirs ===
@@ -63,7 +61,7 @@ set(py_test_files)
foreach
(
testdir
${
py_src_dirs
}
)
file
(
GLOB testfiles RELATIVE
${
CMAKE_SOURCE_DIR
}
hysop/
${
testdir
}
/tests/test_*.py
)
set
(
py_test_files
${
py_test_files
}
${
testfiles
}
)
# copy data files
# copy data files
required by the tests
file
(
GLOB reffiles hysop/
${
testdir
}
/tests/ref_files/*
)
file
(
COPY
${
reffiles
}
DESTINATION
${
CMAKE_CURRENT_BINARY_DIR
}
/dataForTests
)
endforeach
()
@@ -83,7 +81,6 @@ foreach(testdir ${py_src_dirs})
endforeach
()
endforeach
()
# === Create tests from py_test_files ===
foreach
(
testfile
${
py_test_files
}
)
set
(
execname
${
CMAKE_SOURCE_DIR
}
/
${
testfile
}
)
Loading