cling: add a smoke test
This commit is contained in:
parent
646f0dcd01
commit
46f5689c73
1 changed files with 35 additions and 5 deletions
|
@ -155,11 +155,41 @@ let
|
|||
|
||||
in
|
||||
|
||||
runCommand "cling-${unwrapped.version}" {
|
||||
stdenv.mkDerivation {
|
||||
pname = "cling";
|
||||
version = unwrapped.version;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
inherit unwrapped flags;
|
||||
inherit (unwrapped) meta;
|
||||
} ''
|
||||
|
||||
dontUnpack = true;
|
||||
dontConfigure = true;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
makeWrapper $unwrapped/bin/cling $out/bin/cling \
|
||||
--add-flags "$flags"
|
||||
''
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
|
||||
output=$($out/bin/cling <<EOF
|
||||
#include <iostream>
|
||||
std::cout << "hello world" << std::endl
|
||||
EOF
|
||||
)
|
||||
|
||||
echo "$output" | grep -q "Type C++ code and press enter to run it"
|
||||
echo "$output" | grep -q "hello world"
|
||||
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
dontInstall = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue