Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
98111cdd
Commit
98111cdd
authored
Dec 01, 2009
by
Christopher Bruns
Browse files
Avoid link error with TestNormalModeLangevin by linking to ${SHARED_TARGET} instead of to "OpenMM"
parent
40f67e33
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
8 deletions
+26
-8
plugins/normalModeLangevin/test/CMakeLists.txt
plugins/normalModeLangevin/test/CMakeLists.txt
+4
-6
plugins/normalModeLangevin/test/TestNormalModeLangevin.cpp
plugins/normalModeLangevin/test/TestNormalModeLangevin.cpp
+22
-2
No files found.
plugins/normalModeLangevin/test/CMakeLists.txt
View file @
98111cdd
add_executable
(
TestNormalModeLangevin TestNormalModeLangevin.cpp
)
add_executable
(
TestNormalModeLangevinEXE TestNormalModeLangevin.cpp
)
target_link_libraries
(
TestNormalModeLangevin OpenMM
)
target_link_libraries
(
TestNormalModeLangevinEXE
${
SHARED_TARGET
}
)
add_test
(
TestNormalModeLangevin
${
EXECUTABLE_OUTPUT_PATH
}
/TestNormalModeLangevin
)
set_tests_properties
(
TestNormalModeLangevin PROPERTIES ENVIRONMENT
add_test
(
TestNormalModeLangevin TestNormalModeLangevinEXE
)
"OPENMM_PLUGIN_DIR=
\"
${
LIBRARY_OUTPUT_DIRECTORY
}
\"
"
)
plugins/normalModeLangevin/test/TestNormalModeLangevin.cpp
View file @
98111cdd
...
@@ -2,23 +2,43 @@
...
@@ -2,23 +2,43 @@
#include <vector>
#include <vector>
#include <string>
#include <string>
#include <iostream>
#include <iostream>
#include <cstdlib>
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
void
mysetenv
(
const
char
*
name
,
const
char
*
value
)
{
#ifdef _MSC_VER
char
buffer
[
1000
];
sprintf
(
buffer
,
"%s=%s"
,
name
,
value
);
putenv
(
buffer
);
#else
setenv
(
name
,
value
,
1
);
#endif
}
void
testLoadNMLPlugin
()
void
testLoadNMLPlugin
()
{
{
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
());
string
pluginDir
=
Platform
::
getDefaultPluginsDirectory
();
cout
<<
"Default plugins directory = "
<<
pluginDir
<<
endl
;
Platform
::
loadPluginsFromDirectory
(
pluginDir
);
vector
<
string
>
kernelName
;
vector
<
string
>
kernelName
;
kernelName
.
push_back
(
"IntegrateNMLStepKernel"
);
kernelName
.
push_back
(
"IntegrateNMLStepKernel"
);
// Was NormalModeLangevin plugin loaded?
// Was NormalModeLangevin plugin loaded?
Platform
&
platform
=
Platform
::
findPlatform
(
kernelName
);
// throws if no platform with kernel
Platform
&
platform
=
Platform
::
findPlatform
(
kernelName
);
// throws if no platform with kernel
}
}
int
main
()
int
main
(
int
argc
,
const
char
*
argv
[]
)
{
{
try
try
{
{
if
(
argc
>
1
)
{
const
char
*
plugin_dir
=
argv
[
1
];
// 0 => don't set if variable exists
mysetenv
(
"OPENMM_PLUGIN_DIR"
,
plugin_dir
);
cout
<<
plugin_dir
<<
endl
;
cout
<<
getenv
(
"OPENMM_PLUGIN_DIR"
)
<<
endl
;
}
testLoadNMLPlugin
();
testLoadNMLPlugin
();
cout
<<
"tests passed"
<<
endl
;
cout
<<
"tests passed"
<<
endl
;
return
0
;
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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