1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 18:57:08 +00:00

simplify running tests with nix-build

This commit is contained in:
Daiderd Jordan 2017-11-05 22:55:16 +01:00
parent bb98816c86
commit bd620d1855
No known key found for this signature in database
GPG key ID: D02435D05B810C96
2 changed files with 33 additions and 41 deletions

View file

@ -5,15 +5,9 @@ matrix:
osx_image: xcode8.2
script:
- nix-build ./release.nix -I darwin=. -A examples.simple
- nix-build ./release.nix -I darwin=. -A tests.system-packages
- nix-build ./release.nix -I darwin=. -A tests.system-path-bash
- nix-build ./release.nix -I darwin=. -A tests.system-path-fish
- nix-build ./release.nix -I darwin=. -A tests.system-path-zsh
- nix-build ./release.nix -I darwin=. -A tests
- os: osx
osx_image: xcode7.3
script:
- nix-build ./release.nix -I darwin=. -A examples.simple
- nix-build ./release.nix -I darwin=. -A tests.system-packages
- nix-build ./release.nix -I darwin=. -A tests.system-path-bash
- nix-build ./release.nix -I darwin=. -A tests.system-path-fish
- nix-build ./release.nix -I darwin=. -A tests.system-path-zsh
- nix-build ./release.nix -I darwin=. -A tests

View file

@ -14,44 +14,42 @@ let
);
makeTest = test:
pkgs.lib.genAttrs [ "x86_64-darwin" ] (system:
let
configuration =
{ config, lib, pkgs, ... }:
with lib;
{ imports = [ test ];
let
configuration =
{ config, lib, pkgs, ... }:
with lib;
{ imports = [ test ];
options = {
out = mkOption {
type = types.package;
};
test = mkOption {
type = types.lines;
};
options = {
out = mkOption {
type = types.package;
};
config = {
system.build.run-test = pkgs.runCommand "run-darwin-test"
{ allowSubstitutes = false;
preferLocalBuild = true;
}
''
#! ${pkgs.stdenv.shell}
set -e
${config.test}
echo ok >&2
touch $out
'';
out = config.system.build.toplevel;
test = mkOption {
type = types.lines;
};
};
system = "x86_64-darwin";
in
(import ./. { inherit nixpkgs configuration system; }).config.system.build.run-test
);
config = {
system.build.run-test = pkgs.runCommand "run-darwin-test"
{ allowSubstitutes = false;
preferLocalBuild = true;
}
''
#! ${pkgs.stdenv.shell}
set -e
${config.test}
echo ok >&2
touch $out
'';
out = config.system.build.toplevel;
};
};
system = "x86_64-darwin";
in
(import ./. { inherit nixpkgs configuration system; }).config.system.build.run-test;
release = import <nixpkgs/pkgs/top-level/release-lib.nix> {
inherit supportedSystems scrubJobs;