CMakeLists.txt 2.73 KB
Newer Older
Andy Cedilnik's avatar
Andy Cedilnik committed
1
## Copyright 2003 Sandia Coporation
2 3 4 5
## Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
## the U.S. Government retains certain rights in this software.
##
## This source code is released under the New BSD License.
Andy Cedilnik's avatar
Andy Cedilnik committed
6 7
#

8 9 10 11 12 13 14 15 16 17 18
IF (ICET_USE_OPENGL)
  FIND_PACKAGE(GLUT)
  IF (GLUT_FOUND)
    SET(ICET_TESTS_USE_OPENGL 1)
  ENDIF (GLUT_FOUND)
ENDIF (ICET_USE_OPENGL)

IF (NOT ICET_TESTS_USE_OPENGL)
  MESSAGE(STATUS "Most tests require ICET_USE_OPENGL and Glut.  Those tests are disabled.")
ENDIF (NOT ICET_TESTS_USE_OPENGL)

Andy Cedilnik's avatar
Andy Cedilnik committed
19
SET(MyTests
20
  BackgroundCorrect.c
21
  CompressionSize.c
22
  Interlace.c
23
  MaxImageSplit.c
24
  OddImageSizes.c
Kenneth Moreland's avatar
Kenneth Moreland committed
25
  OddProcessCounts.c
26
  RadixkUnitTests.c
27
  SimpleTiming.c
28
  SparseImageCopy.c
29
  )
Andy Cedilnik's avatar
Andy Cedilnik committed
30

31 32 33 34 35 36 37 38 39 40
IF (ICET_TESTS_USE_OPENGL)
  SET(MyTests ${MyTests}
    BlankTiles.c
    BoundsBehindViewer.c
    DisplayNoDraw.c
    RandomTransform.c
    SimpleExample.c
    )
ENDIF (ICET_TESTS_USE_OPENGL)

Andy Cedilnik's avatar
Andy Cedilnik committed
41 42
SET(UTIL_SRCS init.c ppm.c)

43 44 45 46 47 48 49 50 51
CONFIGURE_FILE(
  ${CMAKE_CURRENT_SOURCE_DIR}/test-config.h.in
  ${CMAKE_CURRENT_BINARY_DIR}/test-config.h
  )

INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  )
52

Andy Cedilnik's avatar
Andy Cedilnik committed
53
CREATE_TEST_SOURCELIST(Tests icetTests_mpi.c ${MyTests}
54 55
  EXTRA_INCLUDE mpi_comm.h
  FUNCTION init_mpi_comm)
Andy Cedilnik's avatar
Andy Cedilnik committed
56 57

ADD_EXECUTABLE(icetTests_mpi ${Tests} ${UTIL_SRCS})
58
TARGET_LINK_LIBRARIES(icetTests_mpi
59 60
  IceTCore
  IceTMPI
61
  )
62 63 64 65 66 67 68
IF (ICET_TESTS_USE_OPENGL)
  TARGET_LINK_LIBRARIES(icetTests_mpi
    IceTGL
    ${OPENGL_glu_LIBRARY}
    ${GLUT_LIBRARIES}
    )
ENDIF (ICET_TESTS_USE_OPENGL)
Andy Cedilnik's avatar
Andy Cedilnik committed
69 70

IF (ICET_MPIRUN_EXE)
71
  SET(PRE_TEST_FLAGS ${ICET_MPIRUN_EXE} ${ICET_MPI_NUMPROC_FLAG} ${ICET_MPI_MAX_NUMPROCS} ${ICET_MPI_PREFLAGS})
Andy Cedilnik's avatar
Andy Cedilnik committed
72 73 74
  SET(POST_TEST_FLAGS ${ICET_MPI_POSTFLAGS})
ENDIF (ICET_MPIRUN_EXE)

75
SET(ICET_TEST_FLAGS "" CACHE STRING "Arguments given to the test program.  These are given between the test executable and the name of the test.  Run the test executable with the -h flag to see what is available.")
Andy Cedilnik's avatar
Andy Cedilnik committed
76 77 78 79 80
MARK_AS_ADVANCED(ICET_TEST_FLAGS)
SEPARATE_ARGUMENTS(ICET_TEST_FLAGS)

FOREACH (test ${MyTests})
  GET_FILENAME_COMPONENT(TName ${test} NAME_WE)
81 82
  ADD_TEST(IceT${TName}
    ${PRE_TEST_FLAGS}
83
    ${C_TEST_PATH}/\${CTEST_CONFIGURATION_TYPE}/icetTests_mpi ${ICET_TEST_FLAGS} ${TName}
84
    ${POST_TEST_FLAGS})
85 86 87 88 89 90 91 92 93
  IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.1)
    SET_TESTS_PROPERTIES(IceT${TName}
      PROPERTIES FAIL_REGULAR_EXPRESSION
      ":ERROR:;TEST NOT RUN;TEST NOT PASSED;TEST FAILED"
      )
    SET_TESTS_PROPERTIES(IceT${TName}
      PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed"
      )
  ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.1)
Andy Cedilnik's avatar
Andy Cedilnik committed
94 95 96
ENDFOREACH(test)

IF (WIN32)
Kenneth Moreland's avatar
Kenneth Moreland committed
97
  ADD_CUSTOM_TARGET(logclean erase log.???? *.ppm)
Andy Cedilnik's avatar
Andy Cedilnik committed
98
ELSE (WIN32)
99
  ADD_CUSTOM_TARGET(logclean rm -f log.???? *.ppm core.*)
Andy Cedilnik's avatar
Andy Cedilnik committed
100
ENDIF (WIN32)