From 9b5a7635389d22fd9cfb9da6b1a47af815a96093 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 16 Feb 2016 17:29:06 +0100 Subject: [PATCH] sanity: fix race conditions in the test suite * tests/sanity/80columns.test, tests/sanity/includes.test, tests/sanity/private.test, tests/sanity/style.test: Have each test record failure in a separate file. --- tests/sanity/80columns.test | 12 ++++++------ tests/sanity/includes.test | 10 +++++----- tests/sanity/private.test | 10 +++++----- tests/sanity/style.test | 12 ++++++------ 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/sanity/80columns.test b/tests/sanity/80columns.test index cfab94180..c1d297843 100755 --- a/tests/sanity/80columns.test +++ b/tests/sanity/80columns.test @@ -1,6 +1,6 @@ #! /bin/sh # -*- coding: utf-8 -*- -# Copyright (C) 2012 Laboratoire de Recherche et Développement de +# Copyright (C) 2012, 2016 Laboratoire de Recherche et Développement de # l'Epita (LRDE). # Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 # (LIP6), département Systèmes Répartis Coopératifs (SRC), Université @@ -25,7 +25,7 @@ set -e -rm -f failures +rm -f failures.80 LANG=en_US.UTF-8 export LANG @@ -55,15 +55,15 @@ for dir in "${srcdir-.}/../../spot" "${srcdir-.}/.."; do grep 'generated by flex' "$file" >/dev/null ; then : else - echo "$file" >>failures + echo "$file" >>failures.80 fi fi done done -if test -f failures; then +if test -f failures.80; then echo "The following files contain lines with more than 80 characters:" - cat failures - rm failures + cat failures.80 + rm failures.80 exit 1; fi diff --git a/tests/sanity/includes.test b/tests/sanity/includes.test index efd74505f..a37e1b3d8 100755 --- a/tests/sanity/includes.test +++ b/tests/sanity/includes.test @@ -25,7 +25,7 @@ set -e -rm -f failures +rm -f failures.inc INCDIR=${srcdir-.}/../../spot @@ -45,15 +45,15 @@ for file in `find "$INCDIR" \( -name "${1-*}.hh" \ else echo "Missing, or incorrect include guard." >&2 echo "FAIL: $file" - echo " $file" >> failures + echo " $file" >> failures.inc continue fi echo "PASS: $file" done -if test -f failures; then +if test -f failures.inc; then echo "Failed files:" - cat failures - rm failures + cat failures.inc + rm failures.inc exit 1; fi diff --git a/tests/sanity/private.test b/tests/sanity/private.test index ba0d658f9..8e10605de 100755 --- a/tests/sanity/private.test +++ b/tests/sanity/private.test @@ -25,7 +25,7 @@ set -e -rm -f failures +rm -f failures.private INCDIR=${srcdir-.}/../../spot @@ -41,15 +41,15 @@ for file in `find "$INCDIR" \( -name "${1-*}.hh" \ : elif test -f "$INCDIR/${file%.*}.cc"; then echo "FAIL: $file -- no exported symbol, should this file be private?" - echo " $file" >> failures + echo " $file" >> failures.private fi ;; esac done -if test -f failures; then +if test -f failures.private; then echo "Failed files:" - cat failures - rm failures + cat failures.private + rm failures.private exit 1 fi diff --git a/tests/sanity/style.test b/tests/sanity/style.test index 5bd975f37..7ca9a2a1d 100755 --- a/tests/sanity/style.test +++ b/tests/sanity/style.test @@ -32,7 +32,7 @@ diag() echo ============================================================ } -rm -f failures +rm -f failures.style GREP=grep @@ -324,7 +324,7 @@ for dir in "$TOP/spot" "$TOP/bin" "$TOP/tests"; do esac - $fail && echo "$file" >>failures + $fail && echo "$file" >>failures.style done || : # Make sure sh does not abort when read exits with false. done @@ -346,14 +346,14 @@ for dir in "${INCDIR-..}" "${INCDIR-..}/../bin" "${INCDIR-..}/../tests"; do $GREP '\.libs/' $tmp && diag "Don't reference files in .libs/, use Libtool instead." - $fail && echo "$file" >>failures + $fail && echo "$file" >>failures.style done || : # Make sure sh does not abort when read exits with false. done -if test -f failures; then +if test -f failures.style; then echo "The following files contain style errors:" - cat failures - rm failures + cat failures.style + rm failures.style exit 1; fi