summaryrefslogtreecommitdiff
path: root/android/rule_builder_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/rule_builder_test.go')
-rw-r--r--android/rule_builder_test.go47
1 files changed, 6 insertions, 41 deletions
diff --git a/android/rule_builder_test.go b/android/rule_builder_test.go
index 9e5f12dff..6a8a964a1 100644
--- a/android/rule_builder_test.go
+++ b/android/rule_builder_test.go
@@ -48,7 +48,6 @@ func builderContext() BuilderContext {
"a": nil,
"b": nil,
"ls": nil,
- "ln": nil,
"turbine": nil,
"java": nil,
"javac": nil,
@@ -81,32 +80,6 @@ func ExampleRuleBuilder() {
// outputs: ["out/soong/linked"]
}
-func ExampleRuleBuilder_SymlinkOutputs() {
- ctx := builderContext()
-
- rule := NewRuleBuilder(pctx, ctx)
-
- rule.Command().
- Tool(PathForSource(ctx, "ln")).
- FlagWithInput("-s ", PathForTesting("a.o")).
- SymlinkOutput(PathForOutput(ctx, "a"))
- rule.Command().Text("cp out/soong/a out/soong/b").
- ImplicitSymlinkOutput(PathForOutput(ctx, "b"))
-
- fmt.Printf("commands: %q\n", strings.Join(rule.Commands(), " && "))
- fmt.Printf("tools: %q\n", rule.Tools())
- fmt.Printf("inputs: %q\n", rule.Inputs())
- fmt.Printf("outputs: %q\n", rule.Outputs())
- fmt.Printf("symlink_outputs: %q\n", rule.SymlinkOutputs())
-
- // Output:
- // commands: "ln -s a.o out/soong/a && cp out/soong/a out/soong/b"
- // tools: ["ln"]
- // inputs: ["a.o"]
- // outputs: ["out/soong/a" "out/soong/b"]
- // symlink_outputs: ["out/soong/a" "out/soong/b"]
-}
-
func ExampleRuleBuilder_Temporary() {
ctx := builderContext()
@@ -334,8 +307,6 @@ func TestRuleBuilder(t *testing.T) {
Output(PathForOutput(ctx, "module/Output")).
OrderOnly(PathForSource(ctx, "OrderOnly")).
Validation(PathForSource(ctx, "Validation")).
- SymlinkOutput(PathForOutput(ctx, "module/SymlinkOutput")).
- ImplicitSymlinkOutput(PathForOutput(ctx, "module/ImplicitSymlinkOutput")).
Text("Text").
Tool(PathForSource(ctx, "Tool"))
@@ -367,15 +338,13 @@ func TestRuleBuilder(t *testing.T) {
wantRspFileInputs := Paths{PathForSource(ctx, "RspInput"),
PathForOutput(ctx, "other/RspOutput2")}
wantOutputs := PathsForOutput(ctx, []string{
- "module/ImplicitOutput", "module/ImplicitSymlinkOutput", "module/Output", "module/SymlinkOutput",
- "module/output", "module/output2", "module/output3"})
+ "module/ImplicitOutput", "module/Output", "module/output", "module/output2",
+ "module/output3"})
wantDepFiles := PathsForOutput(ctx, []string{
"module/DepFile", "module/depfile", "module/ImplicitDepFile", "module/depfile2"})
wantTools := PathsForSource(ctx, []string{"Tool", "tool2"})
wantOrderOnlys := PathsForSource(ctx, []string{"OrderOnly", "OrderOnlys"})
wantValidations := PathsForSource(ctx, []string{"Validation", "Validations"})
- wantSymlinkOutputs := PathsForOutput(ctx, []string{
- "module/ImplicitSymlinkOutput", "module/SymlinkOutput"})
t.Run("normal", func(t *testing.T) {
rule := NewRuleBuilder(pctx, ctx)
@@ -384,7 +353,7 @@ func TestRuleBuilder(t *testing.T) {
wantCommands := []string{
"out_local/soong/module/DepFile Flag FlagWithArg=arg FlagWithDepFile=out_local/soong/module/depfile " +
"FlagWithInput=input FlagWithOutput=out_local/soong/module/output FlagWithRspFileInputList=out_local/soong/rsp " +
- "Input out_local/soong/module/Output out_local/soong/module/SymlinkOutput Text Tool after command2 old cmd",
+ "Input out_local/soong/module/Output Text Tool after command2 old cmd",
"command2 out_local/soong/module/depfile2 input2 out_local/soong/module/output2 tool2",
"command3 input3 out_local/soong/module/output2 out_local/soong/module/output3 input3 out_local/soong/module/output2",
}
@@ -397,7 +366,6 @@ func TestRuleBuilder(t *testing.T) {
AssertDeepEquals(t, "rule.Inputs()", wantInputs, rule.Inputs())
AssertDeepEquals(t, "rule.RspfileInputs()", wantRspFileInputs, rule.RspFileInputs())
AssertDeepEquals(t, "rule.Outputs()", wantOutputs, rule.Outputs())
- AssertDeepEquals(t, "rule.SymlinkOutputs()", wantSymlinkOutputs, rule.SymlinkOutputs())
AssertDeepEquals(t, "rule.DepFiles()", wantDepFiles, rule.DepFiles())
AssertDeepEquals(t, "rule.Tools()", wantTools, rule.Tools())
AssertDeepEquals(t, "rule.OrderOnlys()", wantOrderOnlys, rule.OrderOnlys())
@@ -415,7 +383,7 @@ func TestRuleBuilder(t *testing.T) {
"__SBOX_SANDBOX_DIR__/out/DepFile Flag FlagWithArg=arg FlagWithDepFile=__SBOX_SANDBOX_DIR__/out/depfile " +
"FlagWithInput=input FlagWithOutput=__SBOX_SANDBOX_DIR__/out/output " +
"FlagWithRspFileInputList=out_local/soong/rsp Input __SBOX_SANDBOX_DIR__/out/Output " +
- "__SBOX_SANDBOX_DIR__/out/SymlinkOutput Text Tool after command2 old cmd",
+ "Text Tool after command2 old cmd",
"command2 __SBOX_SANDBOX_DIR__/out/depfile2 input2 __SBOX_SANDBOX_DIR__/out/output2 tool2",
"command3 input3 __SBOX_SANDBOX_DIR__/out/output2 __SBOX_SANDBOX_DIR__/out/output3 input3 __SBOX_SANDBOX_DIR__/out/output2",
}
@@ -427,7 +395,6 @@ func TestRuleBuilder(t *testing.T) {
AssertDeepEquals(t, "rule.Inputs()", wantInputs, rule.Inputs())
AssertDeepEquals(t, "rule.RspfileInputs()", wantRspFileInputs, rule.RspFileInputs())
AssertDeepEquals(t, "rule.Outputs()", wantOutputs, rule.Outputs())
- AssertDeepEquals(t, "rule.SymlinkOutputs()", wantSymlinkOutputs, rule.SymlinkOutputs())
AssertDeepEquals(t, "rule.DepFiles()", wantDepFiles, rule.DepFiles())
AssertDeepEquals(t, "rule.Tools()", wantTools, rule.Tools())
AssertDeepEquals(t, "rule.OrderOnlys()", wantOrderOnlys, rule.OrderOnlys())
@@ -445,7 +412,7 @@ func TestRuleBuilder(t *testing.T) {
"__SBOX_SANDBOX_DIR__/out/DepFile Flag FlagWithArg=arg FlagWithDepFile=__SBOX_SANDBOX_DIR__/out/depfile " +
"FlagWithInput=input FlagWithOutput=__SBOX_SANDBOX_DIR__/out/output " +
"FlagWithRspFileInputList=out_local/soong/rsp Input __SBOX_SANDBOX_DIR__/out/Output " +
- "__SBOX_SANDBOX_DIR__/out/SymlinkOutput Text __SBOX_SANDBOX_DIR__/tools/src/Tool after command2 old cmd",
+ "Text __SBOX_SANDBOX_DIR__/tools/src/Tool after command2 old cmd",
"command2 __SBOX_SANDBOX_DIR__/out/depfile2 input2 __SBOX_SANDBOX_DIR__/out/output2 __SBOX_SANDBOX_DIR__/tools/src/tool2",
"command3 input3 __SBOX_SANDBOX_DIR__/out/output2 __SBOX_SANDBOX_DIR__/out/output3 input3 __SBOX_SANDBOX_DIR__/out/output2",
}
@@ -457,7 +424,6 @@ func TestRuleBuilder(t *testing.T) {
AssertDeepEquals(t, "rule.Inputs()", wantInputs, rule.Inputs())
AssertDeepEquals(t, "rule.RspfileInputs()", wantRspFileInputs, rule.RspFileInputs())
AssertDeepEquals(t, "rule.Outputs()", wantOutputs, rule.Outputs())
- AssertDeepEquals(t, "rule.SymlinkOutputs()", wantSymlinkOutputs, rule.SymlinkOutputs())
AssertDeepEquals(t, "rule.DepFiles()", wantDepFiles, rule.DepFiles())
AssertDeepEquals(t, "rule.Tools()", wantTools, rule.Tools())
AssertDeepEquals(t, "rule.OrderOnlys()", wantOrderOnlys, rule.OrderOnlys())
@@ -475,7 +441,7 @@ func TestRuleBuilder(t *testing.T) {
"__SBOX_SANDBOX_DIR__/out/DepFile Flag FlagWithArg=arg FlagWithDepFile=__SBOX_SANDBOX_DIR__/out/depfile " +
"FlagWithInput=input FlagWithOutput=__SBOX_SANDBOX_DIR__/out/output " +
"FlagWithRspFileInputList=__SBOX_SANDBOX_DIR__/out/soong/rsp Input __SBOX_SANDBOX_DIR__/out/Output " +
- "__SBOX_SANDBOX_DIR__/out/SymlinkOutput Text __SBOX_SANDBOX_DIR__/tools/src/Tool after command2 old cmd",
+ "Text __SBOX_SANDBOX_DIR__/tools/src/Tool after command2 old cmd",
"command2 __SBOX_SANDBOX_DIR__/out/depfile2 input2 __SBOX_SANDBOX_DIR__/out/output2 __SBOX_SANDBOX_DIR__/tools/src/tool2",
"command3 input3 __SBOX_SANDBOX_DIR__/out/output2 __SBOX_SANDBOX_DIR__/out/output3 input3 __SBOX_SANDBOX_DIR__/out/output2",
}
@@ -487,7 +453,6 @@ func TestRuleBuilder(t *testing.T) {
AssertDeepEquals(t, "rule.Inputs()", wantInputs, rule.Inputs())
AssertDeepEquals(t, "rule.RspfileInputs()", wantRspFileInputs, rule.RspFileInputs())
AssertDeepEquals(t, "rule.Outputs()", wantOutputs, rule.Outputs())
- AssertDeepEquals(t, "rule.SymlinkOutputs()", wantSymlinkOutputs, rule.SymlinkOutputs())
AssertDeepEquals(t, "rule.DepFiles()", wantDepFiles, rule.DepFiles())
AssertDeepEquals(t, "rule.Tools()", wantTools, rule.Tools())
AssertDeepEquals(t, "rule.OrderOnlys()", wantOrderOnlys, rule.OrderOnlys())