Index: uspace/lib/pcut/src/assert.c
===================================================================
--- uspace/lib/pcut/src/assert.c	(revision 8e3498b351ae109f7ad16592a1f108e3bd44c829)
+++ uspace/lib/pcut/src/assert.c	(revision c1694b6b243b360b5f1fbf0629b5e7d4f7f4a515)
@@ -35,6 +35,10 @@
  */
 
-/** We need _BSD_SOURCE because of vsnprintf() when compiling under C89. */
+/*
+ * We need _BSD_SOURCE because of vsnprintf() when compiling under C89.
+ * In newer versions of features.h, _DEFAULT_SOURCE must be defined as well.
+ */
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include "internal.h"
Index: uspace/lib/pcut/src/internal.h
===================================================================
--- uspace/lib/pcut/src/internal.h	(revision 8e3498b351ae109f7ad16592a1f108e3bd44c829)
+++ uspace/lib/pcut/src/internal.h	(revision c1694b6b243b360b5f1fbf0629b5e7d4f7f4a515)
@@ -79,14 +79,4 @@
 #define PCUT_RUN_MODE_SINGLE 2
 
-/** Test outcome: test passed. */
-#define TEST_OUTCOME_PASS 1
-
-/** Test outcome: test failed. */
-#define TEST_OUTCOME_FAIL 2
-
-/** Test outcome: test failed unexpectedly. */
-#define TEST_OUTCOME_ERROR 3
-
-
 /*
  * Use sprintf_s in Windows but only with Microsoft compiler.
@@ -109,5 +99,5 @@
 int pcut_is_arg_with_number(const char *arg, const char *opt, int *value);
 
-void pcut_run_test_forking(const char *self_path, pcut_item_t *test);
+int pcut_run_test_forking(const char *self_path, pcut_item_t *test);
 int pcut_run_test_forked(pcut_item_t *test);
 int pcut_run_test_single(pcut_item_t *test);
Index: uspace/lib/pcut/src/main.c
===================================================================
--- uspace/lib/pcut/src/main.c	(revision 8e3498b351ae109f7ad16592a1f108e3bd44c829)
+++ uspace/lib/pcut/src/main.c	(revision c1694b6b243b360b5f1fbf0629b5e7d4f7f4a515)
@@ -90,8 +90,11 @@
  * @param last Pointer to first item after this suite is stored here.
  * @param prog_path Path to the current binary (used in forked mode).
- */
-static void run_suite(pcut_item_t *suite, pcut_item_t **last, const char *prog_path) {
+ * @return Error code.
+ */
+static int run_suite(pcut_item_t *suite, pcut_item_t **last, const char *prog_path) {
 	int is_first_test = 1;
 	int total_count = 0;
+	int ret_code = PCUT_OUTCOME_PASS;
+	int ret_code_tmp;
 
 	pcut_item_t *it = pcut_get_real_next(suite);
@@ -114,8 +117,19 @@
 
 		if (pcut_run_mode == PCUT_RUN_MODE_FORKING) {
-			pcut_run_test_forking(prog_path, it);
+			ret_code_tmp = pcut_run_test_forking(prog_path, it);
 		} else {
-			pcut_run_test_single(it);
-		}
+			ret_code_tmp = pcut_run_test_single(it);
+		}
+
+		/*
+		 * Override final return code in case of failure.
+		 *
+		 * In this case we suppress any special error codes as
+		 * to the outside, there was a failure.
+		 */
+		if (ret_code_tmp != PCUT_OUTCOME_PASS) {
+			ret_code = PCUT_OUTCOME_FAIL;
+		}
+
 		total_count++;
 	}
@@ -130,4 +144,6 @@
 		*last = it;
 	}
+
+	return ret_code;
 }
 
@@ -181,4 +197,6 @@
 	int run_only_test = -1;
 
+	int rc, rc_tmp;
+
 	if (main_extras == NULL) {
 		main_extras = empty_main_extra;
@@ -203,5 +221,5 @@
 			if (pcut_str_equals(argv[i], "-l")) {
 				pcut_print_tests(items);
-				return 0;
+				return PCUT_OUTCOME_PASS;
 			}
 			if (pcut_str_equals(argv[i], "-x")) {
@@ -229,5 +247,5 @@
 	if ((run_only_suite >= 0) && (run_only_test >= 0)) {
 		printf("Specify either -s or -t!\n");
-		return 1;
+		return PCUT_OUTCOME_BAD_INVOCATION;
 	}
 
@@ -236,25 +254,24 @@
 		if (suite == NULL) {
 			printf("Suite not found, aborting!\n");
-			return 2;
+			return PCUT_OUTCOME_BAD_INVOCATION;
 		}
 		if (suite->kind != PCUT_KIND_TESTSUITE) {
 			printf("Invalid suite id!\n");
-			return 3;
+			return PCUT_OUTCOME_BAD_INVOCATION;
 		}
 
 		run_suite(suite, NULL, argv[0]);
-		return 0;
+		return PCUT_OUTCOME_PASS;
 	}
 
 	if (run_only_test > 0) {
-		int rc;
 		pcut_item_t *test = pcut_find_by_id(items, run_only_test);
 		if (test == NULL) {
 			printf("Test not found, aborting!\n");
-			return 2;
+			return PCUT_OUTCOME_BAD_INVOCATION;
 		}
 		if (test->kind != PCUT_KIND_TEST) {
 			printf("Invalid test id!\n");
-			return 3;
+			return PCUT_OUTCOME_BAD_INVOCATION;
 		}
 
@@ -271,9 +288,14 @@
 	pcut_report_init(items);
 
+	rc = PCUT_OUTCOME_PASS;
+
 	it = items;
 	while (it != NULL) {
 		if (it->kind == PCUT_KIND_TESTSUITE) {
 			pcut_item_t *tmp;
-			run_suite(it, &tmp, argv[0]);
+			rc_tmp = run_suite(it, &tmp, argv[0]);
+			if (rc_tmp != PCUT_OUTCOME_PASS) {
+				rc = rc_tmp;
+			}
 			it = tmp;
 		} else {
@@ -284,4 +306,4 @@
 	pcut_report_done();
 
-	return 0;
-}
+	return rc;
+}
Index: uspace/lib/pcut/src/os/generic.c
===================================================================
--- uspace/lib/pcut/src/os/generic.c	(revision 8e3498b351ae109f7ad16592a1f108e3bd44c829)
+++ uspace/lib/pcut/src/os/generic.c	(revision c1694b6b243b360b5f1fbf0629b5e7d4f7f4a515)
@@ -34,4 +34,5 @@
 #include <stdlib.h>
 #include <stdio.h>
+#include <sys/types.h>
 #include <errno.h>
 #include <assert.h>
@@ -94,9 +95,9 @@
 static int convert_wait_status_to_outcome(int status) {
 	if (status < 0) {
-		return TEST_OUTCOME_ERROR;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	} else if (status == 0) {
-		return TEST_OUTCOME_PASS;
+		return PCUT_OUTCOME_PASS;
 	} else {
-		return TEST_OUTCOME_FAIL;
+		return PCUT_OUTCOME_FAIL;
 	}
 }
@@ -107,6 +108,6 @@
  * @param test Test to be run.
  */
-void pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
-	int rc;
+int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
+	int rc, outcome;
 	FILE *tempfile;
 	char tempfile_name[PCUT_TEMP_FILENAME_BUFFER_SIZE];
@@ -126,17 +127,19 @@
 	PCUT_DEBUG("system() returned 0x%04X", rc);
 
-	rc = convert_wait_status_to_outcome(rc);
+	outcome = convert_wait_status_to_outcome(rc);
 
 	tempfile = fopen(tempfile_name, "rb");
 	if (tempfile == NULL) {
 		pcut_report_test_done(test, TEST_OUTCOME_ERROR, "Failed to open temporary file.", NULL, NULL);
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
 	fread(extra_output_buffer, 1, OUTPUT_BUFFER_SIZE, tempfile);
 	fclose(tempfile);
-	unlink(tempfile_name);
+	remove(tempfile_name);
 
-	pcut_report_test_done_unparsed(test, rc, extra_output_buffer, OUTPUT_BUFFER_SIZE);
+	pcut_report_test_done_unparsed(test, outcome, extra_output_buffer, OUTPUT_BUFFER_SIZE);
+
+	return outcome;
 }
 
Index: uspace/lib/pcut/src/os/helenos.c
===================================================================
--- uspace/lib/pcut/src/os/helenos.c	(revision 8e3498b351ae109f7ad16592a1f108e3bd44c829)
+++ uspace/lib/pcut/src/os/helenos.c	(revision c1694b6b243b360b5f1fbf0629b5e7d4f7f4a515)
@@ -154,5 +154,5 @@
  * @param test Test to be run.
  */
-void pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
+int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
 	before_test_start(test);
 
@@ -161,6 +161,6 @@
 	int tempfile = vfs_lookup_open(tempfile_name, WALK_REGULAR | WALK_MAY_CREATE, MODE_READ | MODE_WRITE);
 	if (tempfile < 0) {
-		pcut_report_test_done(test, TEST_OUTCOME_ERROR, "Failed to create temporary file.", NULL, NULL);
-		return;
+		pcut_report_test_done(test, PCUT_OUTCOME_INTERNAL_ERROR, "Failed to create temporary file.", NULL, NULL);
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -174,5 +174,5 @@
 	};
 
-	int status = TEST_OUTCOME_PASS;
+	int status = PCUT_OUTCOME_PASS;
 
 	task_wait_t test_task_wait;
@@ -180,5 +180,5 @@
 	    fileno(stdin), tempfile, tempfile);
 	if (rc != EOK) {
-		status = TEST_OUTCOME_ERROR;
+		status = PCUT_OUTCOME_INTERNAL_ERROR;
 		goto leave_close_tempfile;
 	}
@@ -198,11 +198,11 @@
 	rc = task_wait(&test_task_wait, &task_exit, &task_retval);
 	if (rc != EOK) {
-		status = TEST_OUTCOME_ERROR;
+		status = PCUT_OUTCOME_INTERNAL_ERROR;
 		goto leave_close_tempfile;
 	}
 	if (task_exit == TASK_EXIT_UNEXPECTED) {
-		status = TEST_OUTCOME_ERROR;
+		status = PCUT_OUTCOME_INTERNAL_ERROR;
 	} else {
-		status = task_retval == 0 ? TEST_OUTCOME_PASS : TEST_OUTCOME_FAIL;
+		status = task_retval == 0 ? PCUT_OUTCOME_PASS : PCUT_OUTCOME_FAIL;
 	}
 
@@ -221,4 +221,6 @@
 
 	pcut_report_test_done_unparsed(test, status, extra_output_buffer, OUTPUT_BUFFER_SIZE);
+
+	return status;
 }
 
Index: uspace/lib/pcut/src/os/unix.c
===================================================================
--- uspace/lib/pcut/src/os/unix.c	(revision 8e3498b351ae109f7ad16592a1f108e3bd44c829)
+++ uspace/lib/pcut/src/os/unix.c	(revision c1694b6b243b360b5f1fbf0629b5e7d4f7f4a515)
@@ -36,7 +36,11 @@
 /** We need _BSD_SOURCE because of snprintf() when compiling under C89. */
 #define _BSD_SOURCE
+
+/** Newer versions of features.h needs _DEFAULT_SOURCE. */
+#define _DEFAULT_SOURCE
+
 #include <stdlib.h>
 #include <unistd.h>
-#include <stddef.h>
+#include <sys/types.h>
 #include <signal.h>
 #include <errno.h>
@@ -120,12 +124,12 @@
 	if (WIFEXITED(status)) {
 		if (WEXITSTATUS(status) != 0) {
-			return TEST_OUTCOME_FAIL;
+			return PCUT_OUTCOME_FAIL;
 		} else {
-			return TEST_OUTCOME_PASS;
+			return PCUT_OUTCOME_PASS;
 		}
 	}
 
 	if (WIFSIGNALED(status)) {
-		return TEST_OUTCOME_ERROR;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -138,7 +142,7 @@
  * @param test Test to be run.
  */
-void pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
+int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
 	int link_stdout[2], link_stderr[2];
-	int rc, status;
+	int rc, status, outcome;
 	size_t stderr_size;
 
@@ -152,6 +156,6 @@
 		snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
 				"pipe() failed: %s.", strerror(rc));
-		pcut_report_test_done(test, TEST_OUTCOME_ERROR, error_message_buffer, NULL, NULL);
-		return;
+		pcut_report_test_done(test, PCUT_OUTCOME_INTERNAL_ERROR, error_message_buffer, NULL, NULL);
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 	rc = pipe(link_stderr);
@@ -159,6 +163,6 @@
 		snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
 				"pipe() failed: %s.", strerror(rc));
-		pcut_report_test_done(test, TEST_OUTCOME_ERROR, error_message_buffer, NULL, NULL);
-		return;
+		pcut_report_test_done(test, PCUT_OUTCOME_INTERNAL_ERROR, error_message_buffer, NULL, NULL);
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -167,5 +171,5 @@
 		snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
 			"fork() failed: %s.", strerror(rc));
-		rc = TEST_OUTCOME_ERROR;
+		outcome = PCUT_OUTCOME_INTERNAL_ERROR;
 		goto leave_close_pipes;
 	}
@@ -178,7 +182,7 @@
 		close(link_stderr[0]);
 
-		rc = pcut_run_test_forked(test);
-
-		exit(rc);
+		outcome = pcut_run_test_forked(test);
+
+		exit(outcome);
 	}
 
@@ -195,5 +199,5 @@
 	alarm(0);
 
-	rc = convert_wait_status_to_outcome(status);
+	outcome = convert_wait_status_to_outcome(status);
 
 	goto leave_close_parent_pipe;
@@ -206,5 +210,7 @@
 	close(link_stderr[0]);
 
-	pcut_report_test_done_unparsed(test, rc, extra_output_buffer, OUTPUT_BUFFER_SIZE);
+	pcut_report_test_done_unparsed(test, outcome, extra_output_buffer, OUTPUT_BUFFER_SIZE);
+
+	return outcome;
 }
 
Index: uspace/lib/pcut/src/os/windows.c
===================================================================
--- uspace/lib/pcut/src/os/windows.c	(revision 8e3498b351ae109f7ad16592a1f108e3bd44c829)
+++ uspace/lib/pcut/src/os/windows.c	(revision c1694b6b243b360b5f1fbf0629b5e7d4f7f4a515)
@@ -144,5 +144,5 @@
  * @param test Test to be run.
  */
-void pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
+int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
 	/* TODO: clean-up if something goes wrong "in the middle" */
 	BOOL okay = FALSE;
@@ -173,10 +173,10 @@
 	if (!okay) {
 		report_func_fail(test, "CreatePipe(/* stdout */)");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 	okay = SetHandleInformation(link_stdout[0], HANDLE_FLAG_INHERIT, 0);
 	if (!okay) {
 		report_func_fail(test, "SetHandleInformation(/* stdout */)");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -185,10 +185,10 @@
 	if (!okay) {
 		report_func_fail(test, "CreatePipe(/* stderr */)");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 	okay = SetHandleInformation(link_stderr[0], HANDLE_FLAG_INHERIT, 0);
 	if (!okay) {
 		report_func_fail(test, "SetHandleInformation(/* stderr */)");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -197,10 +197,10 @@
 	if (!okay) {
 		report_func_fail(test, "CreatePipe(/* stdin */)");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 	okay = SetHandleInformation(link_stdin[1], HANDLE_FLAG_INHERIT, 0);
 	if (!okay) {
 		report_func_fail(test, "SetHandleInformation(/* stdin */)");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -224,5 +224,5 @@
 	if (!okay) {
 		report_func_fail(test, "CreateProcess()");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -236,15 +236,15 @@
 	if (!okay) {
 		report_func_fail(test, "CloseHandle(/* stdout */)");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 	okay = CloseHandle(link_stderr[1]);
 	if (!okay) {
 		report_func_fail(test, "CloseHandle(/* stderr */)");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 	okay = CloseHandle(link_stdin[0]);
 	if (!okay) {
 		report_func_fail(test, "CloseHandle(/* stdin */)");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -267,5 +267,5 @@
 	if (test_output_thread_reader == NULL) {
 		report_func_fail(test, "CreateThread(/* read test stdout */)");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -281,5 +281,5 @@
 		if (!okay) {
 			report_func_fail(test, "TerminateProcess(/* PROCESS_INFORMATION.hProcess */)");
-			return;
+			return PCUT_ERROR_INTERNAL_FAILURE;
 		}
 		rc = WaitForSingleObject(process_info.hProcess, INFINITE);
@@ -287,5 +287,5 @@
 	if (rc != WAIT_OBJECT_0) {
 		report_func_fail(test, "WaitForSingleObject(/* PROCESS_INFORMATION.hProcess */)");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -294,13 +294,13 @@
 	if (!okay) {
 		report_func_fail(test, "GetExitCodeProcess()");
-		return;
+		return PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
 	if (rc == 0) {
-		outcome = TEST_OUTCOME_PASS;
+		outcome = PCUT_OUTCOME_PASS;
 	} else if ((rc > 0) && (rc < 10) && !timed_out) {
-		outcome = TEST_OUTCOME_FAIL;
+		outcome = PCUT_OUTCOME_FAIL;
 	} else {
-		outcome = TEST_OUTCOME_ERROR;
+		outcome = PCUT_OUTCOME_INTERNAL_ERROR;
 	}
 
@@ -309,8 +309,10 @@
 	if (rc != WAIT_OBJECT_0) {
 		report_func_fail(test, "WaitForSingleObject(/* stdout reader thread */)");
-		return;
+		return PCUT_ERROR_INTERNAL_FAILURE;
 	}
 
 	pcut_report_test_done_unparsed(test, outcome, extra_output_buffer, OUTPUT_BUFFER_SIZE);
+
+	return outcome;
 }
 
Index: uspace/lib/pcut/src/print.c
===================================================================
--- uspace/lib/pcut/src/print.c	(revision 8e3498b351ae109f7ad16592a1f108e3bd44c829)
+++ uspace/lib/pcut/src/print.c	(revision c1694b6b243b360b5f1fbf0629b5e7d4f7f4a515)
@@ -81,4 +81,8 @@
 			printf("    Test `%s' [%d]\n", it->name, it->id);
 			break;
+		case PCUT_KIND_SETUP:
+		case PCUT_KIND_TEARDOWN:
+			/* Fall-through, do nothing. */
+			break;
 		default:
 			assert(0 && "unreachable case in item-kind switch");
Index: uspace/lib/pcut/src/report/tap.c
===================================================================
--- uspace/lib/pcut/src/report/tap.c	(revision 8e3498b351ae109f7ad16592a1f108e3bd44c829)
+++ uspace/lib/pcut/src/report/tap.c	(revision c1694b6b243b360b5f1fbf0629b5e7d4f7f4a515)
@@ -42,4 +42,7 @@
 static int test_counter;
 
+/** Counter of all failures. */
+static int failed_test_counter;
+
 /** Counter for tests in a current suite. */
 static int tests_in_suite;
@@ -55,4 +58,5 @@
 	int tests_total = pcut_count_tests(all_items);
 	test_counter = 0;
+	failed_test_counter = 0;
 
 	printf("1..%d\n", tests_total);
@@ -75,6 +79,11 @@
  */
 static void tap_suite_done(pcut_item_t *suite) {
-	printf("#> Finished suite %s (failed %d of %d).\n",
-			suite->name, failed_tests_in_suite, tests_in_suite);
+	if (failed_tests_in_suite == 0) {
+		printf("#> Finished suite %s (passed).\n",
+				suite->name);
+	} else {
+		printf("#> Finished suite %s (failed %d of %d).\n",
+				suite->name, failed_tests_in_suite, tests_in_suite);
+	}
 }
 
@@ -129,23 +138,21 @@
 	const char *fail_error_str = NULL;
 
-	if (outcome != TEST_OUTCOME_PASS) {
+	if (outcome != PCUT_OUTCOME_PASS) {
 		failed_tests_in_suite++;
+		failed_test_counter++;
 	}
 
 	switch (outcome) {
-	case TEST_OUTCOME_PASS:
+	case PCUT_OUTCOME_PASS:
 		status_str = "ok";
 		fail_error_str = "";
 		break;
-	case TEST_OUTCOME_FAIL:
+	case PCUT_OUTCOME_FAIL:
 		status_str = "not ok";
 		fail_error_str = " failed";
 		break;
-	case TEST_OUTCOME_ERROR:
+	default:
 		status_str = "not ok";
 		fail_error_str = " aborted";
-		break;
-	default:
-		/* Shall not get here. */
 		break;
 	}
@@ -160,4 +167,9 @@
 /** Report testing done. */
 static void tap_done(void) {
+	if (failed_test_counter == 0) {
+		printf("#> Done: all tests passed.\n");
+	} else {
+		printf("#> Done: %d of %d tests failed.\n", failed_test_counter, test_counter);
+	}
 }
 
Index: uspace/lib/pcut/src/report/xml.c
===================================================================
--- uspace/lib/pcut/src/report/xml.c	(revision 8e3498b351ae109f7ad16592a1f108e3bd44c829)
+++ uspace/lib/pcut/src/report/xml.c	(revision c1694b6b243b360b5f1fbf0629b5e7d4f7f4a515)
@@ -135,20 +135,17 @@
 	const char *status_str = NULL;
 
-	if (outcome != TEST_OUTCOME_PASS) {
+	if (outcome != PCUT_OUTCOME_PASS) {
 		failed_tests_in_suite++;
 	}
 
 	switch (outcome) {
-	case TEST_OUTCOME_PASS:
+	case PCUT_OUTCOME_PASS:
 		status_str = "pass";
 		break;
-	case TEST_OUTCOME_FAIL:
+	case PCUT_OUTCOME_FAIL:
 		status_str = "fail";
 		break;
-	case TEST_OUTCOME_ERROR:
+	default:
 		status_str = "error";
-		break;
-	default:
-		/* Shall not get here. */
 		break;
 	}
Index: uspace/lib/pcut/src/run.c
===================================================================
--- uspace/lib/pcut/src/run.c	(revision 8e3498b351ae109f7ad16592a1f108e3bd44c829)
+++ uspace/lib/pcut/src/run.c	(revision c1694b6b243b360b5f1fbf0629b5e7d4f7f4a515)
@@ -73,9 +73,8 @@
 static int default_suite_initialized = 0;
 
-static void init_default_suite_when_needed(void)
-{
-	if (default_suite_initialized)
+static void init_default_suite_when_needed() {
+	if (default_suite_initialized) {
 		return;
-	
+	}
 	default_suite.id = -1;
 	default_suite.kind = PCUT_KIND_TESTSUITE;
@@ -92,13 +91,11 @@
  * @return Always a valid test suite item.
  */
-static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it)
-{
+static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it) {
 	while (it != NULL) {
-		if (it->kind == PCUT_KIND_TESTSUITE)
+		if (it->kind == PCUT_KIND_TESTSUITE) {
 			return it;
-		
+		}
 		it = it->previous;
 	}
-	
 	init_default_suite_when_needed();
 	return &default_suite;
@@ -109,8 +106,8 @@
  * @param func Function to run (can be NULL).
  */
-static void run_setup_teardown(pcut_setup_func_t func)
-{
-	if (func != NULL)
+static void run_setup_teardown(pcut_setup_func_t func) {
+	if (func != NULL) {
 		func();
+	}
 }
 
@@ -122,11 +119,11 @@
  * @param outcome Outcome of the current test.
  */
-static void leave_test(int outcome)
-{
+static void leave_test(int outcome) {
 	PCUT_DEBUG("leave_test(outcome=%d), will_exit=%s", outcome,
-	    leave_means_exit ? "yes" : "no");
-	if (leave_means_exit)
+		leave_means_exit ? "yes" : "no");
+	if (leave_means_exit) {
 		exit(outcome);
-	
+	}
+
 #ifndef PCUT_NO_LONG_JUMP
 	longjmp(start_test_jump, 1);
@@ -141,8 +138,6 @@
  * @param message Message describing the failure.
  */
-void pcut_failed_assertion(const char *message)
-{
+void pcut_failed_assertion(const char *message) {
 	static const char *prev_message = NULL;
-	
 	/*
 	 * The assertion failed. We need to abort the current test,
@@ -150,27 +145,28 @@
 	 * include running the tear-down routine.
 	 */
-	if (print_test_error)
+	if (print_test_error) {
 		pcut_print_fail_message(message);
-	
+	}
+
 	if (execute_teardown_on_failure) {
 		execute_teardown_on_failure = 0;
 		prev_message = message;
 		run_setup_teardown(current_suite->teardown_func);
-		
+
 		/* Tear-down was okay. */
 		if (report_test_result) {
-			pcut_report_test_done(current_test, TEST_OUTCOME_FAIL,
+			pcut_report_test_done(current_test, PCUT_OUTCOME_FAIL,
 				message, NULL, NULL);
 		}
 	} else {
 		if (report_test_result) {
-			pcut_report_test_done(current_test, TEST_OUTCOME_FAIL,
+			pcut_report_test_done(current_test, PCUT_OUTCOME_FAIL,
 				prev_message, message, NULL);
 		}
 	}
-	
+
 	prev_message = NULL;
-	
-	leave_test(TEST_OUTCOME_FAIL); /* No return. */
+
+	leave_test(PCUT_OUTCOME_FAIL); /* No return. */
 }
 
@@ -180,6 +176,5 @@
  * @return Error status (zero means success).
  */
-static int run_test(pcut_item_t *test)
-{
+static int run_test(pcut_item_t *test) {
 	/*
 	 * Set here as the returning point in case of test failure.
@@ -187,19 +182,20 @@
 	 * test execution.
 	 */
-	
 #ifndef PCUT_NO_LONG_JUMP
 	int test_finished = setjmp(start_test_jump);
-	if (test_finished)
-		return 1;
+	if (test_finished) {
+		return PCUT_OUTCOME_FAIL;
+	}
 #endif
-	
-	if (report_test_result)
+
+	if (report_test_result) {
 		pcut_report_test_start(test);
-	
+	}
+
 	current_suite = pcut_find_parent_suite(test);
 	current_test = test;
-	
+
 	pcut_hook_before_test(test);
-	
+
 	/*
 	 * If anything goes wrong, execute the tear-down function
@@ -207,10 +203,10 @@
 	 */
 	execute_teardown_on_failure = 1;
-	
+
 	/*
 	 * Run the set-up function.
 	 */
 	run_setup_teardown(current_suite->setup_func);
-	
+
 	/*
 	 * The setup function was performed, it is time to run
@@ -218,5 +214,5 @@
 	 */
 	test->test_func();
-	
+
 	/*
 	 * Finally, run the tear-down function. We need to clear
@@ -225,14 +221,15 @@
 	execute_teardown_on_failure = 0;
 	run_setup_teardown(current_suite->teardown_func);
-	
+
 	/*
 	 * If we got here, it means everything went well with
 	 * this test.
 	 */
-	if (report_test_result)
-		pcut_report_test_done(current_test, TEST_OUTCOME_PASS,
-		    NULL, NULL, NULL);
-	
-	return 0;
+	if (report_test_result) {
+		pcut_report_test_done(current_test, PCUT_OUTCOME_PASS,
+			NULL, NULL, NULL);
+	}
+
+	return PCUT_OUTCOME_PASS;
 }
 
@@ -245,15 +242,16 @@
  * @return Error status (zero means success).
  */
-int pcut_run_test_forked(pcut_item_t *test)
-{
+int pcut_run_test_forked(pcut_item_t *test) {
+	int rc;
+
 	report_test_result = 0;
 	print_test_error = 1;
 	leave_means_exit = 1;
-	
-	int rc = run_test(test);
-	
+
+	rc = run_test(test);
+
 	current_test = NULL;
 	current_suite = NULL;
-	
+
 	return rc;
 }
@@ -267,15 +265,16 @@
  * @return Error status (zero means success).
  */
-int pcut_run_test_single(pcut_item_t *test)
-{
+int pcut_run_test_single(pcut_item_t *test) {
+	int rc;
+
 	report_test_result = 1;
 	print_test_error = 0;
 	leave_means_exit = 0;
-	
-	int rc = run_test(test);
-	
+
+	rc = run_test(test);
+
 	current_test = NULL;
 	current_suite = NULL;
-	
+
 	return rc;
 }
@@ -286,16 +285,16 @@
  * @return Timeout in seconds.
  */
-int pcut_get_test_timeout(pcut_item_t *test)
-{
+int pcut_get_test_timeout(pcut_item_t *test) {
 	int timeout = PCUT_DEFAULT_TEST_TIMEOUT;
 	pcut_extra_t *extras = test->extras;
-	
+
+
 	while (extras->type != PCUT_EXTRA_LAST) {
-		if (extras->type == PCUT_EXTRA_TIMEOUT)
+		if (extras->type == PCUT_EXTRA_TIMEOUT) {
 			timeout = extras->timeout;
-		
+		}
 		extras++;
 	}
-	
+
 	return timeout;
 }
