End-to-end CLI tests
This commit is contained in:
parent
1f3ecb5c58
commit
4d88dac40a
15 changed files with 343 additions and 7 deletions
1
test/cli/basic/command
Normal file
1
test/cli/basic/command
Normal file
|
@ -0,0 +1 @@
|
|||
node src/cli.js test/fixtures/minimal.yaml
|
13
test/cli/basic/log
Normal file
13
test/cli/basic/log
Normal file
|
@ -0,0 +1,13 @@
|
|||
Ergogen v2.0.0 CLI
|
||||
|
||||
Interpreting format: YAML
|
||||
Preprocessing input...
|
||||
Calculating variables...
|
||||
Parsing points...
|
||||
Generating outlines...
|
||||
Extruding cases...
|
||||
Scaffolding PCBs...
|
||||
Output would be empty, rerunning in debug mode...
|
||||
Writing output to disk...
|
||||
Done.
|
||||
|
7
test/cli/basic/reference/canonical.yaml
Normal file
7
test/cli/basic/reference/canonical.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
points:
|
||||
zones:
|
||||
matrix:
|
||||
columns:
|
||||
col: {}
|
||||
rows:
|
||||
row: {}
|
98
test/cli/basic/reference/points/demo.dxf
Normal file
98
test/cli/basic/reference/points/demo.dxf
Normal file
|
@ -0,0 +1,98 @@
|
|||
0
|
||||
SECTION
|
||||
2
|
||||
HEADER
|
||||
9
|
||||
$INSUNITS
|
||||
70
|
||||
4
|
||||
0
|
||||
ENDSEC
|
||||
0
|
||||
SECTION
|
||||
2
|
||||
TABLES
|
||||
0
|
||||
TABLE
|
||||
2
|
||||
LTYPE
|
||||
0
|
||||
LTYPE
|
||||
72
|
||||
65
|
||||
70
|
||||
64
|
||||
2
|
||||
CONTINUOUS
|
||||
3
|
||||
______
|
||||
73
|
||||
0
|
||||
40
|
||||
0
|
||||
0
|
||||
ENDTAB
|
||||
0
|
||||
TABLE
|
||||
2
|
||||
LAYER
|
||||
0
|
||||
ENDTAB
|
||||
0
|
||||
ENDSEC
|
||||
0
|
||||
SECTION
|
||||
2
|
||||
ENTITIES
|
||||
0
|
||||
LINE
|
||||
8
|
||||
0
|
||||
10
|
||||
-9
|
||||
20
|
||||
9
|
||||
11
|
||||
9
|
||||
21
|
||||
9
|
||||
0
|
||||
LINE
|
||||
8
|
||||
0
|
||||
10
|
||||
9
|
||||
20
|
||||
9
|
||||
11
|
||||
9
|
||||
21
|
||||
-9
|
||||
0
|
||||
LINE
|
||||
8
|
||||
0
|
||||
10
|
||||
9
|
||||
20
|
||||
-9
|
||||
11
|
||||
-9
|
||||
21
|
||||
-9
|
||||
0
|
||||
LINE
|
||||
8
|
||||
0
|
||||
10
|
||||
-9
|
||||
20
|
||||
-9
|
||||
11
|
||||
-9
|
||||
21
|
||||
9
|
||||
0
|
||||
ENDSEC
|
||||
0
|
||||
EOF
|
69
test/cli/basic/reference/points/demo.json
Normal file
69
test/cli/basic/reference/points/demo.json
Normal file
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
"models": {
|
||||
"export": {
|
||||
"models": {
|
||||
"matrix_col_row": {
|
||||
"paths": {
|
||||
"top": {
|
||||
"type": "line",
|
||||
"origin": [
|
||||
-9,
|
||||
9
|
||||
],
|
||||
"end": [
|
||||
9,
|
||||
9
|
||||
]
|
||||
},
|
||||
"right": {
|
||||
"type": "line",
|
||||
"origin": [
|
||||
9,
|
||||
9
|
||||
],
|
||||
"end": [
|
||||
9,
|
||||
-9
|
||||
]
|
||||
},
|
||||
"bottom": {
|
||||
"type": "line",
|
||||
"origin": [
|
||||
9,
|
||||
-9
|
||||
],
|
||||
"end": [
|
||||
-9,
|
||||
-9
|
||||
]
|
||||
},
|
||||
"left": {
|
||||
"type": "line",
|
||||
"origin": [
|
||||
-9,
|
||||
-9
|
||||
],
|
||||
"end": [
|
||||
-9,
|
||||
9
|
||||
]
|
||||
}
|
||||
},
|
||||
"origin": [
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"origin": [
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": "mm",
|
||||
"origin": [
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
1
test/cli/basic/reference/points/demo.svg
Normal file
1
test/cli/basic/reference/points/demo.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="18mm" height="18mm" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><g id="svgGroup" stroke-linecap="round" fill-rule="evenodd" font-size="9pt" stroke="#000" stroke-width="0.25mm" fill="none" style="stroke:#000;stroke-width:0.25mm;fill:none"><path d="M 0 0 L 18 0 L 18 18 L 0 18 L 0 0 Z" vector-effect="non-scaling-stroke"/></g></svg>
|
After Width: | Height: | Size: 353 B |
34
test/cli/basic/reference/points/points.json
Normal file
34
test/cli/basic/reference/points/points.json
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"matrix_col_row": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"r": 0,
|
||||
"meta": {
|
||||
"shift": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"rotate": 0,
|
||||
"padding": 19,
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"skip": false,
|
||||
"asym": "both",
|
||||
"name": "matrix_col_row",
|
||||
"colrow": "col_row",
|
||||
"col": {
|
||||
"stagger": 0,
|
||||
"spread": 0,
|
||||
"rotate": 0,
|
||||
"origin": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"rows": {},
|
||||
"key": {},
|
||||
"name": "col"
|
||||
},
|
||||
"row": "row"
|
||||
}
|
||||
}
|
||||
}
|
3
test/cli/basic/reference/raw.txt
Normal file
3
test/cli/basic/reference/raw.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
points.zones.matrix:
|
||||
columns.col: {}
|
||||
rows.row: {}
|
5
test/cli/basic/reference/units.json
Normal file
5
test/cli/basic/reference/units.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"u": 19,
|
||||
"cx": 18,
|
||||
"cy": 17
|
||||
}
|
1
test/cli/missing_input/command
Normal file
1
test/cli/missing_input/command
Normal file
|
@ -0,0 +1 @@
|
|||
node src/cli.js
|
1
test/cli/missing_input/error
Normal file
1
test/cli/missing_input/error
Normal file
|
@ -0,0 +1 @@
|
|||
Usage: ergogen <config_file> [options]
|
Loading…
Add table
Add a link
Reference in a new issue