/*
 * Copyright 2014 the original author or authors.
 *
 * 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 org.gradle.nativeplatform.test.internal;

import org.gradle.api.tasks.diagnostics.internal.text.TextReportBuilder;
import org.gradle.model.internal.manage.schema.ModelSchemaStore;
import org.gradle.nativeplatform.internal.AbstractNativeBinaryRenderer;
import org.gradle.nativeplatform.test.NativeTestSuiteBinarySpec;

import javax.inject.Inject;

public class NativeTestSuiteBinaryRenderer extends AbstractNativeBinaryRenderer<NativeTestSuiteBinarySpec> {
    @Inject
    public NativeTestSuiteBinaryRenderer(ModelSchemaStore schemaStore) {
        super(schemaStore);
    }

    @Override
    public Class<NativeTestSuiteBinarySpec> getTargetType() {
        return NativeTestSuiteBinarySpec.class;
    }

    @Override
    protected void renderTasks(NativeTestSuiteBinarySpec binary, TextReportBuilder builder) {
        builder.item("install using task", binary.getTasks().getInstall().getPath());
        builder.item("run using task", binary.getTasks().getRun().getPath());
    }

    @Override
    protected void renderOutputs(NativeTestSuiteBinarySpec binary, TextReportBuilder builder) {
        builder.item("executable file", binary.getExecutableFile());
    }
}

@@ -798,16 +798,121 @@
 aStore;%0A
+import org.gradle.nativeplatform.NativeBinarySpec;%0Aimport org.gradle.nativeplatform.NativeComponentSpec;%0A
 import o
@@ -971,24 +971,24 @@
 ryRenderer;%0A
-
 import org.g
@@ -1039,16 +1039,75 @@
 arySpec;
+%0Aimport org.gradle.nativeplatform.test.NativeTestSuiteSpec;
 %0A%0Aimport
@@ -1870,32 +1870,32 @@
 lder builder) %7B%0A
-
         builder.
@@ -1952,11 +1952,636 @@
 );%0A    %7D
+%0A%0A    @Override%0A    protected void renderDetails(NativeTestSuiteBinarySpec binary, TextReportBuilder builder) %7B%0A        NativeTestSuiteSpec testSuite = binary.getTestSuite();%0A        NativeComponentSpec testedComponent = testSuite.getTestedComponent();%0A        if (testedComponent!=null) %7B%0A            builder.item(%22component under test%22, testedComponent.getDisplayName());%0A        %7D%0A        NativeBinarySpec testedBinary = binary.getTestedBinary();%0A        if (testedBinary != null) %7B%0A            builder.item(%22binary under test%22, testedBinary.getDisplayName());%0A        %7D%0A        super.renderDetails(binary, builder);%0A    %7D
 %0A%7D%0A

Add component/binary under test to native test suite renderer