John Ericson
ecd3e4ebd7
More property tests
...
Also put proper comparison methods on `DerivedPath` and
`NixStringContextElem`, which is needed for the tests but good in
general.
2023-01-29 17:09:59 -05:00
John Ericson
ec0c0efec6
Allow unit test infra to be reused across libs' tests
...
This allows using Arbitrary "instances" defined in libstore-tests in
libexpr-tests, something we will leverage in a moment.
2023-01-29 13:52:57 -05:00
John Ericson
018e2571aa
Test store paths, with property tests
...
The property test in fact found a bug: we were excluding numbers!
2023-01-23 07:05:50 -05:00
John Ericson
7fe308c2f8
Add rapidcheck
dependency for testing
...
Property tests are great!
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2023-01-23 07:05:50 -05:00
Eelco Dolstra
75c89c3e5e
Add test for OutputsSpec::Names
...
From @Ericson2314.
2023-01-18 16:34:37 +01:00
John Ericson
d8512653d4
Write more (extended) output spec tests
2023-01-12 22:05:55 -05:00
John Ericson
d29eb08563
Assert on construction that OutputsSpec::Names
is non-empty
2023-01-12 20:52:29 -05:00
John Ericson
e947aa5401
Unit test OuputsSpec::{union_, isSubsetOf}
2023-01-12 20:33:50 -05:00
John Ericson
0faf5326bd
Improve tests for OutputsSpec
2023-01-11 19:09:21 -05:00
John Ericson
ce2f91d356
Split OutputsSpec
and ExtendedOutputsSpec
, use the former more
...
`DerivedPath::Built` and `DerivationGoal` were previously using a
regular set with the convention that the empty set means all outputs.
But it is easy to forget about this rule when processing those sets.
Using `OutputSpec` forces us to get it right.
2023-01-11 18:57:18 -05:00
John Ericson
a7c0cff07f
Rename OutputPath
-> ExtendedOutputPath
...
Do this prior to making a new more limitted `OutputPath` we will use in
more places.
2023-01-11 18:55:29 -05:00
John Ericson
a8f45b5e5a
Improve OutputsSpec
slightly
...
A few little changes preparing for the rest.
2023-01-11 18:54:50 -05:00
John Ericson
da64f026dd
Make clear that StorePathWithOutputs
is a deprecated type
...
- Add a comment
- Put `OutputsSpec` in a different header (First part of #6815 )
- Make a few stray uses of it in new code use `DerivedPath` instead.
2023-01-10 11:27:19 -05:00
Eelco Dolstra
4a79cba511
Allow selecting derivation outputs using 'installable!outputs'
...
E.g. 'nixpkgs#glibc^dev,static' or 'nixpkgs#glibc^*'.
2022-05-03 13:43:52 +02:00
Alexey Novikov
e989c83b44
Add error reporting to machine spec paser
...
Currently machine specification (`/etc/nix/machine`) parser fails
with a vague exception if the file had incorrect format.
This commit adds verbose exceptions and unit-tests for the parser.
2021-10-17 12:45:56 +04:00
Sergei Trofimovich
d7d6fe44d6
libstore-tests: add libutil dependency (fix static link failure)
...
In https://github.com/NixOS/nix/pull/5350 we noticed link failures
pkgsStatic.nixUnstable. Adding explicit dependency on libutil fixes
libstore-tests linking.
2021-10-08 07:16:12 +01:00
Eelco Dolstra
77ebbc9f54
Add a test for RefScanSink and clean up the code
...
Issue #5322 .
2021-10-04 14:29:42 +02:00