Report skipped tests in the results.

- Keep track of the tests which are skipped because they're known to fail.
- Moved multithreading code in a separate module so it can be re-used.
- Keep track of the tests which are skipped because the CPU is missing features.
- Added --verbose mode

Change-Id: I8832a1ac10738461eb5f4740e8bf060f13866132
diff --git a/tools/known_test_failures.py b/tools/known_test_failures.py
index ad7ff1b..262d6e6 100644
--- a/tools/known_test_failures.py
+++ b/tools/known_test_failures.py
@@ -45,8 +45,8 @@
   if major > 3 or (major == 3 and minor > 10):
     return tests
 
-  # Valgrind versions before 3.11 have issues with fused multiply-add,
-  # so disable the affected tests.
+  reason = "Valgrind versions before 3.11 have issues with fused multiply-add, " \
+           "so disable the affected tests."
   known_valgrind_test_failures = {
     'AARCH64_SIM_fmadd_d',
     'AARCH64_SIM_fmadd_s',
@@ -76,13 +76,13 @@
     'AARCH64_SIM_frsqrts_D'
   }
 
-  for t in sorted(known_valgrind_test_failures):
-    print('Skipping ' + t + '...')
-
-  return filter(lambda x: x not in known_valgrind_test_failures, tests)
+  filtered_list = filter(lambda x: x not in known_valgrind_test_failures, tests)
+  return (filtered_list, len(tests) - len(filtered_list), reason)
 
 def FilterKnownTestFailures(tests, **env):
+  skipped = []
   if env.get('under_valgrind'):
-    tests = FilterKnownValgrindTestFailures(tests)
+    tests, n_tests_skipped, reason = FilterKnownValgrindTestFailures(tests)
+    skipped.append( (n_tests_skipped, reason) )
 
-  return tests
+  return (tests, skipped)