summaryrefslogtreecommitdiffstats
path: root/lib/tests
AgeCommit message (Collapse)Author
2020-01-10lib/tests: Add test case for imports from derivationsSilvan Mosberger
2020-01-09Merge pull request #76857 from Infinisil/recursive-disableModulesSilvan Mosberger
Apply `disabledModules` recursively
2020-01-09lib/tests: Add tests for recursive disabledModulesSilvan Mosberger
2020-01-08lib/types: Allow paths as submodule valuesSilvan Mosberger
2020-01-06lib/tests: remove strictly loaOf tests and rebase on attrsOfrnhmjoj
2020-01-05Factor out a `toGNUCommandLine` utilityGabriel Gonzalez
... as suggested by @roberth
2020-01-03lib/tests: Temporarily disable submodule path testSilvan Mosberger
Until https://github.com/NixOS/nixpkgs/pull/76861 or so is merged
2020-01-02Module system improvements for NixOS as a submodule (#75031)Silvan Mosberger
Module system improvements for NixOS as a submodule
2020-01-02lib/tests: Add submoduleWith testsSilvan Mosberger
2019-12-15Use a more realistic example that exercises all encodingsGabriel Gonzalez
... as suggested by @roberth This also caught a bug in rendering lists, which this change also fixes
2019-12-13Make behavior of `encodeGNUCommandLine` customizableGabriel Gonzalez
... based on feedback from @edolstra
2019-12-13Rename `renderOptions` to `encodeGNUCommandLine`Gabriel Gonzalez
... as suggested by @edolstra
2019-12-11Add `pkgs.lib.renderOptions`Gabriel Gonzalez
This adds a new utility to intelligently convert Nix records to command line options to reduce boilerplate for simple use cases and to also reduce the likelihood of malformed command lines
2019-11-25Merge branch 'ghcjs-cross-without-cc-19.09' into ghcjs-cross-without-ccJohn Ericson
2019-11-25Fix lib testsJohn Ericson
js-ghcjs didn't fit in an existing categor.
2019-10-21lib/trivial: add `pipe` functionProfpatsch
`pipe` is a useful operator for creating pipelines of functions. It works around the usual problem of e.g. string operations becoming deeply nested functions. In principle, there are four different ways this function could be written: pipe val [ f1 .. fn ] pipe val [ fn .. f1 ] compose [ f1 .. fn ] val compose [ fn .. f1 ] val The third and fourth form mirror composition of functions, they would be the same as e.g. `(f1 << f2 << f3 .. << fn) val`. However, it is not clear which direction the list should have (as one can see in the second form, which is the most absurd. In order not to confuse users, we decide for the most “intuitive” form, which mirrors the way unix pipes work (thus the name `pipe`). The flow of data goes from left to right. Co-Authored-By: Silvan Mosberger <infinisil@icloud.com>
2019-10-01Merge pull request #70194 from obsidiansystems/lib-more-armMatthew Bauer
lib: Add armv7a-linux to doubles.nix
2019-10-01lib: Add armv7a-linux to doubles.nixJohn Ericson
This is needed for android.
2019-09-26lib: basic tests for lib.versionsJoachim Fasting
2019-08-06lib/types: Add oneOf, extension of either to a list of typesSilvan Mosberger
2019-07-11make-tarball / lib-tests: reduce duplicationFrederik Rietdijk
The misc.nix and systems.nix tests were invoked at three different places. Let's not that.
2019-07-10Revert "Revert "systems/doubles.nix: add Apple doubles""Matthew Bauer
This reverts commit ce2f74df2cade57e74c235292c8b074281903e71. Doubles are treated as -darwin here, to provide some consistency. There is some ambiguity between “x86_64-darwin” and “i686-darwin” which could refer to binaries linked between iOS simulator or real macOS binaries. useiOSPrebuilt can be used to determine which to use, however.
2019-06-04systems: fix lib-testsMatthew Bauer
These were broken by the added system doubles. This just adds those to the lib-tests.
2019-04-25tests/systems: fix testsMatthew Bauer
2019-02-07Fix the documentation for the tests to reflect what is actually happening.(cdep)illabout
2019-01-24lib/modules: Change mkAliasOptionModule to use the priority for the alias.(cdep)illabout
This commit changes the `mkAliasOptionModule` function to make sure that the priority for the aliased option is propagated to the non-aliased option. This also affects the `mkRenamedOptionModule` function in a similar fashion. This also removes the `mkAliasOptionModuleWithPriority` function, since its functionality is now subsumed by `mkAliasOptionModule`. This change was recommended by @nbp: https://github.com/NixOS/nixpkgs/pull/53397#discussion_r245487432
2019-01-06Add test that shows that the aliases are able to override options.(cdep)illabout
2019-01-04lib/modules: Add a function to create an option alias that respects the priority(cdep)illabout
This commit adds a function `mkAliasOptionModuleWithPriority`. This function will make an alias to an existing option and copy over the priority. This functionality is needed for PRs like #53041. In that case `nixos-generate-config` added an option to `hardware-configuration.nix` with `mkDefault`. That option was then changed and an alias created for the old name. The end user should be able to set the non-alias option in their `configuration.nix` and have everything work correctly. Without this function, the priority for the option won't be copied over correctly and the end-user will get a message saying they have the same option set to two different values.
2019-01-04Add a failing test for mkAliasOptionModule.(cdep)illabout
2018-12-30Remove composableDerivation, closes #18763Frederik Rietdijk
2018-10-20lib.isStorePath: fix `false` result when passed a path objectTim Cuthbertson
Since `isStorePath` relies on comparing against builtins.storeDir (a string), we need to convert the input into a string as well.
2018-10-18tests/systems.nix: fix testsMatthew Bauer
these weren’t being run correctly
2018-10-15generators: make toPretty handle floats correctlyLéo Gaspard
2018-09-18Merge pull request #46336 from Infinisil/overrideExistingJörg Thalheim
lib: Improve overrideExisting implementation
2018-09-17lib/tests: Add overrideExisting testsSilvan Mosberger
2018-09-16Merge pull request #36287 from shlevy/lib-tests-defaultGraham Christensen
lib/tests: Add check-eval.nix to run simple tests.
2018-09-06Merge branch 'no-toPath'Shea Levy
2018-08-28hurd: cleanup unmaintained targetJörg Thalheim
This has been not touched in 6 years. Let's remove it to cause less problems when adding new cross-compiling infrastructure. This also simplify gcc significantly.
2018-08-15lib/recursiveUpdateUntil: add a test & release note for fixProfpatsch
2018-07-20[bot]: remove unreferenced codevolth
2018-06-10lib: bitAnd, bitOr, bitXor (bitsize-agnostic fallback function) (#41491)volth
* lib: bitAnd, bitOr, bitXor * lib: test for bitAnd, bitOr, bitXor * lib: bitsize-agnostic zipIntBits * lib: bitNot * lib: bitNot
2018-06-05Revert "lib: bitAnd, bitOr, bitXor"Profpatsch
2018-06-02lib: test for bitAnd, bitOr, bitXorvolth
2018-05-22treewide: Remove uses of builtins.toPath.Shea Levy
toPath has confusing semantics and is never necessary; it can always either just be omitted or replaced by pre-concatenating `/.`. It has been marked as "!!! obsolete?" for more than 10 years in a C++ comment, hopefully removing it will let us properly deprecate and, eventually, remove it.
2018-05-07lib.types: fix loaOf behavior for long listsRobert Helgesson
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-06lib/types: clear up coercedTo descriptionSilvan Mosberger
2018-05-06lib/types: Add coercedTo unsound testsSilvan Mosberger
2018-04-25lib/generators: print paths without quotes & move function downProfpatsch
2018-03-29lib/generators: introduce a sane default for `mkValueString`Profpatsch
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-20Remove obsolete /nix/var/nix/{manifests,channel-cache}Eelco Dolstra