Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mpp
Mpp
Compare Revisions
a729454428f0f673cba4a05a020e0d2e7fcf2cdf...4ba61c3e68f23dc3e266aaa234320ccace3f0e83
Commits (4)
rmv / and introduced test
· ba4b8b4a
niklas.baumgarten
authored
Mar 24, 2020
ba4b8b4a
updated dir names
· e2b853ed
niklas.baumgarten
authored
Mar 24, 2020
e2b853ed
added test
· 6cc694a0
niklas.baumgarten
authored
Mar 24, 2020
6cc694a0
changed tests inclusion
· 4ba61c3e
niklas.baumgarten
authored
Mar 26, 2020
4ba61c3e
Hide whitespace changes
Inline
Side-by-side
CMakeListsMpp.inc
View file @
4ba61c3e
...
...
@@ -121,7 +121,7 @@ add_subdirectory(${PROJECT_MPP_DIR}/src)
# Tests
if
(
BUILD_TESTS
)
include
(
$
{
PROJECT_MPP_DIR
}
/
tests
/
CMakeLists
.
txt
)
add_subdirectory
(
$
{
PROJECT_MPP_DIR
}
/
tests
/
)
endif
()
#---------------------------------------------------------------------------------------#
python/mppy.py
View file @
4ba61c3e
...
...
@@ -7,13 +7,13 @@ from subprocess import Popen, PIPE
class
Mpp
:
PY_FILE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
MPP_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
PY_FILE_DIR
,
'..'
))
MPP_BUILD_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
MPP_DIR
,
'build'
))
MPP_
ROOT_
DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
PY_FILE_DIR
,
'..'
))
MPP_BUILD_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
MPP_
ROOT_
DIR
,
'build'
))
MPP_LOG_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
MPP_BUILD_DIR
,
'log'
))
MPP_DATA_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
MPP_BUILD_DIR
,
'data'
))
MPP_VTK_DATA_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
MPP_DATA_DIR
,
'vtk'
))
MPP_PY_DATA_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
MPP_DATA_DIR
,
'py'
))
PROJECT_ROOT_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
MPP_DIR
,
'..'
))
PROJECT_ROOT_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
MPP_
ROOT_
DIR
,
'..'
))
PROJECT_BUILD_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
PROJECT_ROOT_DIR
,
'build'
))
PROJECT_LOG_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
PROJECT_BUILD_DIR
,
'log'
))
PROJECT_DATA_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
PROJECT_BUILD_DIR
,
'data'
))
...
...
@@ -32,7 +32,7 @@ class Mpp:
def
check_git_mpp
(
self
):
return
self
.
run_subprocess
([
'git'
,
'ls-remote'
,
self
.
git_mpp_address
],
self
.
MPP_DIR
)
self
.
MPP_
ROOT_
DIR
)
def
git_pull_project
(
self
,
branch
=
'master'
):
rc_project
=
self
.
run_subprocess
([
'git'
,
'pull'
,
'origin'
,
branch
],
...
...
@@ -47,7 +47,7 @@ class Mpp:
def
git_pull_mpp
(
self
,
branch
=
'master'
):
return
self
.
run_subprocess
([
'git'
,
'pull'
,
'origin'
,
branch
],
self
.
MPP_DIR
)
self
.
MPP_
ROOT_
DIR
)
def
run_subprocess
(
self
,
args
,
cwd
):
if
isinstance
(
args
,
list
):
...
...
src/plot/VtuPlot.cpp
View file @
4ba61c3e
...
...
@@ -23,7 +23,7 @@ string VtuPlot::plotLineBreak(int i, int limit, int indent) {
}
void
VtuPlot
::
createVtu
(
const
string
&
filename
)
{
string
filepath
=
Config
::
getDataPath
()
+
string
(
"
/
vtk/"
)
+
filename
+
string
(
".vtu"
);
string
filepath
=
Config
::
getDataPath
()
+
string
(
"vtk/"
)
+
filename
+
string
(
".vtu"
);
ofstream
out
(
filepath
.
c_str
());
// == Header ==
...
...
tests/CMakeLists.txt
View file @
4ba61c3e
# Includes for mpp tests
#---------------------------------------------------------------------------------------#
set
(
TEST_DIR
${
PROJECT_MPP_DIR
}
/tests
)
# Test Executables
add_executable
(
TestShape
${
TEST_DIR
}
/TestShape.cpp
)
add_executable
(
TestQuadrature
${
TEST_DIR
}
/TestQuadrature.cpp
)
add_executable
(
TestCellConstruction
${
TEST_DIR
}
/TestCellConstruction.cpp
)
add_executable
(
TestCellInterface
${
TEST_DIR
}
/TestCellInterface.cpp
)
add_executable
(
TestConfig
${
TEST_DIR
}
/TestConfig.cpp
)
add_executable
(
TestChainConfig
${
TEST_DIR
}
/TestChainConfig.cpp
)
add_executable
(
TestShape TestShape.cpp
)
add_executable
(
TestQuadrature TestQuadrature.cpp
)
add_executable
(
TestCellConstruction TestCellConstruction.cpp
)
add_executable
(
TestCellInterface TestCellInterface.cpp
)
add_executable
(
TestConfig TestConfig.cpp
)
add_executable
(
TestChainConfig TestChainConfig.cpp
)
add_executable
(
TestVtuPlot TestVtuPlot.cpp
)
# Linking
target_link_libraries
(
TestShape SRC LIB_PS
${
SUPERLU
}
${
BLAS_LIBRARIES
}
...
...
@@ -24,4 +23,6 @@ target_link_libraries(TestConfig SRC LIB_PS ${SUPERLU}
${
BLAS_LIBRARIES
}
${
LAPACK_LIBRARIES
}
${
GTEST_LIB
}
)
target_link_libraries
(
TestChainConfig SRC LIB_PS
${
SUPERLU
}
${
BLAS_LIBRARIES
}
${
LAPACK_LIBRARIES
}
${
GTEST_LIB
}
)
target_link_libraries
(
TestVtuPlot SRC LIB_PS
${
SUPERLU
}
${
BLAS_LIBRARIES
}
${
LAPACK_LIBRARIES
}
${
GTEST_LIB
}
)
#---------------------------------------------------------------------------------------#
tests/TestVtuPlot.cpp
0 → 100644
View file @
4ba61c3e
#include "gtest/gtest.h"
#include "plot/VtuPlot.h"
#include <memory>
#include "m++.h"
using
namespace
::
testing
;
class
TestSerialVtuPlot
:
public
::
Test
{
protected:
SerialVtuPlot
*
plot
;
Meshes
*
meshes
;
};
TEST_F
(
TestSerialVtuPlot
,
TestConstructor
)
{
meshes
=
new
Meshes
(
"UnitSquare"
,
0
,
1
);
plot
=
new
SerialVtuPlot
((
*
meshes
)[
0
]);
}
int
main
(
int
argc
,
char
**
argv
)
{
InitGoogleTest
(
&
argc
,
argv
);
Config
::
setSearchPath
(
"../../tests/"
);
Config
::
setConfigFileName
(
"m++.conf"
);
DPO
dpo
(
&
argc
,
argv
);
TestEventListeners
&
listeners
=
UnitTest
::
GetInstance
()
->
listeners
();
if
(
!
PPM
->
master
())
{
delete
listeners
.
Release
(
listeners
.
default_result_printer
());
}
return
RUN_ALL_TESTS
();
}
\ No newline at end of file