cling: add a smoke test

Changed files
+35 -5
pkgs
development
interpreters
cling
+35 -5
pkgs/development/interpreters/cling/default.nix
··· 155 155 156 156 in 157 157 158 - runCommand "cling-${unwrapped.version}" { 158 + stdenv.mkDerivation { 159 + pname = "cling"; 160 + version = unwrapped.version; 161 + 159 162 nativeBuildInputs = [ makeWrapper ]; 160 163 inherit unwrapped flags; 161 164 inherit (unwrapped) meta; 162 - } '' 163 - makeWrapper $unwrapped/bin/cling $out/bin/cling \ 164 - --add-flags "$flags" 165 - '' 165 + 166 + dontUnpack = true; 167 + dontConfigure = true; 168 + 169 + buildPhase = '' 170 + runHook preBuild 171 + 172 + makeWrapper $unwrapped/bin/cling $out/bin/cling \ 173 + --add-flags "$flags" 174 + 175 + runHook postBuild 176 + ''; 177 + 178 + doCheck = true; 179 + checkPhase = '' 180 + runHook preCheck 181 + 182 + output=$($out/bin/cling <<EOF 183 + #include <iostream> 184 + std::cout << "hello world" << std::endl 185 + EOF 186 + ) 187 + 188 + echo "$output" | grep -q "Type C++ code and press enter to run it" 189 + echo "$output" | grep -q "hello world" 190 + 191 + runHook postCheck 192 + ''; 193 + 194 + dontInstall = true; 195 + }