Exercise mycp a basic GNU cp clone

This commit is contained in:
Fabio Scotto di Santolo
2025-06-26 18:04:32 +02:00
parent 85ef4163db
commit 37ccfc7367
5 changed files with 273 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#!/bin/sh
LOG=test_results.log
OUT=test_report.html
echo "[INFO] Generating HTML report..."
cat <<EOF > "$OUT"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>mycp Test Report</title>
<style>
body { font-family: monospace; background: #111; color: #eee; padding: 20px; }
.pass { color: #8f8; }
.fail { color: #f88; }
h1 { color: #0af; }
</style>
</head>
<body>
<h1>mycp Test Report</h1>
<pre>
EOF
sed \
-e 's/✔/<span class="pass">✔<\/span>/g' \
-e 's/✘/<span class="fail">✘<\/span>/g' \
-e 's/✅/<span class="pass">✅<\/span>/g' \
-e 's/❌/<span class="fail">❌<\/span>/g' \
"$LOG" >> "$OUT"
cat <<EOF >> "$OUT"
</pre>
</body>
</html>
EOF
echo "✅ HTML report saved to $OUT"