Commit Graph

36 Commits

Author SHA1 Message Date
volth
3c2bbe217c lib: bitAnd, bitOr, bitXor (bitsize-agnostic fallback function) (#41491)
* lib: bitAnd, bitOr, bitXor

* lib: test for bitAnd, bitOr, bitXor

* lib: bitsize-agnostic zipIntBits

* lib: bitNot

* lib: bitNot
2018-06-10 21:25:48 +02:00
Profpatsch
f98272d6e2 Revert "lib: bitAnd, bitOr, bitXor" 2018-06-05 18:45:20 +02:00
volth
078b9b4c2b
lib: test for bitAnd, bitOr, bitXor 2018-06-02 21:13:43 +00:00
Robert Helgesson
08e8701673
lib.types: fix loaOf behavior for long lists
Assigning a list of 10 or more elements to an option having the type
`loaOf a` produces a configuration value that is not honoring the
order of the original list. This commit fixes this and a related issue
arising when 10 or more lists are merged into this type of option.
2018-05-07 20:23:52 +02:00
Silvan Mosberger
cd5736116c lib/types: clear up coercedTo description 2018-05-06 23:58:36 +02:00
Silvan Mosberger
b16a69289a lib/types: Add coercedTo unsound tests 2018-05-06 23:58:36 +02:00
Profpatsch
c84dad316a lib/generators: print paths without quotes & move function down 2018-04-25 15:31:17 +02:00
Profpatsch
fa71407f36 lib/generators: introduce a sane default for mkValueString
So far, `mkValueString` defaulted to `toString`,
which is a bad match for most configuration file formats,
especially because how booleans are formatted.
This also improves error messages for unsupported types.

Add a test to codify the formatting.
2018-03-29 16:53:06 +02:00
Eelco Dolstra
7db841512a
Remove obsolete /nix/var/nix/{manifests,channel-cache} 2018-03-20 18:26:13 +01:00
Shea Levy
b66d7dc0ce
lib.isStorePath: Fix derivation detection 2018-03-09 17:21:31 -05:00
Shea Levy
6fcf691545
lib-tests: Don't depend on /bin/sh
https://hydra.nixos.org/build/70748333
2018-03-08 08:36:35 -05:00
Daniel Barlow
9c50ae6898 lib, treewide: Add missing MIPS arches, and fix existing usage
Existing "mips64el" should be "mipsel".

This is just the barest minimum so that nixpkgs can recognize them as
systems - although required for building individual derivations onto
MIPS boards, it is not sufficient if you want to actually build nixos on
those targets
2018-02-23 20:43:42 -05:00
Profpatsch
8e00dcd242 lib/generators: add mkValueString to mkKeyValueDefault generator
This means the generation of values can now be influenced, even down from e.g.
an INI generator.
Breaks the interface of `mkKeyValueDefault` to match its interface to other
generator functions. It might me sensible to rename `mkKeyValue` and
`mkKeyValueSet` to conform to the `toX`-style of generator functions.
2017-11-22 21:53:59 +01:00
Profpatsch
462c048c77 lib/types: add ints.positive.
For values that are positive, but cannot be 0.
2017-11-05 15:56:32 +01:00
Profpatsch
c85f085062 lib/types: update docs to match the new type names 2017-11-05 15:56:32 +01:00
Profpatsch
f8e6cd3465 lib/types: add tests for ints.between and ints.unsigned
The int types are trivial invocations of `ints.between`, so they are not tested
explicitely.
2017-11-05 15:56:32 +01:00
Profpatsch
5cbc6ca9bb lib/generators: put more information in toPretty lambdas
With `builtins.functionArgs` we can get some information if the first argument
is an attrset and whether the contained fields have default values. Encode that
into the pretty-printed lambda.
2017-06-22 00:58:59 +02:00
Profpatsch
b1ffe5e4c0 lib/generators: toPretty
`toPretty` implements a pretty printer for nix values.
2017-06-22 00:58:59 +02:00
Daiderd Jordan
cfe2b12fe4
lib-tests: fix test for isStorePath 2017-06-09 23:38:08 +02:00
Profpatsch
3fa1be6f49 Add isStorePath tests (#26223) 2017-05-30 20:48:32 +01:00
John Ericson
da8b2f1412 lib tests: Simplify relative path for default argument 2017-05-21 13:38:36 -04:00
John Ericson
296753f094 lib: Consolidate tests into one meta job 2017-05-17 11:14:59 -04:00
John Ericson
d86caa3216 lib: Fix preexisting bugs in old platforms code (now bugs in tests)
Warning, this changes the compatibility claims of existing packages!
2017-04-17 17:13:01 -04:00
John Ericson
8c99aab3ea lib: Fix system parsing, and use for doubles lists
The old hard-coded lists are now used to test system parsing.

In the process, make an `assertTrue` in release lib for eval tests; also
use it in release-cross
2017-04-17 17:13:01 -04:00
Daiderd Jordan
d88721e440
modules: add support for module replacement with disabledModules
This is based on a prototype Nicolas B. Pierron worked on during a
discussion we had at FOSDEM.

A new version with a workaround for problems of the reverted original.
Discussion: https://github.com/NixOS/nixpkgs/commit/3f2566689
2017-03-03 13:45:22 +01:00
Vladimír Čunát
fcec3e1c72
Revert "modules: add support for module replacement with disabledModules"
This reverts commit 3f2566689d14f1d7778d55ca807d1dad2f4695d1 for now.
Evaluation of the tested job got broken, blocking nixos-unstable.
2017-03-01 21:56:01 +01:00
Daiderd Jordan
37705ac1b1 use relative path for module tests 2017-02-28 00:14:48 +01:00
Daiderd Jordan
3f2566689d modules: add support for module replacement with disabledModules
This is based on a prototype Nicolas B. Pierron worked on during a
discussion we had at FOSDEM.
2017-02-28 00:14:48 +01:00
Nikolay Amiantov
5b759293e0 modules lib: type description in type error message 2017-02-03 11:28:33 +01:00
Nikolay Amiantov
fcb20b9fee module tests: add tests for coercedTo 2017-02-02 01:53:00 +03:00
John Ericson
f073df60d6 Replace ./../* with ../* in Nix expressions (#16414) 2016-06-22 10:39:50 +02:00
zimbatm
07b1f78b94 lib: alphabetize things 2016-02-26 22:15:41 +00:00
Nicolas B. Pierron
a6b455bbae NixOS modules: Add error context on module arguments evaluation. 2015-07-14 15:07:54 +02:00
Nicolas B. Pierron
7f1a782d91 Add tests for the new module system improvements. 2015-03-16 22:38:41 +01:00
Nicolas B. Pierron
de0f122b01 Issue #6161 - Register lib tests as release blockers. 2015-02-09 00:07:44 +01:00
Nicolas B. Pierron
6d15e32536 Issue #6161 - Add tests for NixOS modules. 2015-02-09 00:07:44 +01:00