forked from runtimeverification/k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.nix
68 lines (59 loc) · 1.38 KB
/
test.nix
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
let
sources = import ./nix/sources.nix;
pinned = import sources."nixpkgs" { config = {}; overlays = []; };
in
{ pkgs ? pinned
, test ? null
}:
let
inherit (pkgs) stdenv lib;
inherit (pkgs) bison diffutils ncurses gmp mpfr libffi jemalloc;
default = import ./. { inherit pkgs; };
inherit (default) k haskell-backend llvm-backend;
inherit (default) clang;
ttuegel = import sources."ttuegel" { inherit pkgs ; };
inherit (ttuegel) cleanGitSubtree;
in
stdenv.mkDerivation {
name = "k-test";
src = cleanGitSubtree {
name = "k-distribution";
src = ./.;
subDir = "k-distribution";
};
preferLocalBuild = true;
buildInputs = [
diffutils ncurses bison clang gmp mpfr libffi jemalloc
k haskell-backend llvm-backend
];
postPatch = ''
patchShebangs tests/regression-new
'';
buildFlags =
[
# Find executables on PATH
"KOMPILE=kompile"
"KRUN=krun"
"KDEP=kdep"
"KPROVE=kprove"
"KBMC=kbmc"
"KAST=kast"
"KPRINT=kprint"
"KRUN_LEGACY=krun-legacy"
"KEQ=keq"
"KSERVER=kserver"
"PACKAGE_VERSION=${lib.fileContents ./package/version}"
"--output-sync"
]
++ lib.optional (test != null) "-C ${test}"
;
enableParallelBuilding = true;
preBuild = ''
cd tests/regression-new
'';
installPhase = ''
runHook preInstall
touch "$out"
runHook postInstall
'';
}