Skip to content

Commit ad9d495

Browse files
Add language option and code block tests to PIO files
Extended test_output_json_full_valid.pio with .lang_opt directives and language-specific code blocks to test handling of custom output types. Updated expected warnings for unknown code block output types. Minor formatting change in test_define_float_errors.pio.
1 parent 738fb34 commit ad9d495

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

tools/pioasm/test/errors/general/test_define_float_errors.pio

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
// input.pio:3.24-26: syntax error, unexpected float
1212
// 3 | .define PUBLIC bad_val 1.5
1313
// | ^~~
14+
//

tools/pioasm/test/valid/output/test_output_json_full_valid.pio

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run: pioasm -o json input.pio
22
.define PUBLIC global_const 7
3-
43
.program format_test
54
.origin 4
65
.side_set 2 opt pindirs
@@ -10,6 +9,25 @@ public entry:
109
nop side 1
1110
.wrap
1211

12+
.lang_opt lang1 opt1 = "this is a test 1"
13+
.lang_opt lang2 opt1 = "this is a test 2"
14+
.lang_opt lang1 opt2 = test_3
15+
.lang_opt lang1 opt2 = test_4
16+
17+
% lang1 {
18+
foo
19+
%}
20+
21+
% lang2 {
22+
bar
23+
%}
24+
25+
% lang1 {
26+
foobar
27+
%}
28+
29+
.lang_opt lang1 opt3 = test_5
30+
1331
.program second_prog
1432
nop
1533
// -- Output
@@ -55,3 +73,6 @@ public entry:
5573
// }
5674
//
5775
// Stderr:
76+
// input.pio:17.1-19.2: warning, unknown code block output type 'lang1'
77+
// input.pio:21.1-23.2: warning, unknown code block output type 'lang2'
78+
//

0 commit comments

Comments
 (0)