Mercurial > hg > orthanc
comparison UnitTestsSources/UnitTestsMain.cpp @ 1485:27661b33f624
Creation of Logging.h
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 04 Aug 2015 09:35:09 +0200 |
parents | f3672356c121 |
children | 9f66a12eb8fc |
comparison
equal
deleted
inserted
replaced
1484:b64f48e19ab9 | 1485:27661b33f624 |
---|---|
38 #include <ctype.h> | 38 #include <ctype.h> |
39 | 39 |
40 #include "../Core/Compression/ZlibCompressor.h" | 40 #include "../Core/Compression/ZlibCompressor.h" |
41 #include "../Core/DicomFormat/DicomTag.h" | 41 #include "../Core/DicomFormat/DicomTag.h" |
42 #include "../Core/HttpServer/HttpToolbox.h" | 42 #include "../Core/HttpServer/HttpToolbox.h" |
43 #include "../Core/Logging.h" | |
43 #include "../Core/OrthancException.h" | 44 #include "../Core/OrthancException.h" |
44 #include "../Core/Toolbox.h" | 45 #include "../Core/Toolbox.h" |
45 #include "../Core/Uuid.h" | 46 #include "../Core/Uuid.h" |
46 #include "../OrthancServer/OrthancInitialization.h" | 47 #include "../OrthancServer/OrthancInitialization.h" |
47 | 48 |
485 s = "CoU"; | 486 s = "CoU"; |
486 Toolbox::ToLowerCase(s); | 487 Toolbox::ToLowerCase(s); |
487 ASSERT_EQ("cou", s); | 488 ASSERT_EQ("cou", s); |
488 } | 489 } |
489 | 490 |
490 | |
491 #include <glog/logging.h> | |
492 | 491 |
493 TEST(Logger, Basic) | 492 TEST(Logger, Basic) |
494 { | 493 { |
495 LOG(INFO) << "I say hello"; | 494 LOG(INFO) << "I say hello"; |
496 } | 495 } |
819 } | 818 } |
820 | 819 |
821 | 820 |
822 int main(int argc, char **argv) | 821 int main(int argc, char **argv) |
823 { | 822 { |
824 // Initialize Google's logging library. | 823 Logging::Initialize(); |
825 FLAGS_logtostderr = true; | 824 Logging::EnableInfoLevel(true); |
826 FLAGS_minloglevel = 0; | |
827 | |
828 // Go to trace-level verbosity | |
829 //FLAGS_v = 1; | |
830 | |
831 Toolbox::DetectEndianness(); | 825 Toolbox::DetectEndianness(); |
832 | |
833 google::InitGoogleLogging("Orthanc"); | |
834 | |
835 Toolbox::MakeDirectory("UnitTestsResults"); | 826 Toolbox::MakeDirectory("UnitTestsResults"); |
836 | |
837 OrthancInitialize(); | 827 OrthancInitialize(); |
828 | |
838 ::testing::InitGoogleTest(&argc, argv); | 829 ::testing::InitGoogleTest(&argc, argv); |
839 int result = RUN_ALL_TESTS(); | 830 int result = RUN_ALL_TESTS(); |
831 | |
840 OrthancFinalize(); | 832 OrthancFinalize(); |
833 Logging::Finalize(); | |
834 | |
841 return result; | 835 return result; |
842 } | 836 } |