fix: address code review comments from PR #79

- Add TEST_GROUPS constant to eliminate magic number
- Use stdout for info messages, stderr for errors only
- Remove redundant comments and dead code
- Add CI check before copying coverage.info
- Unify variable declaration order
- Add port allocation explanation comment
- Restore /* 50ms */ inline comment
- Update CONTRIBUTING.md with build 1 description
This commit is contained in:
2026-02-02 14:56:46 +03:00
parent cf86e60af6
commit 5978c77a45
3 changed files with 26 additions and 23 deletions

View File

@@ -40,8 +40,6 @@ readonly COVERAGE_PATTERNS='*/profanity/src/* */src/src/*'
# Parse STATS line from build log and set global variables
# Usage: parse_build_stats <log_file>
# Sets: STAT_UNIT_P, STAT_UNIT_F, STAT_FUNC_P, STAT_FUNC_F,
# STAT_COV_LINES, STAT_COV_FUNCS, STAT_COV_BRANCHES, STAT_TIME
parse_build_stats() {
local log_file="$1"
local stats_line
@@ -355,7 +353,8 @@ build_and_test() {
./profanity -v
# Save coverage.info before cleanup (for CI artifact)
if [ "$run_coverage" = "yes" ] && [ -f coverage.info ]; then
# Only copy in CI environment to avoid leaving artifacts during local runs
if [ "$run_coverage" = "yes" ] && [ -f coverage.info ] && [ -n "$CI" ]; then
cp coverage.info ../coverage.info
echo "Coverage report saved to coverage.info"
fi
@@ -397,8 +396,8 @@ else
if [ $idx -le ${#tests[@]} ]; then
# All builds run Valgrind on Linux
if [ "$ARCH" = "linux" ]; then
run_valgrind="yes"
extra_flags="--enable-valgrind"
run_valgrind="yes"
else
extra_flags=""
run_valgrind="no"