aboutsummaryrefslogtreecommitdiff
path: root/tests/manifest/task-response.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manifest/task-response.test')
-rw-r--r--tests/manifest/task-response.test114
1 files changed, 114 insertions, 0 deletions
diff --git a/tests/manifest/task-response.test b/tests/manifest/task-response.test
new file mode 100644
index 0000000..472cca7
--- /dev/null
+++ b/tests/manifest/task-response.test
@@ -0,0 +1,114 @@
+# file : tests/manifest/task-response.test
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+test.options += -ts
+
+: valid
+:
+: Roundtrip the task response manifest.
+:
+{
+ : session-not-empty
+ :
+ $* <<EOF >>EOF
+ : 1
+ session: abcd
+ challenge: xyz
+ :
+ name: libfoo
+ version: 1.0
+ repository: http://pkg.example.org/1/math
+ machine: windows_10-msvc_14
+ EOF
+
+ : session-empty
+ :
+ $* <<EOF >>EOF
+ : 1
+ session:
+ EOF
+}
+
+: redefinition
+:
+{
+ : session
+ :
+ $* <<EOI 2>'stdin:3:1: error: task response session redefinition' == 1
+ : 1
+ session: abcd
+ session: abcd
+ EOI
+
+ : challenge
+ :
+ $* <<EOI 2>'stdin:3:1: error: task response challenge redefinition' == 1
+ : 1
+ challenge: xyz
+ challenge: xyz
+ EOI
+}
+
+: invalid
+:
+{
+ : challenge
+ :
+ {
+ : empty
+ :
+ $* <<EOI 2>'stdin:2:11: error: empty task response challenge' == 1
+ : 1
+ challenge:
+ EOI
+
+ : redundant
+ :
+ $* <<EOI 2>'stdin:4:1: error: unexpected task response challenge' == 1
+ : 1
+ session:
+ challenge: abc
+ EOI
+ }
+
+ : task-unexpected
+ :
+ $* <<EOI 2>'stdin:3:1: error: single task response manifest expected' == 1
+ : 1
+ session:
+ :
+ EOI
+}
+
+: unknown-name
+:
+$* <<EOI 2>"stdin:2:1: error: unknown name 'x' in task response manifest" == 1
+: 1
+x:
+EOI
+
+: missed
+:
+{
+ : session
+ :
+ $* <<EOI 2>'stdin:2:1: error: no task response session specified' == 1
+ : 1
+ EOI
+
+ : challenge
+ :
+ $* <<EOI 2>'stdin:3:1: error: no task response challenge specified' == 1
+ : 1
+ session: abc
+ EOI
+
+ : task
+ :
+ $* <<EOI 2>'stdin:4:1: error: task manifest expected' == 1
+ : 1
+ session: abcd
+ challenge: xyz
+ EOI
+}