diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index c7f46a7f7b..f5d990d3ed 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -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 $ -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)