// Copyright 2022 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package bp2build

import (
	"fmt"
	"testing"

	"android/soong/linkerconfig"
)

func runLinkerConfigTestCase(t *testing.T, tc bp2buildTestCase) {
	t.Helper()
	(&tc).moduleTypeUnderTest = "linker_config"
	(&tc).moduleTypeUnderTestFactory = linkerconfig.LinkerConfigFactory
	runBp2BuildTestCaseSimple(t, tc)
}

func TestLinkerConfigConvertsSrc(t *testing.T) {
	runLinkerConfigTestCase(t,
		bp2buildTestCase{
			blueprint: `
linker_config {
	name: "foo",
	src: "a.json",
}
`,
			expectedBazelTargets: []string{makeBazelTarget("linker_config", "foo", attrNameToString{
				"src": `"a.json"`,
			})},
		})

}

func TestLinkerConfigNoSrc(t *testing.T) {
	runLinkerConfigTestCase(t,
		bp2buildTestCase{
			blueprint: `
linker_config {
	name: "foo",
}
`,
			expectedBazelTargets: []string{},
			expectedErr:          fmt.Errorf("Android.bp:2:1: module \"foo\": src: empty src is not supported"),
		})

}
