Skip to content

Commit 2235832

Browse files
committed

38 files changed

+1762
-4
lines changed

src/test/java/org/w3id/cwl/cwl1_2/utils/ExamplesTest.java

Lines changed: 796 additions & 4 deletions
Large diffs are not rendered by default.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class: CommandLineTool
2+
cwlVersion: v1.2
3+
inputs:
4+
p: File
5+
checkname: string
6+
outputs: []
7+
arguments:
8+
- sh
9+
- "-c"
10+
- |
11+
name=`basename $(inputs.p.path)`
12+
ls -l $(inputs.p.path)
13+
if test $name = $(inputs.checkname) ; then
14+
echo success
15+
else
16+
echo expected basename to be $(inputs.checkname) but was $name
17+
exit 1
18+
fi
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class: CommandLineTool
2+
cwlVersion: v1.2
3+
baseCommand: "true"
4+
requirements:
5+
InitialWorkDirRequirement:
6+
listing:
7+
- entryname: $(inputs.newname)
8+
entry: $(inputs.srcfile)
9+
inputs:
10+
srcfile: File
11+
newname: string
12+
outputs:
13+
outfile:
14+
type: File
15+
outputBinding:
16+
glob: $(inputs.newname)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env cwl-runner
2+
class: CommandLineTool
3+
cwlVersion: v1.2
4+
5+
requirements:
6+
- class: InlineJavascriptRequirement
7+
- class: SchemaDefRequirement
8+
types:
9+
- $import: schemadef_types_with_import_readgroup.yml
10+
11+
inputs:
12+
- id: message
13+
type: "schemadef_types_with_import_readgroup.yml#readgroups_bam_file"
14+
inputBinding:
15+
valueFrom: $(self.readgroup_meta_list[0]['DT'])
16+
17+
outputs:
18+
- id: out
19+
type: string
20+
outputBinding:
21+
glob: output.txt
22+
loadContents: true
23+
outputEval: $(self[0].contents)
24+
25+
stdout: output.txt
26+
baseCommand: echo
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
- name: readgroup_meta
2+
type: record
3+
fields:
4+
- name: CN
5+
type: string
6+
- name: DT
7+
type: string
8+
- name: ID
9+
type: string
10+
- name: LB
11+
type: string
12+
- name: PI
13+
type: string
14+
- name: PL
15+
type: string
16+
- name: SM
17+
type: string
18+
19+
- name: readgroups_bam_file
20+
type: record
21+
fields:
22+
- name: bam
23+
type: File
24+
- name: readgroup_meta_list
25+
type:
26+
type: array
27+
items: readgroup_meta
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env cwl-runner
2+
class: CommandLineTool
3+
cwlVersion: v1.2
4+
inputs:
5+
dir1:
6+
type: Directory
7+
inputBinding:
8+
valueFrom: $(self.listing[0].listing[0].path)
9+
outputs:
10+
output_file:
11+
type: File
12+
outputBinding: {glob: output.txt}
13+
baseCommand: cat
14+
stdout: output.txt
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class: CommandLineTool
2+
cwlVersion: v1.2
3+
inputs:
4+
p: File
5+
checkname: string
6+
outputs: []
7+
arguments:
8+
- sh
9+
- "-c"
10+
- |
11+
name=`basename $(inputs.p.path)`
12+
ls -l $(inputs.p.path)
13+
if test $name = $(inputs.checkname) ; then
14+
echo success
15+
else
16+
echo expected basename to be $(inputs.checkname) but was $name
17+
exit 1
18+
fi
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env cwl-runner
2+
class: CommandLineTool
3+
cwlVersion: v1.2
4+
hints:
5+
DockerRequirement:
6+
dockerPull: docker.io/bash:4.4
7+
inputs:
8+
input_file: File
9+
outdir_name: string
10+
11+
baseCommand: [ bash, -c ]
12+
stdout: re:sult
13+
arguments:
14+
- |
15+
mkdir $(inputs.outdir_name);
16+
cp $(inputs.input_file.path) $(inputs.outdir_name)/;
17+
echo Status: done!
18+
outputs:
19+
log: stdout
20+
result:
21+
type: Directory
22+
outputBinding:
23+
glob: $(inputs.outdir_name)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env cwl-runner
2+
class: CommandLineTool
3+
cwlVersion: v1.2
4+
hints:
5+
DockerRequirement:
6+
dockerPull: docker.io/bash:4.4
7+
inputs:
8+
input_file: File
9+
outdir_name: string
10+
11+
baseCommand: [ bash, -c ]
12+
arguments:
13+
- |
14+
mkdir $(inputs.outdir_name);
15+
cp $(inputs.input_file.path) $(inputs.outdir_name)/;
16+
outputs:
17+
result:
18+
type: Directory
19+
outputBinding:
20+
glob: $(inputs.outdir_name)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
cwlVersion: v1.0
2+
3+
class: CommandLineTool
4+
5+
requirements:
6+
- class: InlineJavascriptRequirement
7+
8+
baseCommand: ['echo']
9+
10+
inputs:
11+
message:
12+
type:
13+
type: record
14+
name: message_object
15+
fields:
16+
text:
17+
type: string
18+
inputBinding:
19+
position: 1
20+
newlines:
21+
type: boolean?
22+
inputBinding:
23+
position: 0
24+
prefix: -n
25+
26+
outputs:
27+
out:
28+
type: string
29+
outputBinding:
30+
glob: output.txt
31+
loadContents: true
32+
outputEval: $(self[0].contents)
33+
stdout: output.txt

0 commit comments

Comments
 (0)