summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-11-05 22:55:16 +0100
committerDaiderd Jordan <daiderd@gmail.com>2017-11-05 22:55:16 +0100
commitbd620d1855fefcba920457fdd68083c2fc995da0 (patch)
tree462cc0a45d99d524cafacec1b91b24a38c8836ee
parentbb98816c86517bed054fbf318bc0dc27aa8a3bdd (diff)
simplify running tests with nix-build
-rw-r--r--.travis.yml10
-rw-r--r--release.nix66
2 files changed, 34 insertions, 42 deletions
diff --git a/.travis.yml b/.travis.yml
index 77cb791..9562a14 100644
--- a/.travis.yml
+++ b/.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
diff --git a/release.nix b/release.nix
index 8c15d8b..c28890b 100644
--- a/release.nix
+++ b/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 ];
-
- options = {
- out = mkOption {
- type = types.package;
- };
-
- test = mkOption {
- type = types.lines;
- };
+ let
+ configuration =
+ { config, lib, pkgs, ... }:
+ with lib;
+ { imports = [ test ];
+
+ 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;