##############################################################################
# @file  CMakeLists.txt
# @brief Build configuration of software testing.
#
# Copyright (c) 2012 University of Pennsylvania.
#
# This file is part of DTI-DROID.
#
# DTI-DROID is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DTI-DROID is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with DTI-DROID.  If not, see <http://www.gnu.org/licenses/>.
#
# Contact: SBIA Group <sbia-software at uphs.upenn.edu>
##############################################################################

# ============================================================================
# settings
# ============================================================================

set (INPUT_DIR    "${PROJECT_TESTING_DIR}/input")
set (BASELINE_DIR "${PROJECT_TESTING_DIR}/baseline")

# ============================================================================
# tests
# ============================================================================

# ----------------------------------------------------------------------------
basis_add_test (
  droid_pre_l0
  COMMAND
    basis.testdriver -v
      --compare "pre_warped_l0.nii.gz"
                "${BASELINE_DIR}/pre_warped_l0.nii.gz"
      -- $<TARGET_FILE:dtidroid>
          -p ${TEST_DATA_PATH}/pre_l
          -d ${INPUT_DIR}/pre_subject.hdr
          -t ${INPUT_DIR}/pre_template.hdr
          -p pre_warped_l0
          -o .
          -l 0
)

# ----------------------------------------------------------------------------
basis_add_test (
  droid_pre_l1
  COMMAND
    basis.testdriver -v
      --compare "pre_warped_l1.nii.gz"
                "${BASELINE_DIR}/pre_warped_l1.nii.gz"
      -- $<TARGET_FILE:dtidroid>
          -p ${TEST_DATA_PATH}/pre_l
          -d ${INPUT_DIR}/pre_subject.hdr
          -t ${INPUT_DIR}/pre_template.hdr
          -p pre_warped
          -o .
          -l 1
)

# ----------------------------------------------------------------------------
basis_add_test (
  droid_pre_l2
  COMMAND
    basis.testdriver -v
      --compare ""
                "${BASELINE_DIR}/pre_l2"
      -- $<TARGET_FILE:dtidroid>
          -p ${TEST_DATA_PATH}/pre_l
          -d ${INPUT_DIR}/pre_subject.hdr
          -t ${INPUT_DIR}/pre_template.hdr
          -p pre_warped
          -o .
          -l 2
)
