summary refs log tree commit diff
path: root/lib/tests
AgeCommit message (Collapse)AuthorFilesLines
2020-03-18lib: Fix systems test for new `armv6l-none`John Ericson1-1/+1
2020-02-10lib/tests/misc.nix: Don't make a copy on NixpkgsEelco Dolstra1-1/+1
2020-02-10lib/tests/misc.nix: Fix dependency on currentSystemEelco Dolstra1-1/+1
This doesn't work in pure mode.
2020-01-23lib/cli,lib/tests/misc: somewhat more standard formattingProfpatsch1-35/+26
2020-01-23lib/cli: encodeGNUCommandLine -> toGNUCommandLineShellProfpatsch1-2/+27
The semantic difference between `encode` and `to` is not apparent. Users are likely to confuse both functions (which leads to unexpected error messages about the wrong types). Like in `generators.nix`, all functions should be prefixed by `to`. Furthermore, converting to a string depends on the target context. In this case, it’s a POSIX shell, so we should name it that (compare `escapeShellArg` in `strings.nix`). We can later add versions that escape for embedding in e.g. python scripts or similar.
2020-01-14Merge pull request #75539 from Gabriel439/gabriel/renderOptionsRobert Hensing1-0/+21
Add `pkgs.lib.encodeGNUCommandLine`
2020-01-12Merge pull request #76861 from Infinisil/paths-as-submodulesRobert Hensing1-2/+1
lib/types: Allow paths as submodule values
2020-01-10lib/tests: Add tests for attrsOf and lazyAttrsOfSilvan Mosberger5-0/+35
2020-01-10lib/tests: Fix module testsSilvan Mosberger1-9/+3
Fix the broken test in https://github.com/NixOS/nixpkgs/pull/77416 Apparently hydra uses `nix-build lib/tests/release.nix` to run all tests, where IFD isn't allowed. Fortunately we can get around this with builtins.toFile, which doesn't require IFD, but still can test the properties we want.
2020-01-10lib/tests: Add test case for imports from derivationsSilvan Mosberger2-1/+21
2020-01-09Merge pull request #76857 from Infinisil/recursive-disableModulesSilvan Mosberger6-0/+38
Apply `disabledModules` recursively
2020-01-09lib/tests: Add tests for recursive disabledModulesSilvan Mosberger6-0/+38
2020-01-08lib/types: Allow paths as submodule valuesSilvan Mosberger1-2/+1
2020-01-06lib/tests: remove strictly loaOf tests and rebase on attrsOfrnhmjoj23-103/+59
2020-01-05Factor out a `toGNUCommandLine` utilityGabriel Gonzalez1-1/+1
... as suggested by @roberth
2020-01-03lib/tests: Temporarily disable submodule path testSilvan Mosberger1-1/+2
Until https://github.com/NixOS/nixpkgs/pull/76861 or so is merged
2020-01-02Module system improvements for NixOS as a submodule (#75031)Silvan Mosberger8-0/+110
Module system improvements for NixOS as a submodule
2020-01-02lib/tests: Add submoduleWith testsSilvan Mosberger8-0/+110
2019-12-15Use a more realistic example that exercises all encodingsGabriel Gonzalez1-6/+10
... as suggested by @roberth This also caught a bug in rendering lists, which this change also fixes
2019-12-13Make behavior of `encodeGNUCommandLine` customizableGabriel Gonzalez1-0/+1
... based on feedback from @edolstra
2019-12-13Rename `renderOptions` to `encodeGNUCommandLine`Gabriel Gonzalez1-1/+1
... as suggested by @edolstra
2019-12-11Add `pkgs.lib.renderOptions`Gabriel Gonzalez1-0/+16
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 Ericson1-1/+1
2019-11-25Fix lib testsJohn Ericson1-1/+1
js-ghcjs didn't fit in an existing categor.
2019-10-21lib/trivial: add `pipe` functionProfpatsch1-0/+25
`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 Bauer1-2/+2
lib: Add armv7a-linux to doubles.nix
2019-10-01lib: Add armv7a-linux to doubles.nixJohn Ericson1-2/+2
This is needed for android.
2019-09-26lib: basic tests for lib.versionsJoachim Fasting1-0/+15
2019-08-06lib/types: Add oneOf, extension of either to a list of typesSilvan Mosberger3-0/+23
2019-07-11make-tarball / lib-tests: reduce duplicationFrederik Rietdijk1-11/+4
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 Bauer1-3/+3
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 Bauer1-5/+5
These were broken by the added system doubles. This just adds those to the lib-tests.
2019-04-25tests/systems: fix testsMatthew Bauer1-1/+1
2019-02-07Fix the documentation for the tests to reflect what is actually happening.(cdep)illabout2-2/+8
2019-01-24lib/modules: Change mkAliasOptionModule to use the priority for the alias.(cdep)illabout3-3/+3
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)illabout2-0/+55
2019-01-04lib/modules: Add a function to create an option alias that respects the priority(cdep)illabout1-1/+1
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)illabout2-0/+55
2018-12-30Remove composableDerivation, closes #18763Frederik Rietdijk1-38/+0
2018-10-20lib.isStorePath: fix `false` result when passed a path objectTim Cuthbertson1-1/+1
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 Bauer1-14/+15
these weren’t being run correctly
2018-10-15generators: make toPretty handle floats correctlyLéo Gaspard1-0/+2
2018-09-18Merge pull request #46336 from Infinisil/overrideExistingJörg Thalheim1-0/+14
lib: Improve overrideExisting implementation
2018-09-17lib/tests: Add overrideExisting testsSilvan Mosberger1-0/+14
2018-09-16Merge pull request #36287 from shlevy/lib-tests-defaultGraham Christensen1-0/+7
lib/tests: Add check-eval.nix to run simple tests.
2018-09-06Merge branch 'no-toPath'Shea Levy1-2/+2
2018-08-28hurd: cleanup unmaintained targetJörg Thalheim1-1/+1
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 fixProfpatsch1-0/+24
2018-07-20[bot]: remove unreferenced codevolth1-4/+0
2018-06-10lib: bitAnd, bitOr, bitXor (bitsize-agnostic fallback function) (#41491)volth1-0/+15
* lib: bitAnd, bitOr, bitXor * lib: test for bitAnd, bitOr, bitXor * lib: bitsize-agnostic zipIntBits * lib: bitNot * lib: bitNot