File tree Expand file tree Collapse file tree 3 files changed +80
-0
lines changed Expand file tree Collapse file tree 3 files changed +80
-0
lines changed Original file line number Diff line number Diff line change 49
49
- name : Run unit tests
50
50
run : nix-build -A project.kore.checks
51
51
52
+ - name : Run integration tests
53
+ run : nix-build test.nix
54
+
52
55
- name : Check shell
53
56
run : nix-shell --run "echo OK"
54
57
Original file line number Diff line number Diff line change @@ -117,6 +117,13 @@ When the `.cabal` package description file changes, run:
117
117
118
118
This script is also run by an automatic workflow.
119
119
120
+ We provide a ` test.nix ` for running integration tests:
121
+
122
+ ``` sh
123
+ nix-build test.nix # run all integration tests
124
+ nix-build test.nix --argstr test imp # run the integration tests in test/imp
125
+ nix-shell test.nix # enter a shell where we can run tests manually
126
+ ```
120
127
121
128
[ git ] : https://git-scm.com/
122
129
[ stack ] : https://www.haskellstack.org/
Original file line number Diff line number Diff line change
1
+ let
2
+ sources = import ./nix/sources.nix ;
3
+ pinned = import sources . "nixpkgs" { config = { } ; overlays = [ ] ; } ;
4
+ in
5
+
6
+ { pkgs ? pinned
7
+ , test ? null
8
+ } :
9
+
10
+ let
11
+ inherit ( pkgs ) stdenv lib ;
12
+ inherit ( pkgs ) bison diffutils ncurses z3 ;
13
+
14
+ ttuegel =
15
+ let
16
+ src = builtins . fetchGit {
17
+ url = "https://github.com/ttuegel/nix-lib" ;
18
+ rev = "66bb0ab890ff4d828a2dcfc7d5968465d0c7084f" ;
19
+ ref = "main" ;
20
+ } ;
21
+ in import src { inherit pkgs ; } ;
22
+
23
+ kframework =
24
+ let
25
+ tag = lib . fileContents ./deps/k_release ;
26
+ url = "https://github.com/kframework/k/releases/download/${ tag } /release.nix" ;
27
+ args = import ( builtins . fetchurl { inherit url ; } ) ;
28
+ src = pkgs . fetchgit args ;
29
+ in import src { } ;
30
+ inherit ( kframework ) k ;
31
+
32
+ default = import ./. { } ;
33
+ inherit ( default ) kore ;
34
+ in
35
+
36
+ stdenv . mkDerivation {
37
+ name = "kore-test" ;
38
+ src = ttuegel . cleanGitSubtree { name = "kore" ; src = ./. ; } ;
39
+ preferLocalBuild = true ;
40
+ buildInputs = [
41
+ k kore
42
+ ncurses # TODO: .../lib/kframework/setenv: line 31: tput: command not found
43
+ z3
44
+ ] ;
45
+ configurePhase = ''
46
+ export TOP=$(pwd)
47
+ '' ;
48
+ buildFlags =
49
+ [
50
+ "KORE_PARSER=kore-parser"
51
+ "KORE_EXEC=kore-exec"
52
+ "KORE_REPL=kore-repl"
53
+ "--output-sync"
54
+ "test"
55
+ ]
56
+ ++ lib . optional ( test != null ) "-C ${ test } "
57
+ ;
58
+ enableParallelBuilding = true ;
59
+ preBuild = ''
60
+ cd test
61
+ '' ;
62
+ installPhase = ''
63
+ runHook preInstall
64
+
65
+ touch "$out"
66
+
67
+ runHook postInstall
68
+ '' ;
69
+ }
70
+
You can’t perform that action at this time.
0 commit comments