Skip to content

Commit

Permalink
Don't say tests are successful when they are not (emikulic#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhartzer authored Mar 9, 2024
1 parent 30b5fe9 commit b7e6163
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
darkhttpd
__pycache__/
a.out
*.gcda
*.gcov
devel/a.out
*.gcno
devel/test.out.log
devel/test.out.stdout
devel/test.out.stderr
devel/test_make_safe_uri
devel/test_password_equal
devel/tmp.httpd.tests
22 changes: 12 additions & 10 deletions devel/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ runtests() {
>>test.out.stdout 2>>test.out.stderr &
PID=$!
kill -0 $PID || exit 1
$PYTHON test.py
$PYTHON test.py || exit 1
kill $PID
wait $PID

Expand All @@ -74,7 +74,7 @@ runtests() {
>>test.out.stdout 2>>test.out.stderr &
PID=$!
kill -0 $PID || exit 1
$PYTHON test_forward.py
$PYTHON test_forward.py || exit 1
kill $PID
wait $PID

Expand All @@ -85,7 +85,7 @@ runtests() {
>>test.out.stdout 2>>test.out.stderr &
PID=$!
kill -0 $PID || exit 1
$PYTHON test_forward_all.py
$PYTHON test_forward_all.py || exit 1
kill $PID
wait $PID

Expand All @@ -94,7 +94,7 @@ runtests() {
>>test.out.stdout 2>>test.out.stderr &
PID=$!
kill -0 $PID || exit 1
$PYTHON test_server_id.py
$PYTHON test_server_id.py || exit 1
kill $PID
wait $PID

Expand All @@ -110,7 +110,7 @@ runtests() {
>>test.out.stdout 2>>test.out.stderr &
PID=$!
kill -0 $PID || exit 1
$PYTHON test_mimemap.py
$PYTHON test_mimemap.py || exit 1
kill $PID
wait $PID

Expand All @@ -119,7 +119,7 @@ runtests() {
>>test.out.stdout 2>>test.out.stderr &
PID=$!
kill -0 $PID || exit 1
$PYTHON test_no_listing.py
$PYTHON test_no_listing.py || exit 1
kill $PID
wait $PID

Expand All @@ -128,7 +128,7 @@ runtests() {
>>test.out.stdout 2>>test.out.stderr &
PID=$!
kill -0 $PID || exit 1
$PYTHON test_timeout.py
$PYTHON test_timeout.py || exit 1
kill $PID
wait $PID

Expand All @@ -141,7 +141,7 @@ runtests() {
>>test.out.stdout 2>>test.out.stderr &
PID=$!
kill -0 $PID || exit 1
$PYTHON test_auth.py
$PYTHON test_auth.py || exit 1
kill $PID
wait $PID

Expand All @@ -157,7 +157,7 @@ runtests() {
>>test.out.stdout 2>>test.out.stderr &
PID=$!
kill -0 $PID || exit 1
$PYTHON test_custom_headers.py
$PYTHON test_custom_headers.py || exit 1
kill $PID
wait $PID

Expand All @@ -166,7 +166,7 @@ runtests() {
>>test.out.stdout 2>>test.out.stderr &
PID=$!
kill -0 $PID || exit 1
$PYTHON test_forward_https.py
$PYTHON test_forward_https.py || exit 1
kill $PID
wait $PID

Expand Down Expand Up @@ -239,6 +239,8 @@ $CC -g -O2 -fprofile-arcs -ftest-coverage -fsanitize=address \
}
echo "===> generating report"
gcov darkhttpd
chmod 755 $DIR/forbidden
chmod 755 $DIR/unreadable
rm -rf $DIR
rm -f darkhttpd.gcda darkhttpd.gcno a.out
echo "===> PASSED!"
Expand Down
1 change: 1 addition & 0 deletions devel/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ def setUpModule():
["fancy invalid up dir", "/./dir/./../../", "assertIsInvalid"],
["extra slashes 2", "//.d", "assertNotFound"],
["not found", "/not_found.txt", "assertNotFound"],
["not found dir", "/not_found/", "assertNotFound"],
["forbidden", "/forbidden/x", "assertForbidden"],
["unreadable", "/unreadable/", "assertForbidden"],
]:
Expand Down

0 comments on commit b7e6163

Please sign in to comment.