diff --git a/src/Cpp/main.cpp b/src/Cpp/main.cpp index 3b88275744..c28814acc8 100644 --- a/src/Cpp/main.cpp +++ b/src/Cpp/main.cpp @@ -15,7 +15,7 @@ int main([[maybe_unused]] int argc, char** argv) return -1; } - // 可以将日志、调试图片等存到别的目录下,需要在最一开始调用。不调用默认保存到资源同目录 + // 可以将日志、调试图片等存到别的目录下,需要在最一开始调用。不调用默认保存到资源同目录 // AsstSetUserDir(working_path.c_str()); // 这里默认读取的是可执行文件同目录下 resource 文件夹里的资源 @@ -51,6 +51,7 @@ int main([[maybe_unused]] int argc, char** argv) #ifdef SMOKE_TESTING std::cout << "Ended early for smoke testing." << std::endl; + AsstDestroy(ptr); return 0; #endif @@ -62,13 +63,12 @@ int main([[maybe_unused]] int argc, char** argv) if (!AsstConnected(ptr)) { std::cerr << "connect failed" << std::endl; AsstDestroy(ptr); - ptr = nullptr; - return -1; } -#ifndef ASST_DEBUG - +#ifdef ASST_DEBUG + AsstAppendTask(ptr, "Debug", nullptr); +#else /* 详细参数可参考 docs / 集成文档.md */ AsstAppendTask(ptr, "StartUp", nullptr); @@ -126,11 +126,6 @@ int main([[maybe_unused]] int argc, char** argv) "core_char": "维什戴尔" } )"); - -#else - - AsstAppendTask(ptr, "Debug", nullptr); - #endif AsstStart(ptr); @@ -141,7 +136,6 @@ int main([[maybe_unused]] int argc, char** argv) AsstStop(ptr); AsstDestroy(ptr); - ptr = nullptr; return 0; } diff --git a/tools/SmokeTesting/run_tests.sh b/tools/SmokeTesting/run_tests.sh index 0823aa5f33..dc5d5ecffd 100755 --- a/tools/SmokeTesting/run_tests.sh +++ b/tools/SmokeTesting/run_tests.sh @@ -9,7 +9,8 @@ mkdir -p "$log_dir" pids="" for client in $clients; do - ./install/smoke_test "$client" > "$log_dir/asst_${client}.log" 2>&1 & + lldb -o run -o 'bt all' -o kill -o quit \ + -- ./install/smoke_test "$client" > "$log_dir/asst_${client}.log" 2>&1 & pid=$! pids="$pids $pid"