tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
0
fork
atom
overview
issues
pulls
pipelines
cling: add a smoke test
Tom McLaughlin
2 years ago
46f5689c
646f0dcd
+35
-5
1 changed file
expand all
collapse all
unified
split
pkgs
development
interpreters
cling
default.nix
+35
-5
pkgs/development/interpreters/cling/default.nix
···
155
155
156
156
in
157
157
158
158
-
runCommand "cling-${unwrapped.version}" {
158
158
+
stdenv.mkDerivation {
159
159
+
pname = "cling";
160
160
+
version = unwrapped.version;
161
161
+
159
162
nativeBuildInputs = [ makeWrapper ];
160
163
inherit unwrapped flags;
161
164
inherit (unwrapped) meta;
162
162
-
} ''
163
163
-
makeWrapper $unwrapped/bin/cling $out/bin/cling \
164
164
-
--add-flags "$flags"
165
165
-
''
165
165
+
166
166
+
dontUnpack = true;
167
167
+
dontConfigure = true;
168
168
+
169
169
+
buildPhase = ''
170
170
+
runHook preBuild
171
171
+
172
172
+
makeWrapper $unwrapped/bin/cling $out/bin/cling \
173
173
+
--add-flags "$flags"
174
174
+
175
175
+
runHook postBuild
176
176
+
'';
177
177
+
178
178
+
doCheck = true;
179
179
+
checkPhase = ''
180
180
+
runHook preCheck
181
181
+
182
182
+
output=$($out/bin/cling <<EOF
183
183
+
#include <iostream>
184
184
+
std::cout << "hello world" << std::endl
185
185
+
EOF
186
186
+
)
187
187
+
188
188
+
echo "$output" | grep -q "Type C++ code and press enter to run it"
189
189
+
echo "$output" | grep -q "hello world"
190
190
+
191
191
+
runHook postCheck
192
192
+
'';
193
193
+
194
194
+
dontInstall = true;
195
195
+
}