1#!/usr/bin/env bash
2
3{ coverage debug sys \
4    && coverage erase \
5    && coverage run -a --source=corefile ../espcoredump.py --gdb-timeout-sec 5 info_corefile -m -t b64 -c coredump.b64 -s core.elf test.elf &> output \
6    && diff expected_output output \
7    && coverage run -a --source=corefile ../espcoredump.py --gdb-timeout-sec 5 info_corefile -m -t elf -c core.elf test.elf &> output2 \
8    && diff expected_output output2 \
9    && coverage run -a --source=corefile ./test_espcoredump.py \
10    && coverage report ../corefile/elf.py ../corefile/gdb.py ../corefile/loader.py ../corefile/xtensa.py ../espcoredump.py \
11; } || { echo 'The test for espcoredump has failed!'; exit 1; }
12