-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathcompile.smoke.yaml
234 lines (212 loc) · 5.61 KB
/
compile.smoke.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
working-directory: ./../../../
tests:
- name: shows-file-argument-for-autocompletion
command:
- juvix
- compile
- --help
stdout:
contains:
JUVIX_FILE
exit-status: 0
- name: hello-world-no-arg
command:
shell:
- bash
script: |
cd ./examples/milestone/HelloWorld
juvix compile
./HelloWorld
exit-status: 0
stdout: |
hello world!
- name: hello-world-no-arg-error
command:
shell:
- bash
script: |
temp=$(mktemp -d)
trap 'rm -rf -- "$temp"' EXIT
cd ./examples/milestone/
cp -r HelloWorld "$temp"
cd "$temp/HelloWorld"
sed -i'.bak' 's/just \"HelloWorld.juvix\"/nothing/' Package.juvix
juvix compile
exit-status: 1
stdout: |
A path to the main file must be given in the CLI or specified in the `main` field of the juvix.yaml file
- name: hello-world
command:
shell:
- bash
script: |
cd ./examples/milestone/HelloWorld
juvix compile HelloWorld.juvix
./HelloWorld
exit-status: 0
stdout: |
hello world!
- name: option-output-file
command:
shell:
- bash
script: |
temp=$(mktemp -d)
trap 'rm -rf -- "$temp"' EXIT
cd ./examples/milestone/HelloWorld
juvix compile -o $temp/Hello HelloWorld.juvix
$temp/Hello
exit-status: 0
stdout: |
hello world!
- name: flag-internal-build-dir
command:
shell:
- bash
script: |
buildDir=$(mktemp -d)
rootDir=$(mktemp -d)
trap 'rm -rf -- "$buildDir"' EXIT
trap 'rm -rf -- "$rootDir"' EXIT
cp ./examples/milestone/HelloWorld/HelloWorld.juvix "$rootDir"
touch "$rootDir/juvix.yaml"
cd "$rootDir"
juvix compile HelloWorld.juvix --internal-build-dir "$buildDir"
num_files=$(ls -1qA "$buildDir" | wc -l)
if [ $num_files -le 0 ]; then
exit 1
fi
if [ -d "$rootDir/.juvix-build" ]; then
exit 1
fi
stdout: ""
exit-status: 0
- name: stdlib-in-default-build-dir
command:
shell:
- bash
script: |
rootDir=$(mktemp -d)
trap 'rm -rf -- "$rootDir"' EXIT
cp ./examples/milestone/HelloWorld/HelloWorld.juvix "$rootDir"
touch "$rootDir/juvix.yaml"
echo "dependencies: [.juvix-build/stdlib]" >> "$rootDir/juvix.yaml"
cd "$rootDir"
juvix compile HelloWorld.juvix
if [ ! -d "$rootDir/.juvix-build" ]; then
exit 1
fi
stdout: ""
exit-status: 0
- name: default-output-file-in-invoke-dir
command:
shell:
- bash
script: |
temp=$(mktemp -d)
trap 'rm -rf -- "$temp"' EXIT
testdir=$PWD/examples/milestone/HelloWorld
cd $temp
juvix compile $testdir/HelloWorld.juvix
./HelloWorld
stdout: |
hello world!
exit-status: 0
- name: target-wasm
command:
shell:
- bash
script: |
temp=$(mktemp -d)
trap 'rm -rf -- "$temp"' EXIT
testdir=$PWD/examples/milestone/HelloWorld
cd $temp
juvix compile -t wasm32-wasi $testdir/HelloWorld.juvix
[ -f HelloWorld.wasm ]
stdout: ""
exit-status: 0
- name: target-geb
command:
shell:
- bash
script: |
temp=$(mktemp -d)
trap 'rm -rf -- "$temp"' EXIT
testdir=$PWD/tests/Geb/positive/Compilation
cd $temp
juvix compile -t geb $testdir/test001.juvix
[ -f test001.lisp ]
stdout: ""
exit-status: 0
- name: target-anoma
command:
shell:
- bash
script: |
temp=$(mktemp -d)
trap 'rm -rf -- "$temp"' EXIT
testdir=$PWD/tests/Anoma/positive/Compilation
cd $temp
juvix compile -t anoma $testdir/test001.juvix
[ -f test001.nockma ]
juvix dev nockma repl test001.nockma
stdout:
contains:
"true"
stdin: "[call [L [replace [RL [quote 0]] [@ S]]]]"
exit-status: 0
- name: target-vampir
command:
shell:
- bash
script: |
temp=$(mktemp -d)
trap 'rm -rf -- "$temp"' EXIT
testdir=$PWD/tests/VampIR/positive/Compilation
cd $temp
juvix compile -t vampir $testdir/test001.juvix
grep -q 'VampIR runtime for Juvix (safe version)' test001.pir
stdout: ""
exit-status: 0
- name: target-varmpir-unsafe
command:
shell:
- bash
script: |
temp=$(mktemp -d)
trap 'rm -rf -- "$temp"' EXIT
testdir=$PWD/tests/VampIR/positive/Compilation
cd $temp
juvix compile -t vampir $testdir/test001.juvix --unsafe
grep -q 'VampIR runtime for Juvix (unsafe version)' test001.pir
stdout: ""
exit-status: 0
- name: input-file-does-not-exist
command:
- juvix
- compile
- positive/NonExistingCompileFile.juvix
stderr:
contains: |
positive/NonExistingCompileFile.juvix" does not exist
exit-status: 1
- name: hello-world-symlink-XDG_CONFIG_DIR
command:
shell:
- bash
script: |
base=$PWD
config=$(mktemp -d)
temp=$(mktemp -d)
trap 'rm -rf -- "$temp"' EXIT
trap 'rm -rf -- "$config"' EXIT
mkdir "$config/root"
ln -s "$config/root" "$config/symlink"
cd $temp
cp "$base"/examples/milestone/HelloWorld/HelloWorld.juvix .
export XDG_CONFIG_HOME="$config/symlink"
juvix compile HelloWorld.juvix
./HelloWorld
exit-status: 0
stdout: |
hello world!