-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sebastian Schleemilch <[email protected]>
- Loading branch information
1 parent
038695a
commit 4224fe8
Showing
11 changed files
with
404 additions
and
20 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
A: | ||
type: branch | ||
description: A | ||
|
||
A.B: | ||
type: sensor | ||
description: B | ||
datatype: Types.T | ||
default: | ||
m: definitely not an uint8 | ||
complex: | ||
m: | ||
- true | ||
- false | ||
|
||
A.C: | ||
type: sensor | ||
description: C | ||
datatype: Types.T[] | ||
default: | ||
- m: definitely not an uint8 | ||
complex: | ||
m: | ||
- true | ||
- false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
A: | ||
type: branch | ||
description: A | ||
|
||
A.B: | ||
type: sensor | ||
description: B | ||
datatype: Types.T | ||
default: | ||
m: 10 | ||
complex: | ||
m: | ||
- true | ||
- false | ||
|
||
A.C: | ||
type: sensor | ||
description: C | ||
datatype: Types.T[] | ||
default: | ||
- m: 10 | ||
complex: | ||
m: | ||
- true | ||
- false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Types: | ||
type: branch | ||
description: Types | ||
|
||
Types.T: | ||
type: struct | ||
description: T | ||
|
||
Types.T.m: | ||
type: property | ||
description: Tx | ||
datatype: uint8 | ||
|
||
Types.T.complex: | ||
type: property | ||
description: TComplex | ||
datatype: Z | ||
|
||
Types.Z: | ||
type: struct | ||
description: Z | ||
|
||
Types.Z.m: | ||
type: property | ||
description: Zm | ||
datatype: boolean[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright (c) 2024 Contributors to COVESA | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Mozilla Public License 2.0 which is available at | ||
# https://www.mozilla.org/en-US/MPL/2.0/ | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
import subprocess | ||
from pathlib import Path | ||
|
||
HERE = Path(__file__).resolve().parent | ||
|
||
|
||
def test_struct_default(tmp_path): | ||
vspec = HERE / "struct_default_model_ok.vspec" | ||
types = HERE / "struct_default_types.vspec" | ||
cmd = f"vspec export tree -s {vspec} -t {types}" | ||
|
||
# ok | ||
p = subprocess.run(cmd.split()) | ||
assert p.returncode == 0 | ||
|
||
# nok | ||
log = tmp_path / "log.txt" | ||
vspec = HERE / "struct_default_model_nok.vspec" | ||
cmd = f"vspec --log-file {log} export tree -s {vspec} -t {types}" | ||
p = subprocess.run(cmd.split(), capture_output=True, text=True) | ||
assert p.returncode != 0 | ||
print(log.read_text()) | ||
assert "invalid format for datatype 'Types.T'" in log.read_text() |