main
John Lauer
Bind output-locked temperature diagnostics to selected NTCLE428 sensor
d2b6d40
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
load_check_dir=$(mktemp -d)
trap 'rm -rf "$load_check_dir"' EXIT
cc_args=(-std=c11 -Wall -Wextra -Werror -fsanitize=address,undefined -g)
gcc "${cc_args[@]}" -Itests/adc_hal_stub -Ifirmware firmware/adc_conversion.c firmware/ntcle428.c tests/test_adc_input.c -lm -o "$load_check_dir/adc-adapter"
"$load_check_dir/adc-adapter"
gcc "${cc_args[@]}" -Itests/hal_stub -Ifirmware firmware/instruments.c firmware/measurement_cache.c tests/test_instrument_input.c -lm -o "$load_check_dir/adapter"
"$load_check_dir/adapter"
gcc "${cc_args[@]}" -Itests/fan_hal_stub -Ifirmware firmware/fan_tach.c tests/test_fan_input.c -lm -o "$load_check_dir/fan-adapter"
"$load_check_dir/fan-adapter"
gcc "${cc_args[@]}" firmware/load_core.c tests/test_load_core.c -lm -o "$load_check_dir/core"
"$load_check_dir/core"
gcc "${cc_args[@]}" firmware/fan_tach.c tests/test_fan_tach.c -lm -o "$load_check_dir/tach"
"$load_check_dir/tach"
gcc "${cc_args[@]}" firmware/load_core.c firmware/fan_tach.c tests/test_fan_shutdown.c -lm -o "$load_check_dir/fan-shutdown"
"$load_check_dir/fan-shutdown"
gcc "${cc_args[@]}" firmware/load_core.c firmware/load_protocol.c tests/test_load_protocol.c -lm -o "$load_check_dir/protocol"
"$load_check_dir/protocol"
gcc "${cc_args[@]}" demos/fan-safety/trace.c firmware/load_core.c firmware/fan_tach.c -lm -o "$load_check_dir/fan-demo"
"$load_check_dir/fan-demo" > "$load_check_dir/fan-trace.json"
gcc "${cc_args[@]}" firmware/adc_conversion.c firmware/ntcle428.c tests/test_adc_conversion.c -lm -o "$load_check_dir/adc-conversion"
"$load_check_dir/adc-conversion"
python3 tools/check_ntcle428_firmware.py
gcc "${cc_args[@]}" firmware/measurement_cache.c tests/test_measurement_cache.c -lm -o "$load_check_dir/measurement-cache"
"$load_check_dir/measurement-cache"
gcc "${cc_args[@]}" firmware/instruments.c tests/test_instruments.c -lm -o "$load_check_dir/instruments"
"$load_check_dir/instruments"
gcc "${cc_args[@]}" firmware/load_core.c firmware/load_protocol.c tests/protocol_peer.c -lm -o "$load_check_dir/peer"
LOAD_PROTOCOL_PEER="$load_check_dir/peer" python3 -m unittest discover -s tests -p 'test_*.py'