# The following tests use input and reference data from the
# $ESPA_UNIT_TEST_DATA_DIR repository.

add_test(do_ledaps_l1_angle_bands ${CMAKE_CURRENT_SOURCE_DIR}/do_ledaps.sh 1
                                  ${CMAKE_CURRENT_SOURCE_DIR}/..)
add_test(do_ledaps_no_l1_angle_bands ${CMAKE_CURRENT_SOURCE_DIR}/do_ledaps.sh 0
                                     ${CMAKE_CURRENT_SOURCE_DIR}/..)
set_property(TEST do_ledaps_l1_angle_bands do_ledaps_no_l1_angle_bands
             PROPERTY ENVIRONMENT
             PATH=${CMAKE_BINARY_DIR}/ledaps/ledapsSrc/src/lndsr:${CMAKE_BINARY_DIR}/ledaps/ledapsSrc/src/lndcal:${CMAKE_BINARY_DIR}/ledaps/ledapsSrc/src/lndpm:${CMAKE_BINARY_DIR}/ledaps/ledapsSrc/src/6sV-1.0B:${CMAKE_CURRENT_SOURCE_DIR}/../../../../scripts:$ENV{PATH})

# Disable the test that creates its own angle bands if the required program
# was not found
if (LANDSAT_ANGLES STREQUAL LANDSAT_ANGLES-NOTFOUND)
    set_tests_properties(do_ledaps_no_l1_angle_bands PROPERTIES DISABLED true)
endif()
