Skip to content

Commit

Permalink
Merge branch 'main' into 488-in-the-http_server_extension_ts-the-effe…
Browse files Browse the repository at this point in the history
…cts-of-the-first-two-lines-below-are-overridden-by-the-third-line-which-likely-isnt-the-intended-behavior
  • Loading branch information
halajohn authored Jan 6, 2025
2 parents b1b9810 + 65a660d commit f748ccf
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 560 deletions.
227 changes: 0 additions & 227 deletions build/ten_runtime/feature/test.gni
Original file line number Diff line number Diff line change
Expand Up @@ -564,230 +564,3 @@ template("ten_package_test_prepare_auxiliary_resources") {
deps = res_deps
}
}

template("ten_package_standalone_pkg") {
# The following fields are necessary.
assert(defined(invoker.pkg_template) && invoker.pkg_template != "")

_pkg_type = "extension"
if (defined(invoker.pkg_type) && invoker.pkg_type != "") {
_pkg_type = invoker.pkg_type
}

_target_name = target_name

test_case_out_dir_rel_path_str =
get_path_info(get_path_info(target_name, "abspath"), "dir")
test_case_out_dir_rel_path =
"${root_out_dir}/${test_case_out_dir_rel_path_str}"

test_case_unique_target_name =
string_replace(test_case_out_dir_rel_path_str, "/", "_")

pkg_root_dir = "${test_case_out_dir_rel_path}/${_target_name}"

install_standalone_dummy_output_file =
"${target_gen_dir}/${_target_name}/install_standalone_dummy_output_file"
install_standalone_depfile = "${target_gen_dir}/install_standalone_depfile"

action("${test_case_unique_target_name}_${_target_name}_install_pkg") {
script = "//build/ten_runtime/feature/install_pkg.py"

args = [ "--tman-path" ]
if (is_win) {
args += [ rebase_path("${root_out_dir}/ten_manager/bin/tman.exe") ]
} else {
args += [ rebase_path("${root_out_dir}/ten_manager/bin/tman") ]
}

args += [
"--pkg-type",
_pkg_type,
"--pkg-src-root-dir",
rebase_path(pkg_root_dir),
"--tg-timestamp-proxy-file",
rebase_path(install_standalone_dummy_output_file),
"--src-pkg",
invoker.pkg_template,
]

args += [
"--config-file",
rebase_path("${root_out_dir}/tests/local_registry/config.json"),
]

args += [
"--log-level",
"${log_level}",
]

args += [
"--local-registry-path",
rebase_path("${root_out_dir}/tests/local_registry"),
]

if (invoker.deps != []) {
foreach(dep, invoker.deps) {
args += [
"--possible-published-results",
rebase_path(get_label_info(dep, "target_gen_dir")),
]
}
args += [
"--depfile",
rebase_path(install_standalone_depfile),
"--depfile-target",
rebase_path(install_standalone_dummy_output_file, root_build_dir),
]
}

sources = []
outputs = [ install_standalone_dummy_output_file ]
depfile = install_standalone_depfile

forward_variables_from(invoker,
[
"deps",
"public_deps",
"data_deps",
])

if (!defined(deps)) {
deps = []
}
deps += [
"//build/ten_runtime/feature:create_tman_config",
"//core/src/ten_manager",
]
}

install_all_dummy_output_file =
"${target_gen_dir}/${_target_name}/install_dummy_output_file"

# Install dependencies of the standalone package.
action("${test_case_unique_target_name}_${_target_name}_install") {
script = "//build/ten_runtime/feature/install_all.py"

args = [ "--tman-path" ]
if (is_win) {
args += [ rebase_path("${root_out_dir}/ten_manager/bin/tman.exe") ]
} else {
args += [ rebase_path("${root_out_dir}/ten_manager/bin/tman") ]
}

args += [
"--pkg-src-root-dir",
rebase_path(pkg_root_dir),
]

args += [
"--tg-timestamp-proxy-file",
rebase_path(install_all_dummy_output_file),
]

args += [
"--assume-yes",
"True",
]

args += [
"--config-file",
rebase_path("${root_out_dir}/tests/local_registry/config.json"),
]

args += [
"--log-level",
"${log_level}",
]

outputs = [ install_all_dummy_output_file ]

forward_variables_from(invoker,
[
"deps",
"public_deps",
"data_deps",
])

if (!defined(deps)) {
deps = []
}
deps += [
":${test_case_unique_target_name}_${_target_name}_install_pkg",
"//build/ten_runtime/feature:create_tman_config",
"//core/src/ten_manager",
]
}

# Build this standalone package.
build_pkg_dummy_output_file =
"${target_gen_dir}/${_target_name}/build_pkg_dummy_output_file"

action("${test_case_unique_target_name}_${_target_name}_build") {
script = "//build/ten_runtime/feature/build_pkg.py"

args = [
"--pkg-src-root-dir",
rebase_path(pkg_root_dir),
"--tg-timestamp-proxy-file",
rebase_path(build_pkg_dummy_output_file),
"--log-level",
"${log_level}",
"--pkg-name",
_target_name,
"--pkg-language",
invoker.pkg_language,
"--os",
target_os,
"--cpu",
target_cpu,
"--build",
]

if (is_debug) {
args += [ "debug" ]
} else {
args += [ "release" ]
}

if (is_win) {
args += [
"--vs-version",
"$vs_version",
]
}

if (is_clang) {
args += [ "--is-clang" ]
} else {
args += [ "--no-is-clang" ]
}

if (enable_sanitizer) {
args += [ "--enable-sanitizer" ]
} else {
args += [ "--no-enable-sanitizer" ]
}

outputs = [ build_pkg_dummy_output_file ]

forward_variables_from(invoker,
[
"deps",
"public_deps",
"data_deps",
])

if (!defined(deps)) {
deps = []
}
deps += [
":${test_case_unique_target_name}_${_target_name}_install",
":${test_case_unique_target_name}_${_target_name}_install_pkg",
]
}

group("${_target_name}") {
deps = [ ":${test_case_unique_target_name}_${_target_name}_build" ]
}
}
Loading

0 comments on commit f748ccf

Please sign in to comment.