diff --git a/test/test64bit.cpp b/test/test64bit.cpp index 9fbe4b653..859636fae 100644 --- a/test/test64bit.cpp +++ b/test/test64bit.cpp @@ -16,13 +16,10 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "check64bit.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class Test64BitPortability : public TestFixture { public: diff --git a/test/testassert.cpp b/test/testassert.cpp index ecdbb7727..2653fedd2 100644 --- a/test/testassert.cpp +++ b/test/testassert.cpp @@ -19,9 +19,7 @@ #include "tokenize.h" #include "checkassert.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestAssert : public TestFixture { public: diff --git a/test/testautovariables.cpp b/test/testautovariables.cpp index 66507cce5..223b2a5ac 100644 --- a/test/testautovariables.cpp +++ b/test/testautovariables.cpp @@ -16,14 +16,10 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "checkautovariables.h" #include "testsuite.h" -#include - -extern std::ostringstream errout; class TestAutoVariables : public TestFixture { public: diff --git a/test/testbool.cpp b/test/testbool.cpp index 4a8821d13..8a2cfba37 100644 --- a/test/testbool.cpp +++ b/test/testbool.cpp @@ -16,13 +16,10 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "checkbool.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestBool : public TestFixture { public: diff --git a/test/testboost.cpp b/test/testboost.cpp index 849617468..983d9e7e9 100644 --- a/test/testboost.cpp +++ b/test/testboost.cpp @@ -16,14 +16,10 @@ * along with this program. If not, see . */ - - #include "tokenize.h" #include "checkboost.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestBoost : public TestFixture { public: diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index f1ba7ba71..170c72236 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -16,16 +16,13 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "checkbufferoverrun.h" #include "testsuite.h" #include -#include #include -extern std::ostringstream errout; class TestBufferOverrun : public TestFixture { public: diff --git a/test/testcharvar.cpp b/test/testcharvar.cpp index c15ef34ae..930095f2c 100644 --- a/test/testcharvar.cpp +++ b/test/testcharvar.cpp @@ -16,13 +16,10 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "checkother.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestCharVar : public TestFixture { public: diff --git a/test/testclass.cpp b/test/testclass.cpp index beafd1e3e..40d655da9 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -16,15 +16,11 @@ * along with this program. If not, see . */ - - #include "tokenize.h" #include "checkclass.h" #include "testsuite.h" -#include #include -extern std::ostringstream errout; class TestClass : public TestFixture { public: diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index 512ae0c08..61630d3e9 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -22,6 +22,7 @@ #include "redirect.h" #include "timer.h" + class TestCmdlineParser : public TestFixture { public: TestCmdlineParser() diff --git a/test/testcondition.cpp b/test/testcondition.cpp index affa7a00c..37af7b22d 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -16,14 +16,11 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "checkcondition.h" #include "testsuite.h" -#include #include -extern std::ostringstream errout; class TestCondition : public TestFixture { public: diff --git a/test/testconstructors.cpp b/test/testconstructors.cpp index a33b14635..c96cd63e4 100644 --- a/test/testconstructors.cpp +++ b/test/testconstructors.cpp @@ -16,14 +16,10 @@ * along with this program. If not, see . */ - - #include "tokenize.h" #include "checkclass.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestConstructors : public TestFixture { public: diff --git a/test/testcppcheck.cpp b/test/testcppcheck.cpp index fc8a94e95..65749606c 100644 --- a/test/testcppcheck.cpp +++ b/test/testcppcheck.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ - #include "cppcheck.h" #include "cppcheckexecutor.h" #include "testsuite.h" @@ -27,8 +26,6 @@ #include #include -extern std::ostringstream errout; -extern std::ostringstream output; class TestCppcheck : public TestFixture { public: diff --git a/test/testerrorlogger.cpp b/test/testerrorlogger.cpp index 8c0d6e6f3..c35f7edc1 100644 --- a/test/testerrorlogger.cpp +++ b/test/testerrorlogger.cpp @@ -21,6 +21,7 @@ #include "testsuite.h" #include "errorlogger.h" + class TestErrorLogger : public TestFixture { public: TestErrorLogger() : TestFixture("TestErrorLogger"), fooCpp5("foo.cpp", 5), barCpp8("bar.cpp", 8) { diff --git a/test/testexceptionsafety.cpp b/test/testexceptionsafety.cpp index 91ff6ec12..631899372 100644 --- a/test/testexceptionsafety.cpp +++ b/test/testexceptionsafety.cpp @@ -16,13 +16,10 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "checkexceptionsafety.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestExceptionSafety : public TestFixture { public: diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 7011801f6..aa31ab37b 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -22,8 +22,6 @@ #include "settings.h" #include "check.h" -extern std::ostringstream errout; - class TestGarbage : public TestFixture { public: diff --git a/test/testincompletestatement.cpp b/test/testincompletestatement.cpp index fc3052526..cf4b93688 100644 --- a/test/testincompletestatement.cpp +++ b/test/testincompletestatement.cpp @@ -16,18 +16,10 @@ * along with this program. If not, see . */ - - -// Check for unused variables.. - - #include "testsuite.h" #include "tokenize.h" #include "checkother.h" -#include - -extern std::ostringstream errout; class TestIncompleteStatement : public TestFixture { public: diff --git a/test/testinternal.cpp b/test/testinternal.cpp index 505dfb768..0268274f8 100644 --- a/test/testinternal.cpp +++ b/test/testinternal.cpp @@ -21,9 +21,7 @@ #include "tokenize.h" #include "checkinternal.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestInternal : public TestFixture { public: diff --git a/test/testio.cpp b/test/testio.cpp index 449e34d6b..33b700a32 100644 --- a/test/testio.cpp +++ b/test/testio.cpp @@ -19,9 +19,7 @@ #include "checkio.h" #include "testsuite.h" #include "tokenize.h" -#include -extern std::ostringstream errout; class TestIO : public TestFixture { public: diff --git a/test/testleakautovar.cpp b/test/testleakautovar.cpp index 93c823caa..41c89871f 100644 --- a/test/testleakautovar.cpp +++ b/test/testleakautovar.cpp @@ -16,13 +16,10 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "checkleakautovar.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestLeakAutoVar : public TestFixture { public: diff --git a/test/testlibrary.cpp b/test/testlibrary.cpp index 05fe37202..596d2a216 100644 --- a/test/testlibrary.cpp +++ b/test/testlibrary.cpp @@ -22,6 +22,7 @@ #include "testsuite.h" #include + class TestLibrary : public TestFixture { public: TestLibrary() : TestFixture("TestLibrary") { } diff --git a/test/testmathlib.cpp b/test/testmathlib.cpp index 92530842f..aa000a0f0 100644 --- a/test/testmathlib.cpp +++ b/test/testmathlib.cpp @@ -16,11 +16,10 @@ * along with this program. If not, see . */ - - #include "mathlib.h" #include "testsuite.h" + class TestMathLib : public TestFixture { public: TestMathLib() : TestFixture("TestMathLib") { diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index d7baf0b40..a5a2e3794 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -16,17 +16,12 @@ * along with this program. If not, see . */ - - #include "tokenize.h" #include "tokenlist.h" #include "checkmemoryleak.h" #include "testsuite.h" #include "symboldatabase.h" #include "preprocessor.h" -#include - -extern std::ostringstream errout; class TestMemleak : private TestFixture { diff --git a/test/testnonreentrantfunctions.cpp b/test/testnonreentrantfunctions.cpp index 59384a4e5..d29b1aee4 100644 --- a/test/testnonreentrantfunctions.cpp +++ b/test/testnonreentrantfunctions.cpp @@ -16,14 +16,10 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "checknonreentrantfunctions.h" #include "testsuite.h" -#include - -extern std::ostringstream errout; class TestNonReentrantFunctions : public TestFixture { public: diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index 1e0099024..997e87941 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -19,10 +19,8 @@ #include "tokenize.h" #include "checknullpointer.h" #include "testsuite.h" -#include #include -extern std::ostringstream errout; class TestNullPointer : public TestFixture { public: diff --git a/test/testobsolescentfunctions.cpp b/test/testobsolescentfunctions.cpp index 50978efdc..5065b94e8 100644 --- a/test/testobsolescentfunctions.cpp +++ b/test/testobsolescentfunctions.cpp @@ -16,14 +16,10 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "checkobsolescentfunctions.h" #include "testsuite.h" -#include - -extern std::ostringstream errout; class TestObsoleteFunctions : public TestFixture { public: diff --git a/test/testoptions.cpp b/test/testoptions.cpp index 76bf03548..e62e66d28 100644 --- a/test/testoptions.cpp +++ b/test/testoptions.cpp @@ -16,9 +16,7 @@ #include "options.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestOptions: public TestFixture { public: diff --git a/test/testother.cpp b/test/testother.cpp index 6bf57ad9e..4d4149e1f 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -22,10 +22,8 @@ #include "checkother.h" #include "testsuite.h" #include "testutils.h" -#include #include -extern std::ostringstream errout; class TestOther : public TestFixture { public: diff --git a/test/testpathmatch.cpp b/test/testpathmatch.cpp index a5c646b78..49f8f7085 100644 --- a/test/testpathmatch.cpp +++ b/test/testpathmatch.cpp @@ -21,6 +21,7 @@ #include "testsuite.h" #include "pathmatch.h" + class TestPathMatch : public TestFixture { public: TestPathMatch() diff --git a/test/testpostfixoperator.cpp b/test/testpostfixoperator.cpp index d9c9ed981..44a2248dc 100644 --- a/test/testpostfixoperator.cpp +++ b/test/testpostfixoperator.cpp @@ -16,14 +16,10 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "checkpostfixoperator.h" #include "testsuite.h" -#include - -extern std::ostringstream errout; class TestPostfixOperator : public TestFixture { public: diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 1594bf49c..53a3f73cb 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -29,11 +29,8 @@ #include #include -#include #include -extern std::ostringstream errout; -extern std::ostringstream output; #ifdef _MSC_VER // Visual Studio complains about truncated values for '(char)0xff' and '(char)0xfe' diff --git a/test/testsamples.cpp b/test/testsamples.cpp index 41b722bad..0b060dfa5 100644 --- a/test/testsamples.cpp +++ b/test/testsamples.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ - #include "filelister.h" #include "testsuite.h" #include "cppcheckexecutor.h" diff --git a/test/testsimplifytemplate.cpp b/test/testsimplifytemplate.cpp index 6f5d29b6c..7917cbf51 100644 --- a/test/testsimplifytemplate.cpp +++ b/test/testsimplifytemplate.cpp @@ -22,10 +22,6 @@ #include "settings.h" #include "templatesimplifier.h" -#include - -extern std::ostringstream errout; - class TestSimplifyTemplate : public TestFixture { public: diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index b44db7bb5..a5a94bdb5 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -21,10 +21,6 @@ #include "token.h" #include "settings.h" -#include - -extern std::ostringstream errout; - class TestSimplifyTokens : public TestFixture { public: diff --git a/test/testsimplifytypedef.cpp b/test/testsimplifytypedef.cpp index 99f0fb9bc..10dc4c6e8 100644 --- a/test/testsimplifytypedef.cpp +++ b/test/testsimplifytypedef.cpp @@ -21,10 +21,6 @@ #include "token.h" #include "settings.h" -#include - -extern std::ostringstream errout; - class TestSimplifyTypedef : public TestFixture { public: diff --git a/test/testsizeof.cpp b/test/testsizeof.cpp index 0f0af3ad6..3f9e3753c 100644 --- a/test/testsizeof.cpp +++ b/test/testsizeof.cpp @@ -16,13 +16,10 @@ * along with this program. If not, see . */ - #include "tokenize.h" #include "checksizeof.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestSizeof : public TestFixture { public: diff --git a/test/teststl.cpp b/test/teststl.cpp index 90159e1bf..be2d448c4 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -16,14 +16,10 @@ * along with this program. If not, see . */ - - #include "tokenize.h" #include "checkstl.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestStl : public TestFixture { public: diff --git a/test/teststring.cpp b/test/teststring.cpp index b625402b5..96db7cc6a 100644 --- a/test/teststring.cpp +++ b/test/teststring.cpp @@ -22,9 +22,7 @@ #include "testsuite.h" #include "preprocessor.h" #include "testutils.h" -#include -extern std::ostringstream errout; class TestString : public TestFixture { public: diff --git a/test/testsuite.h b/test/testsuite.h index 4dc4c5b4c..e84f58585 100644 --- a/test/testsuite.h +++ b/test/testsuite.h @@ -80,6 +80,10 @@ public: static std::size_t runTests(const options& args); }; +extern std::ostringstream errout; +extern std::ostringstream output; +extern std::ostringstream warnings; + #define TEST_CASE( NAME ) if ( prepareTest(#NAME) ) { NAME(); } #define ASSERT( CONDITION ) assert_(__FILE__, __LINE__, CONDITION) #define ASSERT_EQUALS( EXPECTED , ACTUAL ) assertEquals(__FILE__, __LINE__, EXPECTED, ACTUAL) diff --git a/test/testsuppressions.cpp b/test/testsuppressions.cpp index 5843bfc7a..c2b86669c 100644 --- a/test/testsuppressions.cpp +++ b/test/testsuppressions.cpp @@ -24,9 +24,7 @@ #include #include -#include -extern std::ostringstream errout; class TestSuppressions : public TestFixture { public: diff --git a/test/testthreadexecutor.cpp b/test/testthreadexecutor.cpp index fcf5ceec2..4fe829026 100644 --- a/test/testthreadexecutor.cpp +++ b/test/testthreadexecutor.cpp @@ -25,8 +25,6 @@ #include #include -extern std::ostringstream errout; -extern std::ostringstream output; class TestThreadExecutor : public TestFixture { public: diff --git a/test/testtimer.cpp b/test/testtimer.cpp index 8fa24b397..dd2285052 100644 --- a/test/testtimer.cpp +++ b/test/testtimer.cpp @@ -16,12 +16,11 @@ * along with this program. If not, see . */ - - #include "timer.h" #include "testsuite.h" #include + class TestTimer : public TestFixture { public: TestTimer() : TestFixture("TestTimer") { diff --git a/test/testtoken.cpp b/test/testtoken.cpp index 29fb1bf4f..f0a693e5f 100644 --- a/test/testtoken.cpp +++ b/test/testtoken.cpp @@ -24,7 +24,7 @@ #include #include -extern std::ostringstream errout; + class TestToken : public TestFixture { public: TestToken() : TestFixture("TestToken") { diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 193630159..85b864bca 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -24,8 +24,6 @@ #include "preprocessor.h" // usually tests here should not use preprocessor... #include -extern std::ostringstream errout; - class TestTokenizer : public TestFixture { public: diff --git a/test/testtype.cpp b/test/testtype.cpp index 398afc53e..b56014208 100644 --- a/test/testtype.cpp +++ b/test/testtype.cpp @@ -22,10 +22,8 @@ #include "checktype.h" #include "testsuite.h" #include "testutils.h" -#include #include -extern std::ostringstream errout; class TestType : public TestFixture { public: diff --git a/test/testuninitvar.cpp b/test/testuninitvar.cpp index 5ed37fd4c..155340afe 100644 --- a/test/testuninitvar.cpp +++ b/test/testuninitvar.cpp @@ -19,9 +19,7 @@ #include "tokenize.h" #include "checkuninitvar.h" #include "testsuite.h" -#include -extern std::ostringstream errout; class TestUninitVar : public TestFixture { public: diff --git a/test/testunusedfunctions.cpp b/test/testunusedfunctions.cpp index 6a3f18aff..df90198a2 100644 --- a/test/testunusedfunctions.cpp +++ b/test/testunusedfunctions.cpp @@ -20,9 +20,7 @@ #include "tokenize.h" #include "testsuite.h" #include "checkunusedfunctions.h" -#include -extern std::ostringstream errout; class TestUnusedFunctions : public TestFixture { public: @@ -31,7 +29,6 @@ public: private: - void run() { TEST_CASE(incondition); TEST_CASE(return1); diff --git a/test/testunusedprivfunc.cpp b/test/testunusedprivfunc.cpp index b683627de..d31cc22ef 100644 --- a/test/testunusedprivfunc.cpp +++ b/test/testunusedprivfunc.cpp @@ -21,9 +21,6 @@ #include "checkclass.h" #include "testsuite.h" -#include - -extern std::ostringstream errout; class TestUnusedPrivateFunction : public TestFixture { public: diff --git a/test/testunusedvar.cpp b/test/testunusedvar.cpp index e7d861925..790cdf196 100644 --- a/test/testunusedvar.cpp +++ b/test/testunusedvar.cpp @@ -16,16 +16,10 @@ * along with this program. If not, see . */ - - -// Check for unused variables.. - #include "testsuite.h" #include "tokenize.h" #include "checkunusedvar.h" -#include -extern std::ostringstream errout; class TestUnusedVar : public TestFixture { public: diff --git a/test/testvaarg.cpp b/test/testvaarg.cpp index e6dc84139..23c4a8daa 100644 --- a/test/testvaarg.cpp +++ b/test/testvaarg.cpp @@ -19,9 +19,7 @@ #include "testsuite.h" #include "checkvaarg.h" #include "tokenize.h" -#include -extern std::ostringstream errout; class TestVaarg : public TestFixture { public: diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index 99a0d95bc..fa482de78 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -25,7 +25,7 @@ #include #include -extern std::ostringstream errout; + class TestValueFlow : public TestFixture { public: TestValueFlow() : TestFixture("TestValueFlow") { diff --git a/test/testvarid.cpp b/test/testvarid.cpp index 9ef96ddb8..3634ec872 100644 --- a/test/testvarid.cpp +++ b/test/testvarid.cpp @@ -21,10 +21,6 @@ #include "token.h" #include "settings.h" -#include - -extern std::ostringstream errout; - class TestVarID : public TestFixture { public: