Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions fuzztest/internal/runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,18 @@ void Runtime::PrintReport(RawSink out) const {
absl::Format(out, "%s", GetSeparator());
}

#ifndef FUZZTEST_USE_CENTIPEDE
#if defined(FUZZTEST_USE_CENTIPEDE) || \
((defined(__EMSCRIPTEN__) || defined(__wasm__) || defined(__wasm32__)) && \
!defined(__EMSCRIPTEN_PTHREADS__))

// Centipede runner has its own watchdog. Single-threaded WebAssembly (without
// __EMSCRIPTEN_PTHREADS__) does not support threads.
class Runtime::Watchdog {
public:
explicit Watchdog(Runtime&) {}
};

#else

class Runtime::Watchdog {
public:
Expand Down Expand Up @@ -419,15 +430,7 @@ class Runtime::Watchdog {
Runtime& runtime_;
};

#else // FUZZTEST_USE_CENTIPEDE

// Centipede runner has its own watchdog.
class Runtime::Watchdog {
public:
explicit Watchdog(Runtime&) {}
};

#endif // FUZZTEST_USE_CENTIPEDE
#endif // FUZZTEST_USE_CENTIPEDE || __EMSCRIPTEN__ || __wasm__ || __wasm32__

Runtime::Watchdog Runtime::CreateWatchdog() { return Watchdog{*this}; }

Expand Down
Loading