mirror of
https://github.com/NixOS/nix.git
synced 2025-12-11 19:41:04 +01:00
Merge pull request #14724 from obsidiansystems/derivation-options-test-file-names
Organize some test JSON better to prevent confusion
This commit is contained in:
commit
386d1d54bd
9 changed files with 23 additions and 25 deletions
|
|
@ -7,25 +7,25 @@
|
||||||
#### Default options
|
#### Default options
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{{#include ../schema/derivation-options-v1/ia/defaults.json}}
|
{{#include ../schema/derivation-options-v1/ia/derivation-options/defaults.json}}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### All options set
|
#### All options set
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{{#include ../schema/derivation-options-v1/ia/all_set.json}}
|
{{#include ../schema/derivation-options-v1/ia/derivation-options/all_set.json}}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Default options (structured attributes)
|
#### Default options (structured attributes)
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{{#include ../schema/derivation-options-v1/ia/structuredAttrs_defaults.json}}
|
{{#include ../schema/derivation-options-v1/ia/derivation-options/structuredAttrs_defaults.json}}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### All options set (structured attributes)
|
#### All options set (structured attributes)
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{{#include ../schema/derivation-options-v1/ia/structuredAttrs_all_set.json}}
|
{{#include ../schema/derivation-options-v1/ia/derivation-options/structuredAttrs_all_set.json}}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Content-addressed derivations
|
### Content-addressed derivations
|
||||||
|
|
@ -33,13 +33,13 @@
|
||||||
#### All options set
|
#### All options set
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{{#include ../schema/derivation-options-v1/ca/all_set.json}}
|
{{#include ../schema/derivation-options-v1/ca/derivation-options/all_set.json}}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### All options set (structured attributes)
|
#### All options set (structured attributes)
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{{#include ../schema/derivation-options-v1/ca/structuredAttrs_all_set.json}}
|
{{#include ../schema/derivation-options-v1/ca/derivation-options/structuredAttrs_all_set.json}}
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- need to convert YAML to JSON first
|
<!-- need to convert YAML to JSON first
|
||||||
|
|
|
||||||
|
|
@ -73,12 +73,12 @@ schemas = [
|
||||||
'stem' : 'derivation-options',
|
'stem' : 'derivation-options',
|
||||||
'schema' : schema_dir / 'derivation-options-v1.yaml',
|
'schema' : schema_dir / 'derivation-options-v1.yaml',
|
||||||
'files' : [
|
'files' : [
|
||||||
'ia' / 'defaults.json',
|
'ia' / 'derivation-options' / 'defaults.json',
|
||||||
'ia' / 'all_set.json',
|
'ia' / 'derivation-options' / 'all_set.json',
|
||||||
'ia' / 'structuredAttrs_defaults.json',
|
'ia' / 'derivation-options' / 'structuredAttrs_defaults.json',
|
||||||
'ia' / 'structuredAttrs_all_set.json',
|
'ia' / 'derivation-options' / 'structuredAttrs_all_set.json',
|
||||||
'ca' / 'all_set.json',
|
'ca' / 'derivation-options' / 'all_set.json',
|
||||||
'ca' / 'structuredAttrs_all_set.json',
|
'ca' / 'derivation-options' / 'structuredAttrs_all_set.json',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,7 @@ namespace nix {
|
||||||
|
|
||||||
using namespace nlohmann;
|
using namespace nlohmann;
|
||||||
|
|
||||||
class DerivationAdvancedAttrsTest : public JsonCharacterizationTest<Derivation>,
|
class DerivationAdvancedAttrsTest : public JsonCharacterizationTest<Derivation>, public LibStoreTest
|
||||||
public JsonCharacterizationTest<DerivationOptions<SingleDerivedPath>>,
|
|
||||||
public LibStoreTest
|
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
std::filesystem::path unitTestData = getUnitTestData() / "derivation" / "ia";
|
std::filesystem::path unitTestData = getUnitTestData() / "derivation" / "ia";
|
||||||
|
|
@ -496,16 +494,16 @@ TEST_F(CaDerivationAdvancedAttrsTest, advancedAttributes_structuredAttrs)
|
||||||
{"rainbow", "uid-range", "ca-derivations"});
|
{"rainbow", "uid-range", "ca-derivations"});
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TEST_JSON_OPTIONS(FIXUTURE, VAR, VAR2) \
|
#define TEST_JSON_OPTIONS(FIXUTURE, VAR, VAR2) \
|
||||||
TEST_F(FIXUTURE, DerivationOptions_##VAR##_from_json) \
|
TEST_F(FIXUTURE, DerivationOptions_##VAR##_from_json) \
|
||||||
{ \
|
{ \
|
||||||
this->JsonCharacterizationTest<DerivationOptions<SingleDerivedPath>>::readJsonTest( \
|
nix::readJsonTest<DerivationOptions<SingleDerivedPath>>( \
|
||||||
#VAR, advancedAttributes_##VAR2); \
|
*this, "derivation-options/" #VAR, advancedAttributes_##VAR2); \
|
||||||
} \
|
} \
|
||||||
TEST_F(FIXUTURE, DerivationOptions_##VAR##_to_json) \
|
TEST_F(FIXUTURE, DerivationOptions_##VAR##_to_json) \
|
||||||
{ \
|
{ \
|
||||||
this->JsonCharacterizationTest<DerivationOptions<SingleDerivedPath>>::writeJsonTest( \
|
nix::readJsonTest<DerivationOptions<SingleDerivedPath>>( \
|
||||||
#VAR, advancedAttributes_##VAR2); \
|
*this, "derivation-options/" #VAR, advancedAttributes_##VAR2); \
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_JSON_OPTIONS(DerivationAdvancedAttrsTest, defaults, defaults)
|
TEST_JSON_OPTIONS(DerivationAdvancedAttrsTest, defaults, defaults)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue