Commit 2c71fe9a authored by DIAZ Jerome's avatar DIAZ Jerome Committed by GILLES Sebastien
Browse files

#1489 Make a script for the CI test and extend it to Elasticity from ModelInstances.

parent fe82fda5
......@@ -2,12 +2,12 @@ valgrind:
stage: analysis
image: registry.gitlab.inria.fr/morefem/analysistools/valgrind:latest
script:
- export MOREFEM_ROOT=${PWD}
- mkdir -p build_4_valgrind
- cd build_4_valgrind && python ../cmake/Scripts/configure_cmake.py --cache_file=../cmake/PreCache/linux.cmake --cmake_args="-G Ninja" --third_party_directory=/opt --mode="debug"
- ninja
- valgrind --error-exitcode=1 --log-file=memcheck_matrix_operations.txt --gen-suppressions=all --show-leak-kinds=all --show-reachable=yes --track-origins=yes --leak-check=full --errors-for-leak-kinds=all --suppressions=../ExternalTools/Valgrind/openmpi.suppr --suppressions=../ExternalTools/Valgrind/libgomp.suppr --suppressions=../ExternalTools/Valgrind/libc.suppr Sources/MoReFEMTestPetscMatrixOperations -i ../Sources/Test/ThirdParty/PETSc/MatrixOperations/demo.lua -e MOREFEM_RESULT_DIR=${PWD}
- echo $MOREFEM_RESULT_DIR
- Scripts/Tools/run_valgrind.sh
# - export MOREFEM_ROOT=${PWD}
# - mkdir -p build_4_valgrind
# - cd build_4_valgrind && python ../cmake/Scripts/configure_cmake.py --cache_file=../cmake/PreCache/linux.cmake --cmake_args="-G Ninja" --third_party_directory=/opt --mode="debug"
# - ninja
# - valgrind --error-exitcode=1 --log-file=memcheck_matrix_operations.txt --gen-suppressions=all --show-leak-kinds=all --show-reachable=yes --track-origins=yes --leak-check=full --errors-for-leak-kinds=all --suppressions=../ExternalTools/Valgrind/openmpi.suppr --suppressions=../ExternalTools/Valgrind/libgomp.suppr --suppressions=../ExternalTools/Valgrind/libc.suppr Sources/MoReFEMTestPetscMatrixOperations -i ../Sources/Test/ThirdParty/PETSc/MatrixOperations/demo.lua -e MOREFEM_RESULT_DIR=${PWD}
dependencies: []
artifacts:
name: "artifact_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-valgrind"
......@@ -15,6 +15,7 @@ valgrind:
when: always
paths:
- build_4_valgrind/memcheck_matrix_operations.txt
- build_4_valgrind/memcheck_elasticity.txt
# only:
# - develop@morefem/corelibrary/morefem
# - /(sonarqube)/
......
import os
import sys
import shutil
import subprocess
if __name__ == "__main__":
morefem_source_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "Sources")
build_dir = os.path.join(morefem_source_dir, "..", "build_4_valgrind")
if os.path.exists(build_dir):
shutil.rmtree(build_dir)
os.mkdir(build_dir)
os.chdir(build_dir)
cmd = ( "python", \
"../cmake/Scripts/configure_cmake.py", \
"--cache_file=../cmake/PreCache/linux.cmake", \
"--cmake_args=\"-G Ninja\"", \
"--install_directory=/opt")
subprocess.Popen(cmd, shell = False).communicate()
cmd = "ninja"
subprocess.Popen(cmd, shell = True).communicate()
# executables_dir = os.path.join(build_dir, "Sources")
#
# os.chdir(executables_dir)
cmd = "valgrind --error-exitcode=1 --log-file=memcheck_matrix_operations.txt --gen-suppressions=all --show-leak-kinds=all --show-reachable=yes --track-origins=yes --leak-check=full --suppressions=${HOME}/Codes/MoReFEM/CoreLibrary/ExternalTools/Valgrind/openmpi.suppr --suppressions=${HOME}/Codes/MoReFEM/CoreLibrary/ExternalTools/Valgrind/libgomp.suppr --suppressions=${HOME}/Codes/MoReFEM/CoreLibrary/ExternalTools/Valgrind/libc.suppr Sources/MoReFEMTestPetscMatrixOperations -i ${HOME}/Codes/MoReFEM/CoreLibrary/Sources/Test/ThirdParty/PETSc/MatrixOperations/demo.lua "
subprocess.Popen(cmd, shell = True).communicate()
#!/bin/bash
# Assumes current path is MOREFEM_ROOT/build
# arg1: executable, arg2: lua input, arg3: memcheck_output_file
function runValgrind()
{
valgrind --error-exitcode=1 --log-file=$3 --gen-suppressions=all --show-leak-kinds=all --show-reachable=yes --track-origins=yes --leak-check=full --errors-for-leak-kinds=all --suppressions=../ExternalTools/Valgrind/openmpi.suppr --suppressions=../ExternalTools/Valgrind/libgomp.suppr --suppressions=../ExternalTools/Valgrind/libc.suppr $1 -i $2 -e MOREFEM_RESULT_DIR=${PWD}
}
export MOREFEM_ROOT=${PWD}
mkdir -p build_4_valgrind
cd build_4_valgrind && python ../cmake/Scripts/configure_cmake.py --cache_file=../cmake/PreCache/linux.cmake --cmake_args="-G Ninja" --third_party_directory=/opt --mode="debug"
ninja
runValgrind Sources/MoReFEMTestPetscMatrixOperations ../Sources/Test/ThirdParty/PETSc/MatrixOperations/demo.lua memcheck_matrix_operations.txt
runValgrind Sources/MoReFEM4Elasticity ../Sources/ModelInstances/Elasticity/demo_2d_binary.lua memcheck_elasticity.txt
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment