| # Copyright 2020 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| import("//build/python/python_host_test.gni") | |
| group("tests") { | |
| testonly = true | |
| deps = [ | |
| ":action_tracer_test($host_toolchain)", | |
| ":tracer_test", | |
| ] | |
| } | |
| python_host_test("action_tracer_test") { | |
| main_source = "action_tracer_test.py" | |
| sources = [ "action_tracer.py" ] | |
| } | |
| # 1. Turn on trace_action: | |
| # $ fx set ... --args=build_should_trace_actions=true | |
| # 2. Delete the output files to ensure that this action will run: | |
| # $ rm -rf out/default/obj/build/tracer | |
| # 3. Comment out either the `inputs`, or the second line of `outputs` below. | |
| # 4. Build. | |
| # $ fx build obj/build/tracer/tracer_test_output_1.txt | |
| # You should see an error for the target below! | |
| action("tracer_test") { | |
| script = "tracer_test.sh" | |
| inputs = [ "tracer_test_input.txt" ] | |
| outputs = [ | |
| "$target_out_dir/tracer_test_output_1.txt", | |
| "$target_out_dir/tracer_test_output_2.txt", | |
| "$target_out_dir/tracer_test_output_3.txt", | |
| ] | |
| args = [ | |
| rebase_path("tracer_test_input.txt", root_build_dir), | |
| rebase_path("$target_out_dir/tracer_test_output_1.txt", root_build_dir), | |
| rebase_path("$target_out_dir/tracer_test_output_2.txt", root_build_dir), | |
| rebase_path("$target_out_dir/tracer_test_output_3.txt", root_build_dir), | |
| ] | |
| } |