From 7f91c6d8971c2d47df409a827f577890f3800ddf Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Mon, 9 Oct 2017 20:21:22 -0700 Subject: [PATCH 1/2] count ignores I don't like having to compare the number of tests and ignores manually, so this script helps with that. If we like, we can run this in CI, after fixing the current problems. If so, then it would have closed (but doesn't close) #352. --- _test/count-ignores.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 _test/count-ignores.sh diff --git a/_test/count-ignores.sh b/_test/count-ignores.sh new file mode 100644 index 000000000..cf180dd67 --- /dev/null +++ b/_test/count-ignores.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +dir=$(dirname $(dirname $0)) +exitcode=0 + +for t in $dir/exercises/*/tests/*.rs; do + tests=$(grep "^\s*\#\[test\]" $t | wc -l | tr -d '[:space:]') + ignores=$(grep "^\s*\#\[ignore\]" $t | wc -l | tr -d '[:space:]') + want_ignores=$(expr $tests - 1) + if [ "$ignores" != "$want_ignores" ]; then + echo "\033[1;31m$t: Has $tests tests and $ignores ignores (should be $want_ignores)\033[0m" + exitcode=1 + fi +done + +exit $exitcode From 82bf0882afd568a979f1ffeecd0a8783314fd416 Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Sat, 14 Oct 2017 06:58:58 -0700 Subject: [PATCH 2/2] travis: Run count-ignores Closes https://github.com/exercism/rust/issues/352 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 94e24dca2..280ac044f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: rust script: - "./_test/check-exercises.sh" +- "sh ./_test/count-ignores.sh" - "./bin/fetch-configlet" - "./bin/configlet lint ." sudo: false