diff --git a/.travis.yml b/.travis.yml
index d08357bdcd722e55e452b0755f035249c1fa0e0b..ca2aee8f96d5bd50741d45f1cc6f07083480323b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -75,7 +75,7 @@ script:
   - if test "$PLUMED_CXX" ; then make -C regtest $OPT ; fi
   - if test "$MAKEDOC" == yes ; then make -C regtest copytodoc ; fi
   - if test "$MAKEDOC" == yes ; then make doc >/dev/null ; fi
-  - if test "$MAKEDOC" == yes ; then make -C regtest checkfail ; fi
+  - if test "$PLUMED_CXX" ; then make -C regtest checkfail ; fi
 
 # CPPCHECK:
 # this is required so as to have all the include files inplace: