smoke.cmake 1.1 KB

12345678910111213141516171819202122
  1. # this is cross-platform smoke script
  2. cmake_minimum_required ( VERSION 3.13 )
  3. set (indexer "${INDEXER}" )
  4. set (searchd "${SEARCHD}")
  5. set (cmpfile "${SRCDIR}/smoke_ref.txt")
  6. set (testcli "${CLI}")
  7. execute_process ( COMMAND ${CMAKE_COMMAND} -E rm -rf ../../test/datat )
  8. execute_process ( COMMAND ${CMAKE_COMMAND} -E make_directory ../../test/datat )
  9. execute_process ( COMMAND ${indexer} -c smoke_test.conf --all OUTPUT_QUIET)
  10. execute_process ( COMMAND ${searchd} -c smoke_test.conf --test OUTPUT_QUIET)
  11. execute_process ( COMMAND ${CMAKE_COMMAND} -E sleep 1 )
  12. execute_process ( COMMAND ${testcli} --smoke --port 10312 OUTPUT_FILE smoke_ref.txt)
  13. execute_process ( COMMAND ${searchd} -c smoke_test.conf --stop OUTPUT_QUIET)
  14. execute_process ( COMMAND ${CMAKE_COMMAND} -E compare_files ${cmpfile} smoke_ref.txt RESULT_VARIABLE res_is_different_from_model )
  15. if ( res_is_different_from_model )
  16. execute_process ( COMMAND diff --unified=3 ${cmpfile} smoke_ref.txt RESULT_VARIABLE difres )
  17. message ( SEND_ERROR "${difres}" )
  18. message ( SEND_ERROR "${cmpfile} does not match smoke_ref.txt!" )
  19. endif ()