add simple check whether the compiled executable can actually run

This commit is contained in:
Axel Kohlmeyer
2021-03-24 21:51:55 -04:00
parent a772c3b7d2
commit 6d6e2a7920

View File

@ -1,5 +1,14 @@
include(GTest)
# check if we can run the compiled executable and whether it prints
# the LAMMPS version header in the output for an empty input
file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/in.empty)
add_test(NAME RunLammps
COMMAND $<TARGET_FILE:lmp> -log none -echo none -in in.empty
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(RunLammps PROPERTIES
PASS_REGULAR_EXPRESSION "^LAMMPS \\([0-9]+ [A-Za-z]+ 2[0-9][0-9][0-9]\\)")
if(BUILD_MPI)
function(add_mpi_test)
set(MPI_TEST_NUM_PROCS 1)