mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
ci: use python -m coverage
instead of coverage
executable
This commit is contained in:
@@ -11,26 +11,21 @@ else
|
|||||||
elf_dir=$1
|
elf_dir=$1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v coverage &> /dev/null; then
|
|
||||||
echo "coverage could not be found, please install it ('pip install coverage')"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
SUPPORTED_TARGETS=("esp32" "esp32s2" "esp32c3" "esp32s3" )
|
SUPPORTED_TARGETS=("esp32" "esp32s2" "esp32c3" "esp32s3" )
|
||||||
res=0
|
res=0
|
||||||
coverage erase
|
python -m coverage erase
|
||||||
for chip in "${SUPPORTED_TARGETS[@]}"; do
|
for chip in "${SUPPORTED_TARGETS[@]}"; do
|
||||||
{
|
{
|
||||||
echo "run b64 decoding tests on $chip"
|
echo "run b64 decoding tests on $chip"
|
||||||
coverage run -a --source=corefile ../espcoredump.py --chip="$chip" --gdb-timeout-sec 5 info_corefile -m -t b64 -c "${chip}/coredump.b64" -s "${chip}/core.elf" "${elf_dir}/${chip}.elf" &>"${chip}/output" &&
|
python -m coverage run -a --source=corefile ../espcoredump.py --chip="$chip" --gdb-timeout-sec 5 info_corefile -m -t b64 -c "${chip}/coredump.b64" -s "${chip}/core.elf" "${elf_dir}/${chip}.elf" &>"${chip}/output" &&
|
||||||
diff "${chip}/expected_output" "${chip}/output" &&
|
diff "${chip}/expected_output" "${chip}/output" &&
|
||||||
coverage run -a --source=corefile ../espcoredump.py --chip="$chip" --gdb-timeout-sec 5 info_corefile -m -t elf -c "${chip}/core.elf" "${elf_dir}/${chip}.elf" &>"${chip}/output2" &&
|
python -m coverage run -a --source=corefile ../espcoredump.py --chip="$chip" --gdb-timeout-sec 5 info_corefile -m -t elf -c "${chip}/core.elf" "${elf_dir}/${chip}.elf" &>"${chip}/output2" &&
|
||||||
diff "${chip}/expected_output" "${chip}/output2"
|
diff "${chip}/expected_output" "${chip}/output2"
|
||||||
} || {
|
} || {
|
||||||
echo 'The test for espcoredump has failed!'
|
echo 'The test for espcoredump has failed!'
|
||||||
res=1
|
res=1
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
coverage run -a --source=corefile ./test_espcoredump.py
|
python -m coverage run -a --source=corefile ./test_espcoredump.py
|
||||||
coverage report ../corefile/*.py ../espcoredump.py
|
python -m coverage report ../corefile/*.py ../espcoredump.py
|
||||||
exit $res
|
exit $res
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
{ coverage debug sys \
|
{ python -m coverage debug sys \
|
||||||
&& coverage erase &> output \
|
&& python -m coverage erase &> output \
|
||||||
&& coverage run -a $IDF_PATH/tools/esp_app_trace/logtrace_proc.py adc_log.trc test.elf &>> output \
|
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/logtrace_proc.py adc_log.trc test.elf &>> output \
|
||||||
&& diff output expected_output \
|
&& diff output expected_output \
|
||||||
&& coverage report \
|
&& python -m coverage report \
|
||||||
; } || { echo 'The test for logtrace_proc has failed. Please examine the artifacts.' ; exit 1; }
|
; } || { echo 'The test for logtrace_proc has failed. Please examine the artifacts.' ; exit 1; }
|
||||||
|
@@ -1,29 +1,29 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
{ coverage debug sys \
|
{ python -m coverage debug sys \
|
||||||
&& coverage erase &> output \
|
&& python -m coverage erase &> output \
|
||||||
&& coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b test.elf cpu0.svdat cpu1.svdat &>> output \
|
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b test.elf cpu0.svdat cpu1.svdat &>> output \
|
||||||
&& diff output expected_output \
|
&& diff output expected_output \
|
||||||
&& coverage report \
|
&& python -m coverage report \
|
||||||
; } || { echo 'The test for sysviewtrace_proc has failed. Please examine the artifacts.' ; exit 1; }
|
; } || { echo 'The test for sysviewtrace_proc has failed. Please examine the artifacts.' ; exit 1; }
|
||||||
|
|
||||||
{ coverage debug sys \
|
{ python -m coverage debug sys \
|
||||||
&& coverage erase &> output.json \
|
&& python -m coverage erase &> output.json \
|
||||||
&& coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b test.elf cpu0.svdat cpu1.svdat &>> output.json \
|
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b test.elf cpu0.svdat cpu1.svdat &>> output.json \
|
||||||
&& diff output.json expected_output.json \
|
&& diff output.json expected_output.json \
|
||||||
&& coverage report \
|
&& python -m coverage report \
|
||||||
; } || { echo 'The test for sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
; } || { echo 'The test for sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||||
|
|
||||||
{ coverage debug sys \
|
{ python -m coverage debug sys \
|
||||||
&& coverage erase &> output \
|
&& python -m coverage erase &> output \
|
||||||
&& coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log_mcore.svdat &>> output \
|
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log_mcore.svdat &>> output \
|
||||||
&& diff output expected_output_mcore \
|
&& diff output expected_output_mcore \
|
||||||
&& coverage report \
|
&& python -m coverage report \
|
||||||
; } || { echo 'The test for mcore sysviewtrace_proc functionality has failed. Please examine the artifacts.' ; exit 1; }
|
; } || { echo 'The test for mcore sysviewtrace_proc functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||||
|
|
||||||
{ coverage debug sys \
|
{ python -m coverage debug sys \
|
||||||
&& coverage erase &> output.json \
|
&& python -m coverage erase &> output.json \
|
||||||
&& coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log_mcore.svdat &>> output.json \
|
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log_mcore.svdat &>> output.json \
|
||||||
&& diff output.json expected_output_mcore.json \
|
&& diff output.json expected_output_mcore.json \
|
||||||
&& coverage report \
|
&& python -m coverage report \
|
||||||
; } || { echo 'The test for mcore sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
; } || { echo 'The test for mcore sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||||
|
Reference in New Issue
Block a user