lix/tests
Eelco Dolstra 0dbd4638e0 * Two primops: builtins.intersectAttrs and builtins.functionArgs.
intersectAttrs returns the (right-biased) intersection between two
  attribute sets, e.g. every attribute from the second set that also
  exists in the first.  functionArgs returns the set of attributes
  expected by a function.

  The main goal of these is to allow the elimination of most of
  all-packages.nix.  Most package instantiations in all-packages.nix
  have this form:

    foo = import ./foo.nix {
      inherit a b c;
    };

  With intersectAttrs and functionArgs, this can be written as:

    foo = callPackage (import ./foo.nix) { };

  where

   callPackage = f: args:
     f ((builtins.intersectAttrs (builtins.functionArgs f) pkgs) // args);

  I.e., foo.nix is called with all attributes from "pkgs" that it
  actually needs (e.g., pkgs.a, pkgs.b and pkgs.c).  (callPackage can
  do any other generic package-level stuff we might want, such as
  applying makeOverridable.)  Of course, the automatically supplied
  arguments can be overriden if needed, e.g.

    foo = callPackage (import ./foo.nix) {
      c = c_version_2;
    };

  but for the vast majority of packages, this won't be needed.

  The advantages are to reduce the amount of typing needed to add a
  dependency (from three sites to two), and to reduce the number of
  trivial commits to all-packages.nix.  For the former, there have
  been two previous attempts:

    - Use "args: with args;" in the package's function definition.
      This however obscures the actual expected arguments of a
      function, which is very bad.

    - Use "{ arg1, arg2, ... }:" in the package's function definition
      (i.e. use the ellipis "..." to allow arbitrary additional
      arguments), and then call the function with all of "pkgs" as an
      argument.  But this inhibits error detection if you call it with
      an misspelled (or obsolete) argument.
2009-09-15 13:01:46 +00:00
..
lang * Two primops: builtins.intersectAttrs and builtins.functionArgs. 2009-09-15 13:01:46 +00:00
add.sh * Unify the treatment of sources copied to the store, and recursive 2008-12-03 15:06:30 +00:00
build-hook.hook.sh * Simplify communication with the hook a bit (don't use file 2009-03-28 19:29:55 +00:00
build-hook.nix * Refactoring: renamed *.nix.in to *.nix. 2009-03-17 17:11:55 +00:00
build-hook.sh * Clean up some tests (use nix-build where appropriate). 2009-03-18 13:15:55 +00:00
check-refs.nix * Refactoring: renamed *.nix.in to *.nix. 2009-03-17 17:11:55 +00:00
check-refs.sh
common.sh.in * Use bash in the tests. 2009-03-25 16:11:04 +00:00
config.nix.in * Refactoring: renamed *.nix.in to *.nix. 2009-03-17 17:11:55 +00:00
dependencies.builder0.sh * Regression test for the `exportReferencesGraph' 2009-03-17 16:33:48 +00:00
dependencies.builder1.sh
dependencies.builder2.sh
dependencies.nix * Regression test for the `exportReferencesGraph' 2009-03-17 16:33:48 +00:00
dependencies.sh * Acquire the locks on the output paths before trying to run the build 2009-03-18 14:48:42 +00:00
export-graph.nix * Unify exportReferencesGraph and exportBuildReferencesGraph, and make 2009-03-18 17:36:42 +00:00
export-graph.sh * Improve the test. 2009-03-18 16:36:13 +00:00
export.sh * Clean up some tests (use nix-build where appropriate). 2009-03-18 13:15:55 +00:00
fallback.sh
filter-source.nix * Refactoring: renamed *.nix.in to *.nix. 2009-03-17 17:11:55 +00:00
filter-source.sh
fixed.builder1.sh
fixed.builder2.sh
fixed.nix * Refactoring: renamed *.nix.in to *.nix. 2009-03-17 17:11:55 +00:00
fixed.sh * Clean up some tests (use nix-build where appropriate). 2009-03-18 13:15:55 +00:00
gc-concurrent.builder.sh * Increase the sleep periods a bit to make the test less likely to 2008-08-14 09:26:30 +00:00
gc-concurrent.nix * Refactoring: renamed *.nix.in to *.nix. 2009-03-17 17:11:55 +00:00
gc-concurrent.sh * Argh, stupid timing sensitive tests... 2009-03-27 22:40:22 +00:00
gc-concurrent2.builder.sh * Increase the sleep periods a bit to make the test less likely to 2008-08-14 09:26:30 +00:00
gc-runtime.nix * Refactoring: renamed *.nix.in to *.nix. 2009-03-17 17:11:55 +00:00
gc-runtime.sh
gc.sh
hash-check.nix
hash.sh
init.sh 2008-12-03 16:15:38 +00:00
install-package.sh
lang.sh
logging.sh * Clean up some tests (use nix-build where appropriate). 2009-03-18 13:15:55 +00:00
Makefile.am * Negative caching, i.e. caching of build failures. Disabled by 2009-03-25 21:05:42 +00:00
misc.sh
negative-caching.nix * Negative caching, i.e. caching of build failures. Disabled by 2009-03-25 21:05:42 +00:00
negative-caching.sh * Negative caching, i.e. caching of build failures. Disabled by 2009-03-25 21:05:42 +00:00
nix-build.sh * Clean up some tests (use nix-build where appropriate). 2009-03-18 13:15:55 +00:00
nix-pull.sh
nix-push.sh
parallel.builder.sh * Make this test a bit more robust. It's still timing dependent 2009-03-23 15:16:36 +00:00
parallel.nix * Make this test a bit more robust. It's still timing dependent 2009-03-23 15:16:36 +00:00
parallel.sh * Make the poll interval configurable. 2009-03-30 11:34:03 +00:00
referrers.sh
remote-store.sh * Be sure to clean up the daemon if the test fails. 2008-12-04 16:55:22 +00:00
simple.builder.sh
simple.nix * Refactoring: renamed *.nix.in to *.nix. 2009-03-17 17:11:55 +00:00
simple.sh 2008-12-03 16:15:38 +00:00
substituter.sh * Fix the tests. 2008-08-04 16:16:49 +00:00
substituter2.sh * Fix the tests. 2008-08-04 16:16:49 +00:00
substitutes.sh
substitutes2.sh * Do a substitution even if --max-jobs == 0. 2009-03-31 21:14:07 +00:00
user-envs.builder.sh
user-envs.nix * Refactoring: renamed *.nix.in to *.nix. 2009-03-17 17:11:55 +00:00
user-envs.sh
verify.sh