mirror of
https://github.com/deepinsight/insightface.git
synced 2026-01-23 03:50:18 +00:00
Update inspireface to 1.2.0
This commit is contained in:
40
cpp-package/inspireface/cpp/test/test_base.cpp
Normal file
40
cpp-package/inspireface/cpp/test/test_base.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Created by Jingyu Yan
|
||||
* @date 2024-10-01
|
||||
*/
|
||||
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#include <iostream>
|
||||
#include "settings/test_settings.h"
|
||||
#include <spdlog/sinks/stdout_color_sinks.h>
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "initialization_module/launch.h"
|
||||
|
||||
#define ENABLE_DRAW_SPLIT_LINE 1 // Whether dividers are printed during the test
|
||||
#define ENABLE_TEST_MSG 1 // TEST PRINT output
|
||||
|
||||
int init_test_logger() {
|
||||
std::string name("TEST");
|
||||
auto stdout_sink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
|
||||
auto logger = std::make_shared<spdlog::logger>(name, stdout_sink);
|
||||
#if ENABLE_TEST_MSG
|
||||
logger->set_level(spdlog::level::trace);
|
||||
#else
|
||||
logger->set_level(spdlog::level::off);
|
||||
#endif
|
||||
logger->set_pattern("%Y-%m-%d %H:%M:%S.%e [test message] =====> %v");
|
||||
spdlog::register_logger(logger);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
init_test_logger();
|
||||
|
||||
auto ret = INSPIRE_LAUNCH->Load("test_res/pack/Pikachu");
|
||||
if (ret != 0) {
|
||||
std::cerr << "Load error" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return Catch::Session().run(argc, argv);
|
||||
}
|
||||
Reference in New Issue
Block a user