-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rm-snakemake' into 'master'
Refactored Snakemake tests into pytest See merge request ogs/ogs!5058
- Loading branch information
Showing
78 changed files
with
571 additions
and
668 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,58 @@ | ||
# wheel: Install into Python module root dir (enables 'import ogs.simulator') | ||
set(_py_install_location ogs) | ||
set(_py_build_location ogs) | ||
if(NOT OGS_BUILD_WHEEL) | ||
set(_py_install_location | ||
"${CMAKE_INSTALL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/ogs" | ||
) | ||
set(_py_build_location "${PROJECT_BINARY_DIR}/site-packages/ogs") | ||
endif() | ||
|
||
add_subdirectory(ogs) | ||
add_subdirectory(ogs.simulator) | ||
add_subdirectory(ogs.mesh) | ||
add_subdirectory(ogs.callbacks) | ||
|
||
if(OGS_USE_PIP) | ||
set_target_properties( | ||
simulator mesh callbacks PROPERTIES LIBRARY_OUTPUT_DIRECTORY | ||
${_py_build_location} | ||
) | ||
file( | ||
COPY ogs/. | ||
DESTINATION ${_py_build_location} | ||
PATTERN "__pycache__" EXCLUDE | ||
PATTERN "CMakeLists.txt" EXCLUDE | ||
) | ||
# Fails with libGitInfoLib.so: undefined symbol: __asan_report_load8 | ||
if(NOT ENABLE_ASAN) | ||
add_test( | ||
NAME pytest | ||
COMMAND | ||
${CMAKE_COMMAND} -DEXECUTABLE=pytest | ||
"-DEXECUTABLE_ARGS=-c;${PROJECT_SOURCE_DIR}/pyproject.toml" # Quoted | ||
# because | ||
# passed as list see https://stackoverflow.com/a/33248574/80480 | ||
-DBINARY_PATH=${_binary_path} | ||
-DWORKING_DIRECTORY=${PROJECT_SOURCE_DIR} | ||
"-DLOG_ROOT=${PROJECT_BINARY_DIR}/logs" | ||
"-DLOG_FILE_BASENAME=pytest.txt" | ||
"-DTEST_COMMAND_IS_EXPECTED_TO_SUCCEED=TRUE" -P | ||
${PROJECT_SOURCE_DIR}/scripts/cmake/test/AddTestWrapper.cmake | ||
) | ||
set_tests_properties( | ||
pytest PROPERTIES LABELS "default;python" COST 10 | ||
) | ||
|
||
add_dependencies( | ||
ctest | ||
GMSH2OGS | ||
Layers2Grid | ||
AddFaultToVoxelGrid | ||
ExtractBoundary | ||
vtkdiff | ||
generateStructuredMesh | ||
) | ||
endif() | ||
|
||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
import importlib.util | ||
import os | ||
|
||
from ._internal.wrap_cli_tools import cli # noqa: F401 | ||
|
||
if "PEP517_BUILD_BACKEND" in os.environ: | ||
# on wheel build config.py is not generated at the beginning of the build | ||
# but later after CMake has run | ||
config_spec = importlib.util.find_spec(".config", package="ogs") | ||
if config_spec is not None: | ||
from .config import * # noqa: F403 | ||
else: | ||
from .config import * # noqa: F403 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.