Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aland, Sebastian
amdis
Commits
ff7943ee
Commit
ff7943ee
authored
Dec 01, 2010
by
Naumann, Andreas
Browse files
added tester, look for testing later
parent
74dc1b04
Changes
10
Hide whitespace changes
Inline
Side-by-side
AMDiS/test/CMakeLists.txt
View file @
ff7943ee
project
(
tests
)
add_subdirectory
(
demoimpl
)
add_subdirectory
(
demotest
)
add_subdirectory
(
datacreation EXCLUDE_FROM_ALL
)
AMDiS/test/datacreation/CMakeLists.txt
View file @
ff7943ee
project
(
testdatacreation
)
include_directories
(
${
AMDiS_SOURCE_DIR
}
)
file
(
GLOB PROJECTFILES src/*Project.cpp
)
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../demoimpl/src
)
file
(
GLOB PROJECTFILES
${
CMAKE_CURRENT_SOURCE_DIR
}
/../demoimpl/src/*Project.cpp
)
set
(
CREATELINE
""
)
foreach
(
projectfile
${
PROJECTFILES
}
)
#create creatorname
get_filename_component
(
CppName
${
projectfile
}
NAME_WE
)
string
(
REPLACE
"Project"
""
creatorsuffix
${
CppName
}
)
set
(
PROJECTINCLUDE
"
${
CppName
}
.h"
)
set
(
PROJECTINCLUDE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../demoimpl/src/
${
CppName
}
.h"
)
set
(
CURRENTPROJECTTYPE
"
${
creatorsuffix
}
demo"
)
string
(
TOLOWER
"
${
creatorsuffix
}
"
creatorsuffix_lower
)
set
(
BASENAME
"
${
creatorsuffix_lower
}
"
)
configure_file
(
src/creator_base.cpp src/creator
${
creatorsuffix
}
.cpp @ONLY
)
add_executable
(
creator
${
creatorsuffix
}
src/creator
${
creatorsuffix
}
.cpp src/ProjectList.cpp
${
projectfile
}
)
add_executable
(
creator
${
creatorsuffix
}
src/creator
${
creatorsuffix
}
.cpp src/ProjectList.cpp
)
target_link_libraries
(
creator
${
creatorsuffix
}
${
AMDiS_LIBS
}
demoimpl
)
file
(
GLOB initfiles RELATIVE
${
CMAKE_CURRENT_BINARY_DIR
}
init/
${
creatorsuffix_lower
}
*.dat*
)
foreach
(
initfile
${
initfiles
}
)
...
...
AMDiS/test/d
emoimpl
/src/ProjectList.cpp
→
AMDiS/test/d
atacreation
/src/ProjectList.cpp
View file @
ff7943ee
...
...
@@ -20,16 +20,3 @@ void write(SolutionInformation& info, std::string filename) {
assert
(
false
);
}
bool
compare
(
SolutionInformation
&
info
,
std
::
string
filename
)
{
if
(
info
.
sysVec
!=
NULL
)
{
assert
(
false
);
}
else
if
(
info
.
dofVec
!=
NULL
)
{
DOFVector
<
double
>
fileVec
(
info
.
dofVec
->
getFeSpace
(),
"fileVec"
);
Mesh
fileMesh
(
""
,
2
);
fileMesh
=
*
(
info
.
dofVec
->
getFeSpace
()
->
getMesh
());
ArhReader
::
read
(
filename
,
&
fileMesh
,
&
fileVec
);
}
else
assert
(
false
);
return
false
;
}
AMDiS/test/d
emoimpl
/src/creator_base.cpp
→
AMDiS/test/d
atacreation
/src/creator_base.cpp
View file @
ff7943ee
...
...
@@ -3,6 +3,7 @@
#include
"@PROJECTINCLUDE@"
typedef
@
CURRENTPROJECTTYPE
@
ProjectType
;
std
::
string
basename
=
"@BASENAME@"
;
void
write
(
SolutionInformation
&
info
,
std
::
string
filename
);
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
<
2
)
{
std
::
cout
<<
" need initfile "
<<
basename
<<
"*
\n
"
;
...
...
AMDiS/test/demoimpl/src/Project.h
View file @
ff7943ee
...
...
@@ -20,8 +20,6 @@ struct SolutionInformation {
};
void
write
(
SolutionInformation
&
,
std
::
string
filename
);
bool
compare
(
SolutionInformation
&
,
std
::
string
filename
);
class
Project
{
public:
virtual
void
create
(
std
::
string
&
)
=
0
;
...
...
AMDiS/test/demotest/CMakeLists.txt
0 → 100644
View file @
ff7943ee
project
(
demotest
)
include_directories
(
${
AMDiS_SOURCE_DIR
}
)
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../demoimpl/src
)
file
(
GLOB PROJECTFILES
${
CMAKE_CURRENT_SOURCE_DIR
}
/../demoimpl/src/*Project.cpp
)
foreach
(
projectfile
${
PROJECTFILES
}
)
#create creatorname
get_filename_component
(
CppName
${
projectfile
}
NAME_WE
)
string
(
REPLACE
"Project"
""
creatorsuffix
${
CppName
}
)
set
(
PROJECTINCLUDE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../demoimpl/src/
${
CppName
}
.h"
)
set
(
CURRENTPROJECTTYPE
"
${
creatorsuffix
}
demo"
)
string
(
TOLOWER
"
${
creatorsuffix
}
"
creatorsuffix_lower
)
set
(
BASENAME
"
${
creatorsuffix_lower
}
"
)
configure_file
(
src/tester_base.cpp src/tester
${
creatorsuffix
}
.cpp @ONLY
)
add_executable
(
tester
${
creatorsuffix
}
src/tester
${
creatorsuffix
}
.cpp src/Comparer.cpp
)
target_link_libraries
(
tester
${
creatorsuffix
}
${
AMDiS_LIBS
}
demoimpl
)
file
(
GLOB initfiles RELATIVE
${
CMAKE_CURRENT_BINARY_DIR
}
init/
${
creatorsuffix_lower
}
*.dat*
)
foreach
(
initfile
${
initfiles
}
)
get_filename_component
(
initfile_ext
${
initfile
}
EXT
)
string
(
REPLACE
".dat."
""
initfile_ext
"
${
initfile_ext
}
"
)
set
(
curoutputdatafile
"../testdata/
${
creatorsuffix_lower
}
_
${
initfile_ext
}
.arh"
)
endforeach
(
initfile
)
endforeach
(
projectfile
)
AMDiS/test/demotest/init
0 → 120000
View file @
ff7943ee
../testdata/init
\ No newline at end of file
AMDiS/test/demotest/macro
0 → 120000
View file @
ff7943ee
../testdata/macro
\ No newline at end of file
AMDiS/test/demotest/src/Comparer.cpp
0 → 100644
View file @
ff7943ee
#include
"Project.h"
#include
"io/ArhReader.h"
bool
compare
(
SolutionInformation
&
info
,
std
::
string
filename
)
{
if
(
info
.
sysVec
!=
NULL
)
{
assert
(
false
);
}
else
if
(
info
.
dofVec
!=
NULL
)
{
DOFVector
<
double
>
fileVec
(
info
.
dofVec
->
getFeSpace
(),
"fileVec"
);
Mesh
fileMesh
(
""
,
2
);
fileMesh
=
*
(
info
.
dofVec
->
getFeSpace
()
->
getMesh
());
ArhReader
::
read
(
filename
,
&
fileMesh
,
&
fileVec
);
DOFVector
<
double
>
nsolvec
(
*
(
info
.
dofVec
));
}
else
assert
(
false
);
return
false
;
}
AMDiS/test/demotest/src/tester_base.cpp
0 → 100644
View file @
ff7943ee
#include
"Parameters.h"
#include
"Project.h"
#include
"@PROJECTINCLUDE@"
bool
compare
(
SolutionInformation
&
info
,
std
::
string
filename
);
typedef
@
CURRENTPROJECTTYPE
@
ProjectType
;
std
::
string
basename
=
"@BASENAME@"
;
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
<
2
)
{
std
::
cout
<<
" need initfile "
<<
basename
<<
"*
\n
"
;
return
1
;
}
if
(
argc
<
3
)
{
std
::
cout
<<
" also need a destination file "
<<
basename
<<
"*
\n
"
;
return
2
;
}
std
::
string
initfile
(
argv
[
1
]);
std
::
string
destinationfile
(
argv
[
2
]);
AMDiS
::
Parameters
::
init
(
false
,
initfile
);
ProjectType
project
;
ProjectInfo
info
(
&
project
,
initfile
,
destinationfile
);
info
.
create
();
SolutionInformation
solinfo
;
info
.
solve
(
solinfo
);
if
(
compare
(
solinfo
,
info
.
getFilename
()))
return
0
;
return
1
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment