This commit is contained in:
Ilusha 2024-03-15 23:42:10 +03:00 committed by Ilya Shurupov
parent b8bcf58a29
commit afab59eb21
34 changed files with 288 additions and 264 deletions

44
Callstack/tests/Test.cpp Normal file
View file

@ -0,0 +1,44 @@
#include "UnitTest++/UnitTest++.h"
#include "Callstack.hpp"
#include <cstdio>
using namespace tp;
void common(CallStackCapture& cs) { auto tmp = cs.getSnapshot(); }
void first(CallStackCapture& cs) {
common(cs);
common(cs);
common(cs);
}
void second(CallStackCapture& cs) {
common(cs);
common(cs);
common(cs);
common(cs);
}
void third(CallStackCapture& cs) {
common(cs);
common(cs);
}
void root(CallStackCapture& cs) {
first(cs);
second(cs);
third(cs);
}
SUITE(Utils) {
TEST(CallStackCapture) {
CallStackCapture callstack;
root(callstack);
callstack.logAll();
}
}
int main() { return UnitTest::RunAllTests(); }