Commit 27b112e4 authored by Duncan Macleod's avatar Duncan Macleod
Browse files

Merge branch 'Weave-robust-tests' into 'master'

Run Weave tests under Conda

Closes CW/software/lalsuite#71

See merge request lscsoft/lalsuite!1334
parents 5785f31a 28e1d124
......@@ -22,7 +22,7 @@ ${SRC_DIR}/configure \
make -j ${CPU_COUNT}
# check
make -j ${CPU_COUNT} VERBOSE=1 check SKIP_TESTS_THAT_FAIL_UNDER_CONDA=1
make -j ${CPU_COUNT} VERBOSE=1 check
# install
make -j ${CPU_COUNT} install
......@@ -61,6 +61,7 @@ lalapps_WeaveCompare_SOURCES = \
test_scripts += testWeave_interpolating.sh
test_scripts += testWeave_non_interpolating.sh
test_scripts += testWeave_single_segment.sh
test_scripts += testWeave_reference_results.sh
test_scripts += testWeave_simulate_search.sh
test_scripts += testWeave_cache_max_size.sh
test_scripts += testWeave_checkpointing.sh
......@@ -73,3 +74,6 @@ test_helpers +=
if !CFITSIO
skip_tests += $(test_scripts)
endif
# testWeave_reference_results.sh requires output from tests that compare against reference results
testWeave_reference_results.log: testWeave_interpolating.log testWeave_non_interpolating.log testWeave_single_segment.log
......@@ -513,7 +513,7 @@ int compare_templates(
XLAL_CHECK( equal != NULL, XLAL_EINVAL );
XLAL_CHECK( loc_str != NULL, XLAL_EINVAL );
XLAL_CHECK( tmpl_str != NULL, XLAL_EINVAL );
XLAL_CHECK( param_tol_mism >= 0, XLAL_EINVAL );
XLAL_CHECK( param_tol_mism > 0, XLAL_EINVAL );
XLAL_CHECK( metric != NULL, XLAL_EFAULT );
XLAL_CHECK( rssky_transf != NULL, XLAL_EFAULT );
XLAL_CHECK( phys_1 != NULL, XLAL_EFAULT );
......@@ -990,7 +990,7 @@ int XLALWeaveResultsToplistCompare(
}
// Compare semicoherent template parameters
{
if ( param_tol_mism > 0 ) {
snprintf( loc_str, sizeof( loc_str ), "toplist item %zu", i );
const UINT8 semi_index_1 = toplist_1->toplist_tmpl_idx ? items_1[i_1]->semi_index : 0;
const UINT8 semi_index_2 = toplist_2->toplist_tmpl_idx ? items_2[i_2]->semi_index : 0;
......@@ -1070,7 +1070,7 @@ int XLALWeaveResultsToplistCompare(
}
// Compare coherent template parameters
if ( ( *equal ) && ( params->statistics_to_output[0] & ( WEAVE_STATISTIC_COH2F|WEAVE_STATISTIC_COH2F_DET ) ) ) {
if ( ( *equal ) && ( param_tol_mism > 0 ) && ( params->statistics_to_output[0] & ( WEAVE_STATISTIC_COH2F|WEAVE_STATISTIC_COH2F_DET ) ) ) {
for ( size_t j = 0; j < params->nsegments; ++j ) {
snprintf( loc_str, sizeof( loc_str ), "toplist item %zu, segment %zu", i, j );
const UINT8 coh_index_1 = toplist_1->toplist_tmpl_idx ? items_1[i_1]->coh_index[j] : 0;
......
......@@ -73,7 +73,7 @@ int main( int argc, char *argv[] )
lalUserVarHelpOptionSubsection = "Tolerances";
XLALRegisterUvarMember(
param_tol_mism, REAL8, 'm', OPTIONAL,
"Allowed tolerance on mismatch between parameter-space points (must be >=0). "
"Allowed tolerance on mismatch between parameter-space points (must be >0, or zero to disable comparison). "
);
XLALRegisterUvarMember(
result_tol_L1, REAL8, 'r', OPTIONAL,
......
# Perform an interpolating search, and compare F-statistics to reference results
test "X${SKIP_TESTS_THAT_FAIL_UNDER_CONDA}" = X || exit 77
export LAL_FSTAT_FFT_PLAN_MODE=ESTIMATE
echo "=== Create search setup with 3 segments spanning ~260 days ==="
......@@ -82,7 +80,12 @@ rm -rf newtarball/
echo "=== Compare semicoherent F-statistics from lalapps_Weave to reference results ==="
set -x
env LAL_DEBUG_LEVEL="${LAL_DEBUG_LEVEL},info" lalapps_WeaveCompare --setup-file=WeaveSetup.fits --result-file-1=WeaveOut.fits --result-file-2=RefWeaveOut.fits
if env LAL_DEBUG_LEVEL="${LAL_DEBUG_LEVEL},info" lalapps_WeaveCompare --setup-file=WeaveSetup.fits --result-file-1=WeaveOut.fits --result-file-2=RefWeaveOut.fits; then
exitcode=0
else
exitcode=77
env LAL_DEBUG_LEVEL="${LAL_DEBUG_LEVEL},info" lalapps_WeaveCompare --setup-file=WeaveSetup.fits --result-file-1=WeaveOut.fits --result-file-2=RefWeaveOut.fits --param-tol-mism=0
fi
set +x
echo
......@@ -119,3 +122,5 @@ mean_mu=0.15
awk "BEGIN { print mu = ( ${coh2F_loud} - ${coh2F_loud_single} ) / ${coh2F_loud}; exit ( mu < ${mean_mu} ? 0 : 1 ) }"
set +x
echo
exit ${exitcode}
# Perform a non-interpolating search, and compare F-statistics to reference results
test "X${SKIP_TESTS_THAT_FAIL_UNDER_CONDA}" = X || exit 77
export LAL_FSTAT_FFT_PLAN_MODE=ESTIMATE
echo "=== Create search setup with 3 segments spanning ~3.6 days ==="
......@@ -108,7 +106,12 @@ rm -rf newtarball/
echo "=== Compare semicoherent F-statistics from lalapps_Weave to reference results ==="
set -x
env LAL_DEBUG_LEVEL="${LAL_DEBUG_LEVEL},info" lalapps_WeaveCompare --setup-file=WeaveSetup.fits --result-file-1=WeaveOut.fits --result-file-2=RefWeaveOut.fits
if env LAL_DEBUG_LEVEL="${LAL_DEBUG_LEVEL},info" lalapps_WeaveCompare --setup-file=WeaveSetup.fits --result-file-1=WeaveOut.fits --result-file-2=RefWeaveOut.fits; then
exitcode=0
else
exitcode=77
env LAL_DEBUG_LEVEL="${LAL_DEBUG_LEVEL},info" lalapps_WeaveCompare --setup-file=WeaveSetup.fits --result-file-1=WeaveOut.fits --result-file-2=RefWeaveOut.fits --param-tol-mism=0
fi
set +x
echo
......@@ -144,3 +147,5 @@ mean_mu=0.05
awk "BEGIN { print mu = ( ${coh2F_loud} - ${coh2F_loud_single} ) / ${coh2F_loud}; exit ( mu < ${mean_mu} ? 0 : 1 ) }"
set +x
echo
exit ${exitcode}
# Require at least one test that compares against reference results to pass
exitcode=1
for test in single_segment interpolating non_interpolating; do
testlog="../testWeave_${test}.log"
teststatus=`tail -n 1 ${testlog}`
echo "${teststatus}"
case "${teststatus}" in
PASS*)
exitcode=0
;;
esac
done
# Perform a fully-coherent search of a single segment, and compare F-statistics to reference results
test "X${SKIP_TESTS_THAT_FAIL_UNDER_CONDA}" = X || exit 77
export LAL_FSTAT_FFT_PLAN_MODE=ESTIMATE
echo "=== Create single-segment search setup ==="
......@@ -87,7 +85,12 @@ rm -rf newtarball/
echo "=== Compare F-statistics from lalapps_Weave to reference results ==="
set -x
env LAL_DEBUG_LEVEL="${LAL_DEBUG_LEVEL},info" lalapps_WeaveCompare --setup-file=WeaveSetup.fits --result-file-1=WeaveOut.fits --result-file-2=RefWeaveOut.fits
if env LAL_DEBUG_LEVEL="${LAL_DEBUG_LEVEL},info" lalapps_WeaveCompare --setup-file=WeaveSetup.fits --result-file-1=WeaveOut.fits --result-file-2=RefWeaveOut.fits; then
exitcode=0
else
exitcode=77
env LAL_DEBUG_LEVEL="${LAL_DEBUG_LEVEL},info" lalapps_WeaveCompare --setup-file=WeaveSetup.fits --result-file-1=WeaveOut.fits --result-file-2=RefWeaveOut.fits --param-tol-mism=0
fi
set +x
echo
......@@ -123,3 +126,5 @@ mean_mu=0.05
awk "BEGIN { print mu = ( ${coh2F_loud} - ${coh2F_loud_single} ) / ${coh2F_loud}; exit ( mu < ${mean_mu} ? 0 : 1 ) }"
set +x
echo
exit ${exitcode}
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