nlib
testing.h
[詳解]
1 
2 #pragma once
3 #ifndef INCLUDE_NN_NLIB_TESTING_TESTING_H_
4 #define INCLUDE_NN_NLIB_TESTING_TESTING_H_
5 
6 #include "nn/nlib/Config.h"
7 
8 #ifndef NLIB_USE_GTEST
10 #include "nn/nlib/testing/Pred.h"
14 
15 namespace testing = ::nlib_ns::testing;
16 NLIB_NAMESPACE_BEGIN
17 namespace testing {
18 inline void InitGoogleTest(int* argc, char** argv) { InitNintendoTest(argc, argv); }
19 inline void InitGoogleTest(int* argc, wchar_t** argv) { InitNintendoTest(argc, argv); }
20 #define NLIB_TESTING_OSTREAM ::nlib_ns::testing::detail_func::DummyStream
21 } // namespace testing
22 NLIB_NAMESPACE_END
23 #else
24 // See: https://code.google.com/p/googletest/
25 #include "gtest/gtest.h"
26 
27 #define NLIB_TESTING_OSTREAM std::ostream
28 namespace testing {
29 inline void InitNintendoTest(int* argc, char** argv) { InitGoogleTest(argc, argv); }
30 inline void InitNintendoTest(int* argc, wchar_t** argv) { InitGoogleTest(argc, argv); }
31 }
32 
33 #endif
34 
35 #endif // INCLUDE_NN_NLIB_TESTING_TESTING_H_
テスト失敗時の表示を制御します。
値をパラメータ化したテストを定義しています。
void InitNintendoTest(int *argc, char **argv)
テストプログラムのコマンドラインオプションを処理します。
型付けテストを定義しています。
開発環境別の設定が書かれるファイルです。
基本的な単体テスト用マクロが定義されています。
述語アサーションが定義されています。