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:
parent
bb98816c86
commit
bd620d1855
2 changed files with 33 additions and 41 deletions
10
.travis.yml
10
.travis.yml
|
@ -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
|
||||
|
|
64
release.nix
64
release.nix
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue