Mercurial > hg > orthanc-stone
comparison UnitTestsSources/UnitTestsMain.cpp @ 1680:03afa09cfcf1
running the tests of the Orthanc Framework in WebAssembly
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 24 Nov 2020 16:39:54 +0100 |
parents | 5b8b88e5bfd6 |
children | 9ac2a65d4172 |
comparison
equal
deleted
inserted
replaced
1679:5b8b88e5bfd6 | 1680:03afa09cfcf1 |
---|---|
62 #endif | 62 #endif |
63 | 63 |
64 int result; | 64 int result; |
65 | 65 |
66 { | 66 { |
67 Orthanc::Logging::Initialize(); | 67 OrthancStone::StoneInitialize(); |
68 Orthanc::Logging::EnableInfoLevel(true); | 68 Orthanc::Logging::EnableInfoLevel(true); |
69 | 69 |
70 ::testing::InitGoogleTest(&argc, argv); | 70 ::testing::InitGoogleTest(&argc, argv); |
71 | 71 |
72 #if defined(__EMSCRIPTEN__) | 72 #if defined(__EMSCRIPTEN__) |
73 ::testing::internal::CaptureStdout(); | 73 ::testing::internal::CaptureStdout(); |
74 #endif | 74 #endif |
75 | 75 |
76 result = RUN_ALL_TESTS(); | 76 result = RUN_ALL_TESTS(); |
77 | 77 |
78 Orthanc::Logging::Finalize(); | |
79 | |
80 #if defined(__EMSCRIPTEN__) | 78 #if defined(__EMSCRIPTEN__) |
81 output = testing::internal::GetCapturedStdout(); | 79 output = testing::internal::GetCapturedStdout(); |
82 #endif | 80 #endif |
81 | |
82 OrthancStone::StoneFinalize(); | |
83 } | 83 } |
84 | 84 |
85 #if defined(__EMSCRIPTEN__) | 85 #if defined(__EMSCRIPTEN__) |
86 EM_ASM({ | 86 EM_ASM({ |
87 document.getElementById("output").innerHTML = UTF8ToString($0); | 87 document.getElementById("output").innerHTML = UTF8ToString($0); |
88 window.scrollTo(0, document.body.scrollHeight); // Scroll to the end of the page | |
88 }, | 89 }, |
89 output.c_str()); | 90 output.c_str()); |
90 #endif | 91 #endif |
91 | 92 |
92 return result; | 93 return result; |