mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-10-07 16:33:53 +00:00
!2947 测试用例执行异常问题修复
Merge pull request !2947 from dy/fix_testrunner_error
This commit is contained in:
commit
7258e1ebee
@ -50,14 +50,17 @@ JsTestRunner::JsTestRunner(
|
||||
bool isFaJsModel)
|
||||
: jsRuntime_(jsRuntime), isFaJsModel_(isFaJsModel)
|
||||
{
|
||||
std::string moduleName;
|
||||
if (args) {
|
||||
std::string srcPath;
|
||||
if (bundleInfo.hapModuleInfos.back().isModuleJson) {
|
||||
srcPath.append(args->GetTestModuleName());
|
||||
srcPath.append("/ets/TestRunner/");
|
||||
moduleName = args->GetTestModuleName();
|
||||
} else {
|
||||
srcPath.append(args->GetTestPackageName());
|
||||
srcPath.append("/assets/js/TestRunner/");
|
||||
moduleName = args->GetTestPackageName();
|
||||
}
|
||||
srcPath.append(args->GetTestRunnerClassName());
|
||||
srcPath.append(".abc");
|
||||
@ -65,9 +68,9 @@ JsTestRunner::JsTestRunner(
|
||||
}
|
||||
HILOG_DEBUG("JsTestRunner srcPath is %{public}s", srcPath_.c_str());
|
||||
if (!isFaJsModel) {
|
||||
if (!args->GetTestModuleName().empty()) {
|
||||
if (!moduleName.empty()) {
|
||||
for (auto hapModuleInfo : bundleInfo.hapModuleInfos) {
|
||||
if (hapModuleInfo.name == args->GetTestModuleName()) {
|
||||
if (hapModuleInfo.name == moduleName) {
|
||||
hapPath_ = hapModuleInfo.hapPath;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user