[vtk-developers] Single test file used for more than one test?

Biddiscombe, John A. biddisco at cscs.ch
Thu Sep 11 15:00:17 EDT 2014


Does this help


  FOREACH(N 1 2 3 4 8 16 32 64)

    SET(test_name "TestH5PartParallelWriter-P${N}")

      #

      # Serial N==1

      #

      IF (N EQUAL 1)

        ADD_TEST(

          NAME ${test_name}

          COMMAND

            $<TARGET_FILE:TestH5PartParallelWriter>

            -generateParticles 1000000

            -F temp.h5

            -D ${PLUGIN_TEST_DIR}

            -T "${PLUGIN_TEST_DIR}"

            -testName ${test_name}

        )

      ENDIF (N EQUAL 1)

      #

      # Parallel N>1

      #

      IF (N GREATER 1)

        greater_equal(${MPIEXEC_MAX_NUMPROCS} ${N} processors)

        IF (processors)

          ADD_TEST(

          NAME ${test_name}

          COMMAND

            ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${N}

            $<TARGET_FILE:TestH5PartParallelWriter>

            -generateParticles 1000000

            -F temp.h5

            -D ${PLUGIN_TEST_DIR}

            -T "${PLUGIN_TEST_DIR}"

            -testName ${test_name}

        )

        ENDIF (processors)

    ENDIF (N GREATER 1)

  ENDFOREACH(N)


On 11/09/14 17:07, "Cory Quammen" <cory.quammen at kitware.com<mailto:cory.quammen at kitware.com>> wrote:

Hi all,

I'm writing a VTK test that takes some command-line arguments to
control some options in a filter. What I would like to do is define
several tests in the CMakeLists.txt file that run this same code but
which pass different arguments in through argv[].

I haven't found an example of this kind of test in VTK. Most tests are
defined by passing to vtk_add_test_cxx the name of the source file for
the test.

Can anyone point me to an example similar to what I want to do?

Thanks!
Cory
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtk-developers




More information about the vtk-developers mailing list