Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: exit 1 on failure

In case this ever gets scripted, it should return 0 on success and 1 on
failure. Parsing the output should be left to meatbags.

Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Joern Engel and committed by
Linus Torvalds
51a1d165 0786f7b2

+6 -1
+1 -1
tools/testing/selftests/vm/Makefile
··· 8 8 $(CC) $(CFLAGS) -o $@ $^ 9 9 10 10 run_tests: all 11 - @/bin/sh ./run_vmtests || echo "vmtests: [FAIL]" 11 + @/bin/sh ./run_vmtests || (echo "vmtests: [FAIL]"; exit 1) 12 12 13 13 clean: 14 14 $(RM) hugepage-mmap hugepage-shm map_hugetlb
+5
tools/testing/selftests/vm/run_vmtests
··· 4 4 #we need 256M, below is the size in kB 5 5 needmem=262144 6 6 mnt=./huge 7 + exitcode=0 7 8 8 9 #get pagesize and freepages from /proc/meminfo 9 10 while read name size unit; do ··· 42 41 ./hugepage-mmap 43 42 if [ $? -ne 0 ]; then 44 43 echo "[FAIL]" 44 + exitcode=1 45 45 else 46 46 echo "[PASS]" 47 47 fi ··· 57 55 ./hugepage-shm 58 56 if [ $? -ne 0 ]; then 59 57 echo "[FAIL]" 58 + exitcode=1 60 59 else 61 60 echo "[PASS]" 62 61 fi ··· 70 67 ./map_hugetlb 71 68 if [ $? -ne 0 ]; then 72 69 echo "[FAIL]" 70 + exitcode=1 73 71 else 74 72 echo "[PASS]" 75 73 fi ··· 79 75 umount $mnt 80 76 rm -rf $mnt 81 77 echo $nr_hugepgs > /proc/sys/vm/nr_hugepages 78 + exit $exitcode