kselftest: Report externally skipped tests as skipped

When removing tests from the kselftest runner, also include them in
result.txt as having been skipped.

Signed-off-by: Kees Cook <keescook@chromium.org>
diff --git a/automated/linux/kselftest/kselftest.sh b/automated/linux/kselftest/kselftest.sh
index 229292f..50fd4d3 100755
--- a/automated/linux/kselftest/kselftest.sh
+++ b/automated/linux/kselftest/kselftest.sh
@@ -143,7 +143,7 @@
         }
 	print "$test $result\n";
     }
-' "${LOGFILE}" > "${RESULT_FILE}"
+' "${LOGFILE}" >> "${RESULT_FILE}"
 }
 
 install() {
@@ -197,16 +197,22 @@
 echo "skiplist:"
 while read -r skip_regex; do
 	echo "${skip_regex}"
-	perl -pi.orig -e '
+	perl -pi -e '
 # Discover top-level test directory from: cd TESTDIR
 $testdir=$1 if m|^cd ([^\$]+)\b|;
 # Process each test from: \t"TESTNAME"
 if (m|^\t"([^"]+)"|) {
-	$test=$1;
+	$test = $1;
 	# If the test_regex matches TESTDIR/TESTNAME,
 	# remove it from the run script.
-	if ("$testdir/$test" =~ m|^'"${skip_regex}"'$|) {
+	$name = "$testdir/$test";
+	if ("$name" =~ m|^'"${skip_regex}"'$|) {
 		s|^\t"[^"]+"|\t|;
+		$name =~ s|/|.|g;
+		# Record each skipped test as having been skipped.
+		open(my $fd, ">>'"${RESULT_FILE}"'");
+		print $fd "$name skip\n";
+		close($fd);
 	}
 }' run_kselftest.sh
 done < "${skips}"