Fix tests.

GitOrigin-RevId: bb970d6d9f0881c260ba92c7c53291444f2f6e84
This commit is contained in:
levlam 2019-11-17 23:42:48 +03:00
parent 258f92652d
commit ba3204a5c2
3 changed files with 11 additions and 2 deletions

View File

@ -9,6 +9,9 @@
#include "td/utils/SharedSlice.h" #include "td/utils/SharedSlice.h"
#include "td/utils/tests.h" #include "td/utils/tests.h"
char disable_linker_warning_about_empty_file_tdutils_test_shared_slice_cpp TD_UNUSED;
#if !TD_THREAD_UNSUPPORTED
TEST(SharedSlice, Hands) { TEST(SharedSlice, Hands) {
{ {
td::SharedSlice h("hello"); td::SharedSlice h("hello");
@ -84,3 +87,4 @@ TEST(SharedSlice, Hands) {
} }
} }
} }
#endif

View File

@ -22,6 +22,9 @@
// LOG uses thread local LogInterface // LOG uses thread local LogInterface
// void append(CSlice slice, int log_level); // void append(CSlice slice, int log_level);
char disable_linker_warning_about_empty_file_tdutils_test_log_cpp TD_UNUSED;
#if !TD_THREAD_UNSUPPORTED
template <class Log> template <class Log>
class LogBenchmark : public td::Benchmark { class LogBenchmark : public td::Benchmark {
public: public:
@ -125,3 +128,4 @@ TEST(Log, TsLogger) {
return td::make_unique<FileLog>(); return td::make_unique<FileLog>();
}); });
} }
#endif

View File

@ -30,8 +30,9 @@ int main(int argc, char **argv) {
} }
#if TD_EMSCRIPTEN #if TD_EMSCRIPTEN
emscripten_set_main_loop( emscripten_set_main_loop(
[&runner] { [] {
if (!runner.run_all_step()) { td::TestsRunner &default_runner = td::TestsRunner::get_default();
if (!default_runner.run_all_step()) {
emscripten_cancel_main_loop(); emscripten_cancel_main_loop();
} }
}, },