End-to-end CLI tests

This commit is contained in:
Bán Dénes 2021-07-17 01:15:27 +02:00
parent 1f3ecb5c58
commit 4d88dac40a
15 changed files with 343 additions and 7 deletions

1
test/cli/basic/command Normal file
View file

@ -0,0 +1 @@
node src/cli.js test/fixtures/minimal.yaml

13
test/cli/basic/log Normal file
View 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.

View file

@ -0,0 +1,7 @@
points:
zones:
matrix:
columns:
col: {}
rows:
row: {}

View 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

View 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
]
}

View 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

View 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"
}
}
}

View file

@ -0,0 +1,3 @@
points.zones.matrix:
columns.col: {}
rows.row: {}

View file

@ -0,0 +1,5 @@
{
"u": 19,
"cx": 18,
"cy": 17
}

View file

@ -0,0 +1 @@
node src/cli.js

View file

@ -0,0 +1 @@
Usage: ergogen <config_file> [options]