forked from Colvars/colvars
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add functional tests to script (only config checks so far)
- Loading branch information
1 parent
941c482
commit a4112e8
Showing
83 changed files
with
2,532 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,49 @@ | ||
if(BUILD_TESTS) | ||
|
||
# Build functional tests' executables | ||
add_subdirectory(${COLVARS_SOURCE_DIR}/tests/functional tests/functional) | ||
|
||
if(DEFINED CMAKE_SYSTEM_NAME) | ||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | ||
message(STATUS "Copying input files for tests") | ||
# TODO make this portable outside Linux | ||
add_custom_command(TARGET colvars POST_BUILD | ||
COMMAND bash build_tests.sh | ||
${CMAKE_BINARY_DIR}/tests/functional | ||
WORKING_DIRECTORY ${COLVARS_SOURCE_DIR}/tests) | ||
|
||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
|
||
# TODO automate this step and make it OS-portable | ||
# add_custom_command(TARGET colvars POST_BUILD | ||
# COMMAND bash build_tests.sh | ||
# ${CMAKE_BINARY_DIR}/tests/functional | ||
# WORKING_DIRECTORY ${COLVARS_SOURCE_DIR}/tests) | ||
|
||
# Copy the Colvars configuration files | ||
file(GLOB TEST_CONFIG_FILES ${COLVARS_SOURCE_DIR}/tests/input_files/*/test.in) | ||
foreach(TEST_CONFIG_FILE ${TEST_CONFIG_FILES}) | ||
get_filename_component(TEST_NAME ${TEST_CONFIG_FILE} DIRECTORY) | ||
get_filename_component(TEST_NAME ${TEST_NAME} NAME) | ||
add_custom_command(TARGET colvars POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} | ||
-E copy ${TEST_CONFIG_FILE} | ||
${CMAKE_BINARY_DIR}/tests/functional/${TEST_NAME}/test.in) | ||
add_test(NAME ${TEST_NAME} | ||
COMMAND run_colvars_test ${TEST_NAME}/test.in | ||
WORKING_DIRECTORY | ||
${CMAKE_CURRENT_BINARY_DIR}/tests/functional) | ||
endforeach() | ||
|
||
# Copy other input files (coordinates, index files, etc) | ||
file(GLOB TEST_INPUT_FILES ${COLVARS_SOURCE_DIR}/tests/input_files/*) | ||
message("${TEST_INPUT_FILES}") | ||
foreach(TEST_INPUT_FILE ${TEST_INPUT_FILES}) | ||
add_custom_command(TARGET colvars POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} | ||
-E copy ${TEST_INPUT_FILE} ${CMAKE_BINARY_DIR}/tests/functional) | ||
-E copy ${TEST_INPUT_FILE} | ||
${CMAKE_BINARY_DIR}/tests/functional) | ||
endforeach(TEST_INPUT_FILE) | ||
|
||
endif() | ||
endif() | ||
enable_testing() | ||
endif() | ||
|
||
option(BUILD_UNITTESTS "Build unit tests" ${BUILD_TESTS}) | ||
if(BUILD_UNITTESTS) | ||
# Build unit tests executables | ||
add_subdirectory(${COLVARS_SOURCE_DIR}/tests/unittests tests/unittests) | ||
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
colvarsTrajFrequency 1 | ||
colvarsRestartFrequency 10 | ||
indexFile index.ndx | ||
|
||
colvar { | ||
|
||
name one | ||
|
||
outputAppliedForce on | ||
|
||
width 0.5 | ||
|
||
angle { | ||
group1 { | ||
indexGroup group1 | ||
} | ||
group2 { | ||
indexGroup group2 | ||
} | ||
group3 { | ||
indexGroup group3 | ||
} | ||
} | ||
} | ||
|
||
harmonic { | ||
colvars one | ||
centers 0.1 | ||
forceConstant 0.001 | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/input_files/coordnum-aniso-pairlist_harmonic-fixed/test.in
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
colvarsTrajFrequency 1 | ||
colvarsRestartFrequency 10 | ||
indexFile index.ndx | ||
|
||
colvar { | ||
|
||
name one | ||
outputAppliedForce on | ||
|
||
width 0.5 | ||
|
||
coordNum { | ||
cutoff3 (0.3, 0.6, 0.4) | ||
group1 { | ||
indexGroup group1 | ||
} | ||
group2 { | ||
indexGroup group2 | ||
} | ||
tolerance 0.01 | ||
pairListFrequency 2 | ||
} | ||
} | ||
|
||
harmonic { | ||
colvars one | ||
centers 0.1 | ||
forceConstant 0.001 | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
colvarsTrajFrequency 1 | ||
colvarsRestartFrequency 10 | ||
indexFile index.ndx | ||
|
||
colvar { | ||
|
||
name one | ||
|
||
outputAppliedForce on | ||
|
||
width 0.5 | ||
|
||
coordNum { | ||
cutoff3 (0.3, 0.6, 0.4) | ||
group1 { | ||
indexGroup group1 | ||
} | ||
group2 { | ||
indexGroup group2 | ||
} | ||
} | ||
} | ||
|
||
harmonic { | ||
colvars one | ||
centers 0.1 | ||
forceConstant 0.001 | ||
} |
28 changes: 28 additions & 0 deletions
28
tests/input_files/coordnum-group2centeronly_harmonic-fixed/test.in
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
colvarsTrajFrequency 1 | ||
colvarsRestartFrequency 10 | ||
indexFile index.ndx | ||
|
||
colvar { | ||
|
||
name one | ||
|
||
outputAppliedForce on | ||
|
||
width 0.5 | ||
|
||
coordNum { | ||
group1 { | ||
indexGroup group1 | ||
} | ||
group2 { | ||
indexGroup group2 | ||
} | ||
group2CenterOnly yes | ||
} | ||
} | ||
|
||
harmonic { | ||
colvars one | ||
centers 0.1 | ||
forceConstant 0.001 | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/input_files/coordnum-pairlist_harmonic-fixed/test.in
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
colvarsTrajFrequency 1 | ||
colvarsRestartFrequency 10 | ||
indexFile index.ndx | ||
|
||
colvar { | ||
|
||
name one | ||
|
||
outputAppliedForce on | ||
|
||
width 0.5 | ||
|
||
coordNum { | ||
group1 { | ||
indexGroup group1 | ||
} | ||
group2 { | ||
indexGroup group2 | ||
} | ||
tolerance 0.01 | ||
pairListFrequency 2 | ||
} | ||
} | ||
|
||
harmonic { | ||
colvars one | ||
centers 0.1 | ||
forceConstant 0.001 | ||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
colvarsTrajFrequency 1 | ||
colvarsRestartFrequency 10 | ||
indexFile index.ndx | ||
|
||
colvar { | ||
|
||
name one | ||
|
||
outputAppliedForce on | ||
|
||
width 0.5 | ||
|
||
coordNum { | ||
group1 { | ||
indexGroup group1 | ||
} | ||
group2 { | ||
indexGroup group2 | ||
} | ||
} | ||
} | ||
|
||
harmonic { | ||
colvars one | ||
centers 0.1 | ||
forceConstant 0.001 | ||
} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
colvarsTrajFrequency 1 | ||
colvarsRestartFrequency 10 | ||
indexFile index.ndx | ||
|
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
colvarsTrajFrequency 1 | ||
colvarsRestartFrequency 10 | ||
indexFile index.ndx | ||
|
||
colvar { | ||
|
||
name one | ||
|
||
outputAppliedForce on | ||
|
||
width 0.5 | ||
|
||
dihedral { | ||
group1 { | ||
indexGroup group1 | ||
} | ||
group2 { | ||
indexGroup group2 | ||
} | ||
group3 { | ||
indexGroup group3 | ||
} | ||
group4 { | ||
indexGroup group4 | ||
} | ||
} | ||
} | ||
|
||
harmonic { | ||
colvars one | ||
centers 0.1 | ||
forceConstant 0.001 | ||
} |
36 changes: 36 additions & 0 deletions
36
tests/input_files/dihedral_histogram-customgrid-periodic/test.in
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
colvarsTrajFrequency 1 | ||
colvarsRestartFrequency 10 | ||
indexFile index.ndx | ||
|
||
colvar { | ||
|
||
name one | ||
|
||
outputAppliedForce on | ||
|
||
width 0.5 | ||
|
||
dihedral { | ||
group1 { | ||
indexGroup group1 | ||
} | ||
group2 { | ||
indexGroup group2 | ||
} | ||
group3 { | ||
indexGroup group3 | ||
} | ||
group4 { | ||
indexGroup group4 | ||
} | ||
} | ||
} | ||
|
||
histogram { | ||
colvars one | ||
histogramGrid { | ||
widths 5 | ||
lowerBoundaries -60 | ||
upperBoundaries 300 | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
colvarsTrajFrequency 1 | ||
colvarsRestartFrequency 10 | ||
indexFile index.ndx | ||
|
||
colvar { | ||
|
||
name one | ||
|
||
outputAppliedForce on | ||
|
||
width 0.5 | ||
|
||
dihedral { | ||
group1 { | ||
indexGroup group1 | ||
} | ||
group2 { | ||
indexGroup group2 | ||
} | ||
group3 { | ||
indexGroup group3 | ||
} | ||
group4 { | ||
indexGroup group4 | ||
} | ||
} | ||
} | ||
|
||
harmonicWalls { | ||
colvars one | ||
lowerWalls -10.0 | ||
upperWalls +10.0 | ||
forceConstant 0.001 | ||
} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
colvarsTrajFrequency 1 | ||
colvarsRestartFrequency 10 | ||
indexFile index.ndx | ||
|
||
colvar { | ||
|
||
name one | ||
|
||
outputAppliedForce on | ||
|
||
width 0.5 | ||
|
||
dipoleAngle { | ||
group1 { | ||
indexGroup group1 | ||
} | ||
group2 { | ||
indexGroup group2 | ||
} | ||
group3 { | ||
indexGroup group3 | ||
} | ||
} | ||
} | ||
|
||
harmonic { | ||
colvars one | ||
centers 0.1 | ||
forceConstant 0.001 | ||
} |
Oops, something went wrong.