1*bcb5dc79SHONG Yifan# Copyright 2019 The Bazel Authors. All rights reserved. 2*bcb5dc79SHONG Yifan# 3*bcb5dc79SHONG Yifan# Licensed under the Apache License, Version 2.0 (the "License"); 4*bcb5dc79SHONG Yifan# you may not use this file except in compliance with the License. 5*bcb5dc79SHONG Yifan# You may obtain a copy of the License at 6*bcb5dc79SHONG Yifan# 7*bcb5dc79SHONG Yifan# http://www.apache.org/licenses/LICENSE-2.0 8*bcb5dc79SHONG Yifan# 9*bcb5dc79SHONG Yifan# Unless required by applicable law or agreed to in writing, software 10*bcb5dc79SHONG Yifan# distributed under the License is distributed on an "AS IS" BASIS, 11*bcb5dc79SHONG Yifan# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*bcb5dc79SHONG Yifan# See the License for the specific language governing permissions and 13*bcb5dc79SHONG Yifan# limitations under the License. 14*bcb5dc79SHONG Yifan 15*bcb5dc79SHONG Yifan"""Unit tests for unittest.bzl.""" 16*bcb5dc79SHONG Yifan 17*bcb5dc79SHONG Yifanload("//lib:partial.bzl", "partial") 18*bcb5dc79SHONG Yifanload("//lib:unittest.bzl", "analysistest", "asserts", "loadingtest", "unittest") 19*bcb5dc79SHONG Yifan 20*bcb5dc79SHONG Yifan################################### 21*bcb5dc79SHONG Yifan####### basic_failing_test ######## 22*bcb5dc79SHONG Yifan################################### 23*bcb5dc79SHONG Yifan 24*bcb5dc79SHONG Yifandef _basic_failing_test(ctx): 25*bcb5dc79SHONG Yifan """Unit tests for a basic library verification test that fails.""" 26*bcb5dc79SHONG Yifan env = unittest.begin(ctx) 27*bcb5dc79SHONG Yifan 28*bcb5dc79SHONG Yifan asserts.equals(env, 1, 2) 29*bcb5dc79SHONG Yifan 30*bcb5dc79SHONG Yifan return unittest.end(env) 31*bcb5dc79SHONG Yifan 32*bcb5dc79SHONG Yifanbasic_failing_test = unittest.make(_basic_failing_test) 33*bcb5dc79SHONG Yifan 34*bcb5dc79SHONG Yifan################################### 35*bcb5dc79SHONG Yifan####### failure_message_test ###### 36*bcb5dc79SHONG Yifan################################### 37*bcb5dc79SHONG Yifan 38*bcb5dc79SHONG Yifandef _failure_message_test(ctx): 39*bcb5dc79SHONG Yifan """Failing unit test with arbitrary content in the message.""" 40*bcb5dc79SHONG Yifan env = unittest.begin(ctx) 41*bcb5dc79SHONG Yifan 42*bcb5dc79SHONG Yifan if not ctx.attr.message: 43*bcb5dc79SHONG Yifan unittest.fail(env, "Message must be non-empty.") 44*bcb5dc79SHONG Yifan asserts.equals(env, "", ctx.attr.message) 45*bcb5dc79SHONG Yifan 46*bcb5dc79SHONG Yifan return unittest.end(env) 47*bcb5dc79SHONG Yifan 48*bcb5dc79SHONG Yifanfailure_message_test = unittest.make( 49*bcb5dc79SHONG Yifan _failure_message_test, 50*bcb5dc79SHONG Yifan attrs = { 51*bcb5dc79SHONG Yifan "message": attr.string(), 52*bcb5dc79SHONG Yifan }, 53*bcb5dc79SHONG Yifan) 54*bcb5dc79SHONG Yifan 55*bcb5dc79SHONG Yifan################################### 56*bcb5dc79SHONG Yifan####### basic_passing_test ######## 57*bcb5dc79SHONG Yifan################################### 58*bcb5dc79SHONG Yifandef _basic_passing_test(ctx): 59*bcb5dc79SHONG Yifan """Unit tests for a basic library verification test.""" 60*bcb5dc79SHONG Yifan env = unittest.begin(ctx) 61*bcb5dc79SHONG Yifan 62*bcb5dc79SHONG Yifan asserts.equals(env, 1, 1) 63*bcb5dc79SHONG Yifan 64*bcb5dc79SHONG Yifan return unittest.end(env) 65*bcb5dc79SHONG Yifan 66*bcb5dc79SHONG Yifanbasic_passing_test = unittest.make(_basic_passing_test) 67*bcb5dc79SHONG Yifan 68*bcb5dc79SHONG Yifan################################################# 69*bcb5dc79SHONG Yifan####### basic_passing_short_timeout_test ######## 70*bcb5dc79SHONG Yifan################################################# 71*bcb5dc79SHONG Yifandef _basic_passing_short_timeout_test(ctx): 72*bcb5dc79SHONG Yifan """Unit tests for a basic library verification test.""" 73*bcb5dc79SHONG Yifan env = unittest.begin(ctx) 74*bcb5dc79SHONG Yifan 75*bcb5dc79SHONG Yifan asserts.equals(env, ctx.attr.timeout, "short") 76*bcb5dc79SHONG Yifan 77*bcb5dc79SHONG Yifan return unittest.end(env) 78*bcb5dc79SHONG Yifan 79*bcb5dc79SHONG Yifanbasic_passing_short_timeout_test = unittest.make(_basic_passing_short_timeout_test) 80*bcb5dc79SHONG Yifan 81*bcb5dc79SHONG Yifan################################### 82*bcb5dc79SHONG Yifan####### change_setting_test ####### 83*bcb5dc79SHONG Yifan################################### 84*bcb5dc79SHONG Yifandef _change_setting_test(ctx): 85*bcb5dc79SHONG Yifan """Test to verify that an analysis test may change configuration.""" 86*bcb5dc79SHONG Yifan env = analysistest.begin(ctx) 87*bcb5dc79SHONG Yifan 88*bcb5dc79SHONG Yifan dep_min_os_version = analysistest.target_under_test(env)[_ChangeSettingInfo].min_os_version 89*bcb5dc79SHONG Yifan asserts.equals(env, "1234.5678", dep_min_os_version) 90*bcb5dc79SHONG Yifan 91*bcb5dc79SHONG Yifan return analysistest.end(env) 92*bcb5dc79SHONG Yifan 93*bcb5dc79SHONG Yifan_ChangeSettingInfo = provider( 94*bcb5dc79SHONG Yifan doc = "min_os_version for change_setting_test", 95*bcb5dc79SHONG Yifan fields = ["min_os_version"], 96*bcb5dc79SHONG Yifan) 97*bcb5dc79SHONG Yifan 98*bcb5dc79SHONG Yifandef _change_setting_fake_rule(ctx): 99*bcb5dc79SHONG Yifan return [_ChangeSettingInfo(min_os_version = ctx.fragments.cpp.minimum_os_version())] 100*bcb5dc79SHONG Yifan 101*bcb5dc79SHONG Yifanchange_setting_fake_rule = rule( 102*bcb5dc79SHONG Yifan implementation = _change_setting_fake_rule, 103*bcb5dc79SHONG Yifan fragments = ["cpp"], 104*bcb5dc79SHONG Yifan) 105*bcb5dc79SHONG Yifan 106*bcb5dc79SHONG Yifanchange_setting_test = analysistest.make( 107*bcb5dc79SHONG Yifan _change_setting_test, 108*bcb5dc79SHONG Yifan config_settings = { 109*bcb5dc79SHONG Yifan "//command_line_option:minimum_os_version": "1234.5678", 110*bcb5dc79SHONG Yifan }, 111*bcb5dc79SHONG Yifan) 112*bcb5dc79SHONG Yifan 113*bcb5dc79SHONG Yifan#################################### 114*bcb5dc79SHONG Yifan####### failure_testing_test ####### 115*bcb5dc79SHONG Yifan#################################### 116*bcb5dc79SHONG Yifandef _failure_testing_test(ctx): 117*bcb5dc79SHONG Yifan """Test to verify that an analysis test may verify a rule fails with fail().""" 118*bcb5dc79SHONG Yifan env = analysistest.begin(ctx) 119*bcb5dc79SHONG Yifan 120*bcb5dc79SHONG Yifan asserts.expect_failure(env, "This rule should never work") 121*bcb5dc79SHONG Yifan 122*bcb5dc79SHONG Yifan return analysistest.end(env) 123*bcb5dc79SHONG Yifan 124*bcb5dc79SHONG Yifandef _failure_testing_fake_rule(ctx): 125*bcb5dc79SHONG Yifan _ignore = [ctx] # @unused 126*bcb5dc79SHONG Yifan fail("This rule should never work") 127*bcb5dc79SHONG Yifan 128*bcb5dc79SHONG Yifanfailure_testing_fake_rule = rule( 129*bcb5dc79SHONG Yifan implementation = _failure_testing_fake_rule, 130*bcb5dc79SHONG Yifan) 131*bcb5dc79SHONG Yifan 132*bcb5dc79SHONG Yifanfailure_testing_test = analysistest.make( 133*bcb5dc79SHONG Yifan _failure_testing_test, 134*bcb5dc79SHONG Yifan expect_failure = True, 135*bcb5dc79SHONG Yifan) 136*bcb5dc79SHONG Yifan 137*bcb5dc79SHONG Yifan############################################ 138*bcb5dc79SHONG Yifan####### fail_unexpected_passing_test ####### 139*bcb5dc79SHONG Yifan############################################ 140*bcb5dc79SHONG Yifandef _fail_unexpected_passing_test(ctx): 141*bcb5dc79SHONG Yifan """Test that fails by expecting an error that never occurs.""" 142*bcb5dc79SHONG Yifan env = analysistest.begin(ctx) 143*bcb5dc79SHONG Yifan 144*bcb5dc79SHONG Yifan asserts.expect_failure(env, "Oh no, going to fail") 145*bcb5dc79SHONG Yifan 146*bcb5dc79SHONG Yifan return analysistest.end(env) 147*bcb5dc79SHONG Yifan 148*bcb5dc79SHONG Yifandef _fail_unexpected_passing_fake_rule(ctx): 149*bcb5dc79SHONG Yifan _ignore = [ctx] # @unused 150*bcb5dc79SHONG Yifan return [] 151*bcb5dc79SHONG Yifan 152*bcb5dc79SHONG Yifanfail_unexpected_passing_fake_rule = rule( 153*bcb5dc79SHONG Yifan implementation = _fail_unexpected_passing_fake_rule, 154*bcb5dc79SHONG Yifan) 155*bcb5dc79SHONG Yifan 156*bcb5dc79SHONG Yifanfail_unexpected_passing_test = analysistest.make( 157*bcb5dc79SHONG Yifan _fail_unexpected_passing_test, 158*bcb5dc79SHONG Yifan expect_failure = True, 159*bcb5dc79SHONG Yifan) 160*bcb5dc79SHONG Yifan 161*bcb5dc79SHONG Yifan################################################ 162*bcb5dc79SHONG Yifan####### change_setting_with_failure_test ####### 163*bcb5dc79SHONG Yifan################################################ 164*bcb5dc79SHONG Yifandef _change_setting_with_failure_test(ctx): 165*bcb5dc79SHONG Yifan """Test verifying failure while changing configuration.""" 166*bcb5dc79SHONG Yifan env = analysistest.begin(ctx) 167*bcb5dc79SHONG Yifan 168*bcb5dc79SHONG Yifan asserts.expect_failure(env, "unexpected minimum_os_version!!!") 169*bcb5dc79SHONG Yifan 170*bcb5dc79SHONG Yifan return analysistest.end(env) 171*bcb5dc79SHONG Yifan 172*bcb5dc79SHONG Yifandef _change_setting_with_failure_fake_rule(ctx): 173*bcb5dc79SHONG Yifan if ctx.fragments.cpp.minimum_os_version() == "error_error": 174*bcb5dc79SHONG Yifan fail("unexpected minimum_os_version!!!") 175*bcb5dc79SHONG Yifan return [] 176*bcb5dc79SHONG Yifan 177*bcb5dc79SHONG Yifanchange_setting_with_failure_fake_rule = rule( 178*bcb5dc79SHONG Yifan implementation = _change_setting_with_failure_fake_rule, 179*bcb5dc79SHONG Yifan fragments = ["cpp"], 180*bcb5dc79SHONG Yifan) 181*bcb5dc79SHONG Yifan 182*bcb5dc79SHONG Yifanchange_setting_with_failure_test = analysistest.make( 183*bcb5dc79SHONG Yifan _change_setting_with_failure_test, 184*bcb5dc79SHONG Yifan expect_failure = True, 185*bcb5dc79SHONG Yifan config_settings = { 186*bcb5dc79SHONG Yifan "//command_line_option:minimum_os_version": "error_error", 187*bcb5dc79SHONG Yifan }, 188*bcb5dc79SHONG Yifan) 189*bcb5dc79SHONG Yifan 190*bcb5dc79SHONG Yifan#################################### 191*bcb5dc79SHONG Yifan####### inspect_actions_test ####### 192*bcb5dc79SHONG Yifan#################################### 193*bcb5dc79SHONG Yifandef _inspect_actions_test(ctx): 194*bcb5dc79SHONG Yifan """Test verifying actions registered by a target.""" 195*bcb5dc79SHONG Yifan env = analysistest.begin(ctx) 196*bcb5dc79SHONG Yifan 197*bcb5dc79SHONG Yifan actions = analysistest.target_actions(env) 198*bcb5dc79SHONG Yifan asserts.equals(env, 1, len(actions)) 199*bcb5dc79SHONG Yifan action_output = actions[0].outputs.to_list()[0] 200*bcb5dc79SHONG Yifan asserts.equals(env, "out.txt", action_output.basename) 201*bcb5dc79SHONG Yifan return analysistest.end(env) 202*bcb5dc79SHONG Yifan 203*bcb5dc79SHONG Yifandef _inspect_actions_fake_rule(ctx): 204*bcb5dc79SHONG Yifan out_file = ctx.actions.declare_file("out.txt") 205*bcb5dc79SHONG Yifan ctx.actions.run_shell( 206*bcb5dc79SHONG Yifan command = "echo 'hello' > %s" % out_file.basename, 207*bcb5dc79SHONG Yifan outputs = [out_file], 208*bcb5dc79SHONG Yifan ) 209*bcb5dc79SHONG Yifan return [DefaultInfo(files = depset([out_file]))] 210*bcb5dc79SHONG Yifan 211*bcb5dc79SHONG Yifaninspect_actions_fake_rule = rule( 212*bcb5dc79SHONG Yifan implementation = _inspect_actions_fake_rule, 213*bcb5dc79SHONG Yifan) 214*bcb5dc79SHONG Yifan 215*bcb5dc79SHONG Yifaninspect_actions_test = analysistest.make( 216*bcb5dc79SHONG Yifan _inspect_actions_test, 217*bcb5dc79SHONG Yifan) 218*bcb5dc79SHONG Yifan 219*bcb5dc79SHONG Yifan#################################### 220*bcb5dc79SHONG Yifan####### inspect_aspect_test ####### 221*bcb5dc79SHONG Yifan#################################### 222*bcb5dc79SHONG Yifan_AddedByAspectInfo = provider( 223*bcb5dc79SHONG Yifan doc = "Example provider added by example aspect", 224*bcb5dc79SHONG Yifan fields = { 225*bcb5dc79SHONG Yifan "value": "(str)", 226*bcb5dc79SHONG Yifan }, 227*bcb5dc79SHONG Yifan) 228*bcb5dc79SHONG Yifan 229*bcb5dc79SHONG Yifandef _example_aspect_impl(target, ctx): 230*bcb5dc79SHONG Yifan _ignore = [target, ctx] # @unused 231*bcb5dc79SHONG Yifan return [ 232*bcb5dc79SHONG Yifan _AddedByAspectInfo(value = "attached by aspect"), 233*bcb5dc79SHONG Yifan ] 234*bcb5dc79SHONG Yifan 235*bcb5dc79SHONG Yifanexample_aspect = aspect( 236*bcb5dc79SHONG Yifan implementation = _example_aspect_impl, 237*bcb5dc79SHONG Yifan) 238*bcb5dc79SHONG Yifan 239*bcb5dc79SHONG Yifandef _inspect_aspect_test(ctx): 240*bcb5dc79SHONG Yifan """Test verifying aspect run on a target.""" 241*bcb5dc79SHONG Yifan env = analysistest.begin(ctx) 242*bcb5dc79SHONG Yifan 243*bcb5dc79SHONG Yifan tut = env.ctx.attr.target_under_test 244*bcb5dc79SHONG Yifan asserts.equals(env, "attached by aspect", tut[_AddedByAspectInfo].value) 245*bcb5dc79SHONG Yifan return analysistest.end(env) 246*bcb5dc79SHONG Yifan 247*bcb5dc79SHONG Yifandef _inspect_aspect_fake_rule(ctx): 248*bcb5dc79SHONG Yifan out_file = ctx.actions.declare_file("out.txt") 249*bcb5dc79SHONG Yifan ctx.actions.run_shell( 250*bcb5dc79SHONG Yifan command = "echo 'hello' > %s" % out_file.basename, 251*bcb5dc79SHONG Yifan outputs = [out_file], 252*bcb5dc79SHONG Yifan ) 253*bcb5dc79SHONG Yifan return [DefaultInfo(files = depset([out_file]))] 254*bcb5dc79SHONG Yifan 255*bcb5dc79SHONG Yifaninspect_aspect_fake_rule = rule( 256*bcb5dc79SHONG Yifan implementation = _inspect_aspect_fake_rule, 257*bcb5dc79SHONG Yifan) 258*bcb5dc79SHONG Yifan 259*bcb5dc79SHONG Yifaninspect_aspect_test = analysistest.make( 260*bcb5dc79SHONG Yifan _inspect_aspect_test, 261*bcb5dc79SHONG Yifan extra_target_under_test_aspects = [example_aspect], 262*bcb5dc79SHONG Yifan) 263*bcb5dc79SHONG Yifan 264*bcb5dc79SHONG Yifan######################################## 265*bcb5dc79SHONG Yifan####### inspect_output_dirs_test ####### 266*bcb5dc79SHONG Yifan######################################## 267*bcb5dc79SHONG Yifan_OutputDirInfo = provider( 268*bcb5dc79SHONG Yifan doc = "bin_path for inspect_output_dirs_test", 269*bcb5dc79SHONG Yifan fields = ["bin_path"], 270*bcb5dc79SHONG Yifan) 271*bcb5dc79SHONG Yifan 272*bcb5dc79SHONG Yifandef _inspect_output_dirs_test(ctx): 273*bcb5dc79SHONG Yifan """Test verifying output directories used by a test.""" 274*bcb5dc79SHONG Yifan env = analysistest.begin(ctx) 275*bcb5dc79SHONG Yifan 276*bcb5dc79SHONG Yifan # Assert that the output bin dir observed by the aspect added by analysistest 277*bcb5dc79SHONG Yifan # is the same as those observed by the rule directly, even when that's 278*bcb5dc79SHONG Yifan # under a config transition and therefore not the same as the bin dir 279*bcb5dc79SHONG Yifan # used by the test rule. 280*bcb5dc79SHONG Yifan bin_path = analysistest.target_bin_dir_path(env) 281*bcb5dc79SHONG Yifan target_under_test = analysistest.target_under_test(env) 282*bcb5dc79SHONG Yifan asserts.false(env, not bin_path, "bin dir path not found.") 283*bcb5dc79SHONG Yifan asserts.false( 284*bcb5dc79SHONG Yifan env, 285*bcb5dc79SHONG Yifan bin_path == ctx.bin_dir.path, 286*bcb5dc79SHONG Yifan "test bin dir (%s) expected to differ with target_under_test bin dir (%s)." % (bin_path, ctx.bin_dir.path), 287*bcb5dc79SHONG Yifan ) 288*bcb5dc79SHONG Yifan asserts.equals(env, bin_path, target_under_test[_OutputDirInfo].bin_path) 289*bcb5dc79SHONG Yifan return analysistest.end(env) 290*bcb5dc79SHONG Yifan 291*bcb5dc79SHONG Yifandef _inspect_output_dirs_fake_rule(ctx): 292*bcb5dc79SHONG Yifan return [ 293*bcb5dc79SHONG Yifan _OutputDirInfo( 294*bcb5dc79SHONG Yifan bin_path = ctx.bin_dir.path, 295*bcb5dc79SHONG Yifan ), 296*bcb5dc79SHONG Yifan ] 297*bcb5dc79SHONG Yifan 298*bcb5dc79SHONG Yifaninspect_output_dirs_fake_rule = rule( 299*bcb5dc79SHONG Yifan implementation = _inspect_output_dirs_fake_rule, 300*bcb5dc79SHONG Yifan) 301*bcb5dc79SHONG Yifan 302*bcb5dc79SHONG Yifaninspect_output_dirs_test = analysistest.make( 303*bcb5dc79SHONG Yifan _inspect_output_dirs_test, 304*bcb5dc79SHONG Yifan # The output directories differ between the test and target under test when 305*bcb5dc79SHONG Yifan # the target under test is under a config transition. 306*bcb5dc79SHONG Yifan config_settings = { 307*bcb5dc79SHONG Yifan "//command_line_option:minimum_os_version": "1234.5678", 308*bcb5dc79SHONG Yifan }, 309*bcb5dc79SHONG Yifan) 310*bcb5dc79SHONG Yifan 311*bcb5dc79SHONG Yifandef _loading_phase_test(env): 312*bcb5dc79SHONG Yifan loadingtest.equals(env, "self_glob", ["unittest_tests.bzl"], native.glob(["unittest_tests.bzl"])) 313*bcb5dc79SHONG Yifan 314*bcb5dc79SHONG Yifan # now use our own calls to assert we created a test case rule and test_suite for it. 315*bcb5dc79SHONG Yifan loadingtest.equals(env, "test_exists", True, native.existing_rule(env.name + "_self_glob") != None) 316*bcb5dc79SHONG Yifan loadingtest.equals(env, "suite_exists", True, native.existing_rule(env.name + "_tests") != None) 317*bcb5dc79SHONG Yifan 318*bcb5dc79SHONG Yifan######################################### 319*bcb5dc79SHONG Yifan 320*bcb5dc79SHONG Yifan# buildifier: disable=unnamed-macro 321*bcb5dc79SHONG Yifandef unittest_passing_tests_suite(): 322*bcb5dc79SHONG Yifan """Creates the test targets and test suite for passing unittest.bzl tests. 323*bcb5dc79SHONG Yifan 324*bcb5dc79SHONG Yifan Not all tests are included. Some unittest.bzl tests verify a test fails 325*bcb5dc79SHONG Yifan when assertions are not met. Such tests must be run in an e2e shell test. 326*bcb5dc79SHONG Yifan This suite only includes tests which verify success tests. 327*bcb5dc79SHONG Yifan """ 328*bcb5dc79SHONG Yifan unittest.suite( 329*bcb5dc79SHONG Yifan "unittest_tests", 330*bcb5dc79SHONG Yifan basic_passing_test, 331*bcb5dc79SHONG Yifan partial.make(basic_passing_short_timeout_test, timeout = "short"), 332*bcb5dc79SHONG Yifan ) 333*bcb5dc79SHONG Yifan 334*bcb5dc79SHONG Yifan change_setting_test( 335*bcb5dc79SHONG Yifan name = "change_setting_test", 336*bcb5dc79SHONG Yifan target_under_test = ":change_setting_fake_target", 337*bcb5dc79SHONG Yifan ) 338*bcb5dc79SHONG Yifan change_setting_fake_rule( 339*bcb5dc79SHONG Yifan name = "change_setting_fake_target", 340*bcb5dc79SHONG Yifan tags = ["manual"], 341*bcb5dc79SHONG Yifan ) 342*bcb5dc79SHONG Yifan 343*bcb5dc79SHONG Yifan failure_testing_test( 344*bcb5dc79SHONG Yifan name = "failure_testing_test", 345*bcb5dc79SHONG Yifan target_under_test = ":failure_testing_fake_target", 346*bcb5dc79SHONG Yifan ) 347*bcb5dc79SHONG Yifan failure_testing_fake_rule( 348*bcb5dc79SHONG Yifan name = "failure_testing_fake_target", 349*bcb5dc79SHONG Yifan tags = ["manual"], 350*bcb5dc79SHONG Yifan ) 351*bcb5dc79SHONG Yifan 352*bcb5dc79SHONG Yifan change_setting_with_failure_test( 353*bcb5dc79SHONG Yifan name = "change_setting_with_failure_test", 354*bcb5dc79SHONG Yifan target_under_test = ":change_setting_with_failure_fake_target", 355*bcb5dc79SHONG Yifan ) 356*bcb5dc79SHONG Yifan change_setting_with_failure_fake_rule( 357*bcb5dc79SHONG Yifan name = "change_setting_with_failure_fake_target", 358*bcb5dc79SHONG Yifan tags = ["manual"], 359*bcb5dc79SHONG Yifan ) 360*bcb5dc79SHONG Yifan 361*bcb5dc79SHONG Yifan inspect_actions_test( 362*bcb5dc79SHONG Yifan name = "inspect_actions_test", 363*bcb5dc79SHONG Yifan target_under_test = ":inspect_actions_fake_target", 364*bcb5dc79SHONG Yifan ) 365*bcb5dc79SHONG Yifan inspect_actions_fake_rule( 366*bcb5dc79SHONG Yifan name = "inspect_actions_fake_target", 367*bcb5dc79SHONG Yifan tags = ["manual"], 368*bcb5dc79SHONG Yifan ) 369*bcb5dc79SHONG Yifan 370*bcb5dc79SHONG Yifan inspect_aspect_test( 371*bcb5dc79SHONG Yifan name = "inspect_aspect_test", 372*bcb5dc79SHONG Yifan target_under_test = ":inspect_aspect_fake_target", 373*bcb5dc79SHONG Yifan ) 374*bcb5dc79SHONG Yifan inspect_aspect_fake_rule( 375*bcb5dc79SHONG Yifan name = "inspect_aspect_fake_target", 376*bcb5dc79SHONG Yifan tags = ["manual"], 377*bcb5dc79SHONG Yifan ) 378*bcb5dc79SHONG Yifan 379*bcb5dc79SHONG Yifan inspect_output_dirs_test( 380*bcb5dc79SHONG Yifan name = "inspect_output_dirs_test", 381*bcb5dc79SHONG Yifan target_under_test = ":inspect_output_dirs_fake_target", 382*bcb5dc79SHONG Yifan ) 383*bcb5dc79SHONG Yifan inspect_output_dirs_fake_rule( 384*bcb5dc79SHONG Yifan name = "inspect_output_dirs_fake_target", 385*bcb5dc79SHONG Yifan tags = ["manual"], 386*bcb5dc79SHONG Yifan ) 387*bcb5dc79SHONG Yifan 388*bcb5dc79SHONG Yifan loading_env = loadingtest.make("selftest") 389*bcb5dc79SHONG Yifan _loading_phase_test(loading_env) 390