<?xml version='1.0' encoding='UTF-8'?>
<!--This is a configuration file for the integration of a tools into Galaxy (https://galaxyproject.org/). This file was automatically generated using CTDConverter.-->
<!--Proposed Tool Section: [Test]-->
<tool id="ofile-mult-typeparam" name="ofile-mult-typeparam" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@">
  <description>multiple Output File parameter tests</description>
  <macros>
    <token name="@EXECUTABLE@">ofile-mult-typeparam</token>
    <import>macros.xml</import>
  </macros>
  <expand macro="requirements"/>
  <expand macro="stdio"/>
  <command detect_errors="exit_code"><![CDATA[@QUOTE_FOO@
@EXT_FOO@
#import re

## Preprocessing
mkdir mandatory_mandatoryinput &&
mkdir ${' '.join(["'mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} && 
mkdir inp_mandatory_mandatoryinput &&
mkdir ${' '.join(["'inp_mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])} && 
${' '.join(["ln -s '%s' 'inp_mandatory_mandatoryinput/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])}
mkdir test_section_sect_mandatory_mandatoryinput &&
mkdir ${' '.join(["'test_section_sect_mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])} && 
mkdir test_section.sect_inp_mandatory_mandatoryinput &&
mkdir ${' '.join(["'test_section.sect_inp_mandatory_mandatoryinput/%s'" % (i) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])} && 
${' '.join(["ln -s '%s' 'test_section.sect_inp_mandatory_mandatoryinput/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])}

## Main program call

set -o pipefail &&
@EXECUTABLE@ -write_ctd ./ &&
python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hardcoded_json' &&
@EXECUTABLE@ -ini @EXECUTABLE@.ctd
-mandatory_mandatoryinput
${' '.join(["'mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext("tsv")) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])}
-inp_mandatory_mandatoryinput
${' '.join(["'inp_mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($inp_mandatory_mandatoryinput) if f])}
-test_section:sect_mandatory_mandatoryinput
${' '.join(["'test_section_sect_mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $test_section.sect_mandatory_mandatoryinput_type) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])}
-test_section:sect_inp_mandatory_mandatoryinput
${' '.join(["'test_section.sect_inp_mandatory_mandatoryinput/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])}

## Postprocessing
${' '.join(["&& mv -n 'mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'mandatory_mandatoryinput/%(bn)s/%(id)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "gext": $gxy2omsext("tsv")} for i, f in enumerate($inp_mandatory_mandatoryinput) if f])}
${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s.%(omsext)s' 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s'"%{"bn": i, "id": re.sub('[^\w\-_]', '_', f.element_identifier), "omsext":$test_section.sect_mandatory_mandatoryinput_type, "gext": $oms2gxyext(str($test_section.sect_mandatory_mandatoryinput_type))} for i, f in enumerate($test_section.sect_inp_mandatory_mandatoryinput) if f])}
#if "ctd_out_FLAG" in $OPTIONAL_OUTPUTS
  && mv '@EXECUTABLE@.ctd' '$ctd_out'
#end if]]></command>
  <configfiles>
    <inputs name="args_json" data_style="paths"/>
    <configfile name="hardcoded_json"><![CDATA[{}]]></configfile>
  </configfiles>
  <inputs>
    <param name="mandatory_mandatoryinput_type" argument="-mandatory_mandatoryinput_type" display="checkboxes" type="select" optional="false" label="string" help="">
      <option value="ewt">tsv (ewt)</option>
      <option value="ext">tsv (ext)</option>
      <expand macro="list_string_san" name="mandatory_mandatoryinput_type"/>
    </param>
    <param name="inp_mandatory_mandatoryinput" argument="-inp_mandatory_mandatoryinput" type="data" format="tsv" multiple="true" optional="false" label="input file" help=" select tsv data sets(s)"/>
    <section name="test_section" title="Test Section" help="" expanded="false">
      <param name="sect_mandatory_mandatoryinput_type" argument="-test_section:sect_mandatory_mandatoryinput_type" display="checkboxes" type="select" optional="false" label="string" help="">
        <option value="eut">txt (eut)</option>
        <option value="ewt">tsv (ewt)</option>
        <option value="ext">tsv (ext)</option>
        <expand macro="list_string_san" name="sect_mandatory_mandatoryinput_type"/>
      </param>
      <param name="sect_inp_mandatory_mandatoryinput" argument="-test_section:sect_inp_mandatory_mandatoryinput" type="data" format="tsv,txt" multiple="true" optional="false" label="input file" help=" select tsv,txt data sets(s)"/>
    </section>
    <expand macro="adv_opts_macro"/>
    <param name="OPTIONAL_OUTPUTS" type="select" optional="true" multiple="true" label="Optional outputs">
      <option value="ctd_out_FLAG">Output used ctd (ini) configuration file</option>
    </param>
  </inputs>
  <outputs>
    <collection type="list" name="mandatory_mandatoryinput" label="${tool.name} on ${on_string}: mandatory_mandatoryinput">
      <discover_datasets directory="mandatory_mandatoryinput" recurse="true" format="tsv" pattern="__name__"/>
    </collection>
    <collection type="list" name="test_section_sect_mandatory_mandatoryinput" label="${tool.name} on ${on_string}: test_section:sect_mandatory_mandatoryinput">
      <discover_datasets directory="test_section_sect_mandatory_mandatoryinput" recurse="true" pattern="__name_and_ext__"/>
    </collection>
    <data name="ctd_out" format="xml" label="${tool.name} on ${on_string}: ctd">
      <filter>OPTIONAL_OUTPUTS is not None and "ctd_out_FLAG" in OPTIONAL_OUTPUTS</filter>
    </data>
  </outputs>
  <tests>
    <test expect_num_outputs="2">
      <param name="mandatory_mandatoryinput_type" value="ewt"/>
      <param name="inp_mandatory_mandatoryinput" ftype="tsv" value="0test.ext,0test2.ext"/>
      <section name="test_section">
        <param name="sect_mandatory_mandatoryinput_type" value="eut"/>
        <param name="sect_inp_mandatory_mandatoryinput" ftype="tsv" value="1test.ext,1test2.ext"/>
      </section>
      <conditional name="adv_opts_cond">
        <param name="adv_opts_selector" value="advanced"/>
      </conditional>
      <output_collection name="mandatory_mandatoryinput"/>
      <output_collection name="test_section_sect_mandatory_mandatoryinput"/>
    </test>
  </tests>
  <help><![CDATA[Multiple Output File parameter tests.


For more information, visit http://www.openms.de/unavailable.html]]></help>
  <expand macro="references"/>
</tool>
