about summary refs log tree commit diff
path: root/e2e-tests/tools
diff options
context:
space:
mode:
Diffstat (limited to 'e2e-tests/tools')
-rw-r--r--e2e-tests/tools/capture-output-file-with-parameter-reference.scm9
-rw-r--r--e2e-tests/tools/capture-output-file.scm9
-rw-r--r--e2e-tests/tools/capture-stdout.scm8
-rw-r--r--e2e-tests/tools/checksum.scm22
-rw-r--r--e2e-tests/tools/decompress-compile-run.scm22
-rw-r--r--e2e-tests/tools/inline-javascript-requirement.scm4
-rw-r--r--e2e-tests/tools/pass-stdin.scm8
-rw-r--r--e2e-tests/tools/prefix-arguments.scm3
-rw-r--r--e2e-tests/tools/scatter.scm8
-rw-r--r--e2e-tests/tools/spell-check.scm33
-rw-r--r--e2e-tests/tools/staging-input-files.scm4
11 files changed, 130 insertions, 0 deletions
diff --git a/e2e-tests/tools/capture-output-file-with-parameter-reference.scm b/e2e-tests/tools/capture-output-file-with-parameter-reference.scm
new file mode 100644
index 0000000..6bc4b7d
--- /dev/null
+++ b/e2e-tests/tools/capture-output-file-with-parameter-reference.scm
@@ -0,0 +1,9 @@
+(define extract-specific-file
+  (command #:inputs (archive #:type File) (extractfile #:type string)
+           #:run "tar" "--extract" "--file" archive extractfile
+           #:outputs (extracted_file
+                      #:type File
+                      #:binding ((glob . "$(inputs.extractfile)")))))
+
+(workflow ((archive #:type File) (extractfile #:type string))
+  (extract-specific-file #:archive archive #:extractfile extractfile))
diff --git a/e2e-tests/tools/capture-output-file.scm b/e2e-tests/tools/capture-output-file.scm
new file mode 100644
index 0000000..80b4654
--- /dev/null
+++ b/e2e-tests/tools/capture-output-file.scm
@@ -0,0 +1,9 @@
+(define extract
+  (command #:inputs (archive #:type File)
+           #:run "tar" "--extract" "--file" archive
+           #:outputs (extracted_file
+                      #:type File
+                      #:binding ((glob . "hello.txt")))))
+
+(workflow ((archive #:type File))
+  (extract #:archive archive))
diff --git a/e2e-tests/tools/capture-stdout.scm b/e2e-tests/tools/capture-stdout.scm
new file mode 100644
index 0000000..0901f4d
--- /dev/null
+++ b/e2e-tests/tools/capture-stdout.scm
@@ -0,0 +1,8 @@
+(define print
+  (command #:inputs (message #:type string)
+           #:run "echo" message
+           #:outputs (printed_message #:type stdout)
+           #:stdout "printed-message-output.txt"))
+
+(workflow ((message #:type string))
+  (print #:message message))
diff --git a/e2e-tests/tools/checksum.scm b/e2e-tests/tools/checksum.scm
new file mode 100644
index 0000000..27dec78
--- /dev/null
+++ b/e2e-tests/tools/checksum.scm
@@ -0,0 +1,22 @@
+(define md5sum
+  (command #:inputs (file #:type File #:stage? #t)
+           #:run "md5sum" "$(inputs.file.basename)"
+           #:outputs (md5 #:type stdout)
+           #:stdout "md5"))
+
+(define sha1sum
+  (command #:inputs (file #:type File #:stage? #t)
+           #:run "sha1sum" "$(inputs.file.basename)"
+           #:outputs (sha1 #:type stdout)
+           #:stdout "sha1"))
+
+(define sha256sum
+  (command #:inputs (file #:type File #:stage? #t)
+           #:run "sha256sum" "$(inputs.file.basename)"
+           #:outputs (sha256 #:type stdout)
+           #:stdout "sha256"))
+
+(workflow ((file #:type File))
+  (tee (md5sum #:file file)
+       (sha1sum #:file file)
+       (sha256sum #:file file)))
diff --git a/e2e-tests/tools/decompress-compile-run.scm b/e2e-tests/tools/decompress-compile-run.scm
new file mode 100644
index 0000000..884f6a4
--- /dev/null
+++ b/e2e-tests/tools/decompress-compile-run.scm
@@ -0,0 +1,22 @@
+(define decompress
+  (command #:inputs (compressed #:type File)
+           #:run "gzip" "--stdout" "--decompress" compressed
+           #:outputs (decompressed #:type stdout)))
+
+(define compile
+  (command #:inputs (source #:type File)
+           #:run "gcc" "-x" "c" source
+           #:outputs (executable
+                      #:type File
+                      #:binding ((glob . "a.out")))))
+
+(define run
+  (command #:inputs executable
+           #:run executable
+           #:outputs (stdout #:type stdout)
+           #:stdout "run-output.txt"))
+
+(workflow ((compressed_source #:type File))
+  (pipe (decompress #:compressed compressed_source)
+        (compile #:source decompressed)
+        (run #:executable executable)))
diff --git a/e2e-tests/tools/inline-javascript-requirement.scm b/e2e-tests/tools/inline-javascript-requirement.scm
new file mode 100644
index 0000000..cd6a4e5
--- /dev/null
+++ b/e2e-tests/tools/inline-javascript-requirement.scm
@@ -0,0 +1,4 @@
+(command #:inputs (number #:type int)
+         #:run "echo" "$(1 + inputs.number)"
+         #:outputs (sum #:type stdout)
+         #:requirements ((InlineJavascriptRequirement)))
diff --git a/e2e-tests/tools/pass-stdin.scm b/e2e-tests/tools/pass-stdin.scm
new file mode 100644
index 0000000..4ba251c
--- /dev/null
+++ b/e2e-tests/tools/pass-stdin.scm
@@ -0,0 +1,8 @@
+(define count-bytes
+  (command #:inputs (file #:type File)
+           #:run "wc" "-c"
+           #:outputs (bytes #:type stdout)
+           #:stdin file))
+
+(workflow ((file #:type File))
+  (count-bytes #:file file))
diff --git a/e2e-tests/tools/prefix-arguments.scm b/e2e-tests/tools/prefix-arguments.scm
new file mode 100644
index 0000000..d680ace
--- /dev/null
+++ b/e2e-tests/tools/prefix-arguments.scm
@@ -0,0 +1,3 @@
+(command #:inputs (last #:type int) (separator #:type string)
+         #:run "seq" ("-s" separator) last
+         #:outputs (sequence #:type stdout))
diff --git a/e2e-tests/tools/scatter.scm b/e2e-tests/tools/scatter.scm
new file mode 100644
index 0000000..805f4df
--- /dev/null
+++ b/e2e-tests/tools/scatter.scm
@@ -0,0 +1,8 @@
+(define print
+  (command #:inputs (message #:type string) (other-message #:type string)
+           #:run "echo" message other-message
+           #:outputs (printed_output #:type stdout)))
+
+(workflow ((message #:type string) (other_messages #:type (array string)))
+  (scatter (print #:message message)
+           #:other-message other_messages))
diff --git a/e2e-tests/tools/spell-check.scm b/e2e-tests/tools/spell-check.scm
new file mode 100644
index 0000000..d5ccebb
--- /dev/null
+++ b/e2e-tests/tools/spell-check.scm
@@ -0,0 +1,33 @@
+(define split-words
+  (command #:inputs text
+           #:run "tr" "--complement" "--squeeze-repeats" "A-Za-z" "\\n"
+           #:stdin text
+           #:outputs (words #:type stdout)))
+
+(define downcase
+  (command #:inputs words
+           #:run "tr" "A-Z" "a-z"
+           #:stdin words
+           #:outputs (downcased-words #:type stdout)))
+
+(define sort
+  (command #:inputs words
+           #:run "sort" "--unique"
+           #:stdin words
+           #:outputs (sorted #:type stdout)))
+ 
+(define find-misspellings
+  (command #:inputs words dictionary
+           #:run "comm" "-23" words dictionary
+           #:outputs (misspellings #:type stdout)
+           #:stdout "misspelt-words"))
+
+(workflow (text-file dictionary)
+  (pipe (tee (pipe (split-words #:text text-file)
+                   (downcase #:words words)
+                   (sort (sort-words) #:words downcased-words)
+                   (rename #:sorted-words sorted))
+             (pipe (sort (sort-dictionary) #:words dictionary)
+                   (rename #:sorted-dictionary sorted)))
+        (find-misspellings #:words sorted-words
+                           #:dictionary sorted-dictionary)))
diff --git a/e2e-tests/tools/staging-input-files.scm b/e2e-tests/tools/staging-input-files.scm
new file mode 100644
index 0000000..f81ee47
--- /dev/null
+++ b/e2e-tests/tools/staging-input-files.scm
@@ -0,0 +1,4 @@
+(command #:inputs (file #:type File
+                        #:stage? #t)
+         #:run "cat" "./$(inputs.file.basename)"
+         #:outputs (output_file #:type stdout))