1{
2 lib,
3 buildPackages,
4 stdenv,
5 mkMesonExecutable,
6
7 nix-expr,
8 nix-expr-c,
9 nix-expr-test-support,
10
11 rapidcheck,
12 gtest,
13 runCommand,
14
15 # Configuration Options
16
17 version,
18 resolvePath,
19}:
20
21mkMesonExecutable (finalAttrs: {
22 pname = "nix-expr-tests";
23 inherit version;
24
25 workDir = ./.;
26
27 buildInputs = [
28 nix-expr
29 nix-expr-c
30 nix-expr-test-support
31 rapidcheck
32 gtest
33 ];
34
35 mesonFlags = [
36 ];
37
38 passthru = {
39 tests = {
40 run =
41 runCommand "${finalAttrs.pname}-run"
42 {
43 meta.broken = !stdenv.hostPlatform.emulatorAvailable buildPackages;
44 }
45 (
46 lib.optionalString stdenv.hostPlatform.isWindows ''
47 export HOME="$PWD/home-dir"
48 mkdir -p "$HOME"
49 ''
50 + ''
51 export _NIX_TEST_UNIT_DATA=${resolvePath ./data}
52 ${stdenv.hostPlatform.emulator buildPackages} ${lib.getExe finalAttrs.finalPackage}
53 touch $out
54 ''
55 );
56 };
57 };
58
59 meta = {
60 platforms = lib.platforms.unix ++ lib.platforms.windows;
61 mainProgram = finalAttrs.pname + stdenv.hostPlatform.extensions.executable;
62 };
63
64})