Skip to content
Snippets Groups Projects

[meta,cmake] Restructure project and introduce CMake tooling

Merged Giovanna Lazzari Miotto requested to merge feature/cmake-migration into main
All threads resolved!
Compare and Show latest version
27 files
+ 1219
346
Compare changes
  • Side-by-side
  • Inline
Files
27
+ 60
22
#!/bin/bash
function scdaq_test {
echo "Starting scdaq test with GMT P5 capture file: check for crash"
timeout 10s build/scdaq --config test/config/scdaq-gmt.conf | uniq -uc
GMTRET="${PIPESTATUS[0]}"
echo "#############################################################################"
echo "Starting scdaq test with CALO P5 capture file: check for crash"
timeout 10s build/scdaq --config test/config/scdaq-calo.conf | uniq -uc
CALORET="${PIPESTATUS[0]}"
echo "#############################################################################"
echo "Starting scdaq test with 2 passthrough P5 capture files: check for crash"
timeout 10s build/scdaq --config test/config/scdaq-passthrough.conf --nstreams 2 | uniq
MULTI_PIPELINE_RET="${PIPESTATUS[0]}"
if [[ "$GMTRET" -ne 124 ]]; then # We expect to fail with a timeout because scdaq isn't supposed to return.
echo "SCDAQ test for GMT failed with exit code ${GMTRET}!"
GMT_FAILED=true
elif [ $(find test/data -name "*scout_GMT*" | wc -l) -eq 0 ] && [ $OUTPUT_EXPECTED = "true" ]; then
echo "SCDAQ test for GMT failed, no output files found!"
GMT_FAILED=true
fi
if [[ "$CALORET" -ne 124 ]]; then # We expect to fail with a timeout because scdaq isn't supposed to return.
echo "SCDAQ test for CALO failed with exit code ${CALORET}!"
CALO_FAILED=true
elif [ $(find test/data -name "*scout_CALO*" | wc -l) -eq 0 ] && [ $OUTPUT_EXPECTED = "true" ]; then
echo "SCDAQ test for CALO failed, no output files found!"
CALO_FAILED=true
fi
if [[ "$MULTI_PIPELINE_RET" -ne 124 ]]; then
echo "SCDAQ test for MULTIPLE PIPELINES failed with exit code ${MULTI_PIPELINE_RET}!"
MULTI_PIPELINE_FAILED=true
elif [[ $(find test/data -name "*scout_PASS1_CALO*" | wc -l) -eq 0 || $(find test/data -name "*scout_PASS2_GMT*" | wc -l) -eq 0 ]]; then
echo "SCDAQ test for MULTIPLE PIPELINES failed, no output files found!"
MULTI_PIPELINE_FAILED=true
fi
}
echo "building scdaq locally"
mkdir -p build
cd build
@@ -8,29 +44,31 @@ cd ../test/data
tar -xzvf calo_testfile.tar.gz
tar -xzvf gmt_testfile.tar.gz
cd ../../
echo "Starting scdaq test with GMT P5 capture file: check for crash"
timeout 20s build/scdaq --config test/config/scdaq-gmt.conf | uniq
GMTRET="${PIPESTATUS[0]}"
echo "#############################################################################"
echo "Starting scdaq test with CALO P5 capture file: check for crash"
timeout 60s build/scdaq --config test/config/scdaq-calo.conf | uniq
CALORET="${PIPESTATUS[0]}"
if [[ "$GMTRET" -ne 124 ]]; then # We expect to fail with a timeout because scdaq isn't supposed to return.
echo "SCDAQ test for GMT failed with exit code ${GMTRET}!"
GMT_FAILED=true
elif [[ $(find test/data -name "*scout_GMT*" | wc -l) -eq 0 ]]; then
echo "SCDAQ test for GMT failed, no output files found!"
GMT_FAILED=true
fi
if [[ "$CALORET" -ne 124 ]]; then # We expect to fail with a timeout because scdaq isn't supposed to return.
echo "SCDAQ test for CALO failed with exit code ${CALORET}!"
CALO_FAILED=true
elif [[ $(find test/data -name "*scout_CALO*" | wc -l) -eq 0 ]]; then
echo "SCDAQ test for CALO failed, no output files found!"
CALO_FAILED=true
fi
OUTPUT_EXPECTED=false
scdaq_test
echo $GMT_FAILED
echo $CALO_FAILED
echo $MULTI_PIPELINE_FAILED
echo "Starting second set of test files"
OUTPUT_EXPECTED=true
cd test/data
rm calo_testfile.dat
rm gmt_testfile.dat
tar -xzvf calo_testfile_mod.tar.gz
tar -xzvf gmt_testfile_mod.tar.gz
rm -rf run000000/in_progress/*
cd ../../
#next line needed because older GMT files were taken with 5 orbits per packet
sed -i 's/nOrbitsPerPacket:1/nOrbitsPerPacket:5/' test/config/scdaq-gmt.conf
scdaq_test
echo $GMT_FAILED
echo $CALO_FAILED
echo $MULTI_PIPELINE_FAILED
if [[ $GMT_FAILED = true || $CALO_FAILED = true ]]; then
if [[ $GMT_FAILED = true || $CALO_FAILED = true || $MULTI_PIPELINE_FAILED = true ]]; then
exit 1
fi
Loading