1 /*
2 -------------------------------------------------------------------------
3  CxxTest: A lightweight C++ unit testing library.
4  Copyright (c) 2008 Sandia Corporation.
5  This software is distributed under the LGPL License v3
6  For more information, see the COPYING file in the top CxxTest directory.
7  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8  the U.S. Government retains certain rights in this software.
9 -------------------------------------------------------------------------
10 */
11 
12 #ifndef __cxxtest__MSVCErrorPrinter_h__
13 #define __cxxtest__MSVCErrorPrinter_h__
14 
15 //
16 // The MSVCErrorPrinter is identical to the ErrorPrinter, except it
17 // prints the line number and error/warning strings in a format
18 // consistent with that generated by Microsoft's compiler.
19 //
20 // Strict error parsers (e.g. QtCreator's) expect each error to be
21 // followed by a proper-looking error code, so give them one to make
22 // them work. Same for warnings.
23 //
24 // C2999 : "Unknown error" from Visual Studio 6, no longer used.
25 // C4999 : "Unknown warning" from Visual Studio 6, no longer used.
26 //
27 
28 #include <cxxtest/ErrorPrinter.h>
29 
30 namespace CxxTest
31 {
32 class MSVCErrorPrinter : public ErrorPrinter
33 {
34 public:
CXXTEST_STD(ostream)35     MSVCErrorPrinter(CXXTEST_STD(ostream) &o = CXXTEST_STD(cout))
36         : ErrorPrinter(o, "(", ") ", "error C2999", "warning C4999") {}
37 };
38 }
39 
40 #endif // __cxxtest__MSVCErrorPrinter_h__
41