Commit 057e6b70 authored by Guillaume Pasero's avatar Guillaume Pasero

TEST: allow mpi tests run as root (for docker)

parent 62c1de52
......@@ -224,7 +224,7 @@ endfunction()
function(otb_add_test_mpi)
set( _OPTIONS_ARGS )
set( _ONE_VALUE_ARGS NAME NBPROCS COMMAND)
set( _MULTI_VALUE_ARGS )
set( _MULTI_VALUE_ARGS EXTRA_OPT)
cmake_parse_arguments( TEST_MPI "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} )
# Test nb procs
......@@ -235,6 +235,6 @@ function(otb_add_test_mpi)
foreach(arg IN LISTS TEST_MPI_UNPARSED_ARGUMENTS)
list(APPEND ARGS ${arg})
endforeach()
set (test_parameters -np ${TEST_MPI_NBPROCS} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_MPI_COMMAND} ${ARGS})
set (test_parameters -np ${TEST_MPI_NBPROCS} ${TEST_MPI_EXTRA_OPT} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_MPI_COMMAND} ${ARGS})
otb_add_test(NAME ${TEST_MPI_NAME} COMMAND ${MPIEXEC} ${test_parameters})
endfunction()
......@@ -101,7 +101,7 @@ endmacro()
function(otb_add_test_mpi)
set( _OPTIONS_ARGS )
set( _ONE_VALUE_ARGS NAME NBPROCS COMMAND)
set( _MULTI_VALUE_ARGS )
set( _MULTI_VALUE_ARGS EXTRA_OPT)
cmake_parse_arguments( TEST_MPI "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} )
# Test nb procs
......@@ -112,7 +112,7 @@ function(otb_add_test_mpi)
foreach(arg IN LISTS TEST_MPI_UNPARSED_ARGUMENTS)
list(APPEND ARGS ${arg})
endforeach()
set (test_parameters -np ${TEST_MPI_NBPROCS} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_MPI_COMMAND} ${ARGS})
set (test_parameters -np ${TEST_MPI_NBPROCS} ${TEST_MPI_EXTRA_OPT} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_MPI_COMMAND} ${ARGS})
otb_add_test(NAME ${TEST_MPI_NAME} COMMAND ${MPIEXEC} ${test_parameters})
endfunction()
......
......@@ -35,4 +35,5 @@ otb_module_target_label(otbMPIConfigTestDriver)
# MPI Hello test
otb_add_test_mpi(NAME otbMPIConfigTest
NBPROCS 2
EXTRA_OPT --allow-run-as-root
COMMAND otbMPIConfigTestDriver otbMPIConfigTest )
......@@ -37,6 +37,7 @@ otb_module_target_label(otbMPITiffWriterTestDriver)
otb_add_test_mpi(NAME otbMPISPTWReadWriteTest
NBPROCS 2
EXTRA_OPT --allow-run-as-root
COMMAND otbMPITiffWriterTestDriver
--compare-image ${NOTOL}
${INPUTDATA}/ToulouseQuickBird_Extrait_1500_3750.tif
......
......@@ -35,6 +35,7 @@ otb_module_target_label(otbMPIVrtWriterTestDriver)
# MPI Hello test
otb_add_test_mpi(NAME otbMPIVrtWriterTest
NBPROCS 2
EXTRA_OPT --allow-run-as-root
COMMAND otbMPIVrtWriterTestDriver
--compare-image ${NOTOL}
${INPUTDATA}/ToulouseQuickBird_Extrait_1500_3750.tif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment