[K/N][Runtime tests] Support << operator for thread states
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
#include "GlobalsRegistry.hpp"
|
#include "GlobalsRegistry.hpp"
|
||||||
#include "TestSupport.hpp"
|
#include "TestSupport.hpp"
|
||||||
#include "ThreadData.hpp"
|
#include "ThreadData.hpp"
|
||||||
|
#include "ThreadState.hpp"
|
||||||
|
|
||||||
using namespace kotlin;
|
using namespace kotlin;
|
||||||
|
|
||||||
@@ -57,4 +58,8 @@ extern "C" void Kotlin_TestSupport_AssertClearGlobalState() {
|
|||||||
void kotlin::DeinitMemoryForTests(MemoryState* memoryState) {
|
void kotlin::DeinitMemoryForTests(MemoryState* memoryState) {
|
||||||
DeinitMemory(memoryState, false);
|
DeinitMemory(memoryState, false);
|
||||||
mm::ThreadRegistry::TestSupport::ClearCurrentThreadData();
|
mm::ThreadRegistry::TestSupport::ClearCurrentThreadData();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ostream& kotlin::operator<<(std::ostream& stream, ThreadState state) {
|
||||||
|
return stream << ThreadStateName(state);
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include "../../main/cpp/TestSupport.hpp"
|
#include "../../main/cpp/TestSupport.hpp"
|
||||||
|
|
||||||
|
#include <ostream>
|
||||||
|
|
||||||
#include "MemoryPrivate.hpp"
|
#include "MemoryPrivate.hpp"
|
||||||
#include "ThreadData.hpp"
|
#include "ThreadData.hpp"
|
||||||
|
|
||||||
@@ -16,4 +18,8 @@ inline void RunInNewThread(std::function<void(mm::ThreadData&)> f) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Overload the << operator for ThreadState to allow the GTest runner
|
||||||
|
// to pretty print ThreadState constants.
|
||||||
|
std::ostream& operator<<(std::ostream& stream, ThreadState state);
|
||||||
|
|
||||||
} // namespace kotlin
|
} // namespace kotlin
|
||||||
|
|||||||
Reference in New Issue
Block a user