Skip to content

Commit

Permalink
tests: grove: btn: support support inverted input
Browse files Browse the repository at this point in the history
With the new "Grove LED Button" module, the Grove Button Shield
also supports low-active buttons that require further testing.

Signed-off-by: Stephan Linz <[email protected]>
  • Loading branch information
rexut committed Nov 25, 2024
1 parent f9bab16 commit 0b09e9f
Show file tree
Hide file tree
Showing 3 changed files with 887 additions and 36 deletions.
98 changes: 98 additions & 0 deletions tests/quarantine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,17 @@
- waveshare_rp2040_eth/rp2040
scenarios:
- grove.rpipico.v1.grove_btn.gpio.d16
- grove.rpipico.v1.grove_btn.gpio.d16.inv
- grove.rpipico.v1.grove_btn.gpio.d17
- grove.rpipico.v1.grove_btn.gpio.d17.inv
- grove.rpipico.v1.grove_btn.gpio.d18
- grove.rpipico.v1.grove_btn.gpio.d18.inv
- grove.rpipico.v1.grove_btn.gpio.d19
- grove.rpipico.v1.grove_btn.gpio.d19.inv
- grove.rpipico.v1.grove_btn.gpio.d20
- grove.rpipico.v1.grove_btn.gpio.d20.inv
- grove.rpipico.v1.grove_btn.gpio.d21
- grove.rpipico.v1.grove_btn.gpio.d21.inv

# Grove Connectors (directly) On-Board

Expand Down Expand Up @@ -396,112 +402,204 @@
- seeeduino_cm0/samd21g18a
scenarios:
- grove.connectors.grove_btn.gpio.d2
- grove.connectors.grove_btn.gpio.d2.inv
- grove.connectors.grove_btn.gpio.d3
- grove.connectors.grove_btn.gpio.d3.inv
- grove.connectors.grove_btn.gpio.d4
- grove.connectors.grove_btn.gpio.d4.inv
- grove.connectors.grove_btn.gpio.d5
- grove.connectors.grove_btn.gpio.d5.inv
- grove.connectors.grove_btn.gpio.d6
- grove.connectors.grove_btn.gpio.d6.inv
- grove.connectors.grove_btn.gpio.d7
- grove.connectors.grove_btn.gpio.d7.inv
- grove.connectors.grove_btn.gpio.d8
- grove.connectors.grove_btn.gpio.d8.inv
- grove.connectors.grove_btn.gpio.d9
- grove.connectors.grove_btn.gpio.d9.inv
- grove.connectors.grove_btn.gpio.d10
- grove.connectors.grove_btn.gpio.d10.inv
- grove.connectors.grove_btn.gpio.d11
- grove.connectors.grove_btn.gpio.d11.inv
- grove.connectors.grove_btn.gpio.d12
- grove.connectors.grove_btn.gpio.d12.inv
- grove.connectors.grove_btn.gpio.d13
- grove.connectors.grove_btn.gpio.d13.inv
- grove.connectors.grove_btn.gpio.d14
- grove.connectors.grove_btn.gpio.d14.inv
- grove.connectors.grove_btn.gpio.d15
- grove.connectors.grove_btn.gpio.d15.inv
- grove.connectors.grove_btn.gpio.d16
- grove.connectors.grove_btn.gpio.d16.inv
- grove.connectors.grove_btn.gpio.d17
- grove.connectors.grove_btn.gpio.d17.inv
- grove.connectors.grove_btn.gpio.d20
- grove.connectors.grove_btn.gpio.d20.inv
- grove.connectors.grove_btn.gpio.d21
- grove.connectors.grove_btn.gpio.d21.inv
- grove.connectors.grove_btn.gpio.d22
- grove.connectors.grove_btn.gpio.d22.inv
- grove.connectors.grove_btn.gpio.d23
- grove.connectors.grove_btn.gpio.d23.inv
- grove.connectors.grove_btn.gpio.d24
- grove.connectors.grove_btn.gpio.d24.inv
- grove.connectors.grove_btn.gpio.d25
- grove.connectors.grove_btn.gpio.d25.inv
- grove.connectors.grove_btn.gpio.d26
- grove.connectors.grove_btn.gpio.d26.inv
- grove.connectors.grove_btn.gpio.d27
- grove.connectors.grove_btn.gpio.d27.inv
- grove.connectors.grove_btn.gpio.d28
- grove.connectors.grove_btn.gpio.d28.inv
- grove.connectors.grove_btn.gpio.d29
- grove.connectors.grove_btn.gpio.d29.inv
- grove.connectors.grove_btn.gpio.d30
- grove.connectors.grove_btn.gpio.d30.inv
- grove.connectors.grove_btn.gpio.d31
- grove.connectors.grove_btn.gpio.d31.inv

- comment: "shield(grove.connectors.grove_btn): seeeduino_lotus: invalid board condition."
platforms:
- seeeduino_lotus/samd21g18a
scenarios:
- grove.connectors.grove_btn.gpio.d9
- grove.connectors.grove_btn.gpio.d9.inv
- grove.connectors.grove_btn.gpio.d10
- grove.connectors.grove_btn.gpio.d10.inv
- grove.connectors.grove_btn.gpio.d11
- grove.connectors.grove_btn.gpio.d11.inv
- grove.connectors.grove_btn.gpio.d12
- grove.connectors.grove_btn.gpio.d12.inv
- grove.connectors.grove_btn.gpio.d13
- grove.connectors.grove_btn.gpio.d13.inv
- grove.connectors.grove_btn.gpio.d20
- grove.connectors.grove_btn.gpio.d20.inv
- grove.connectors.grove_btn.gpio.d21
- grove.connectors.grove_btn.gpio.d21.inv
- grove.connectors.grove_btn.gpio.d22
- grove.connectors.grove_btn.gpio.d22.inv
- grove.connectors.grove_btn.gpio.d23
- grove.connectors.grove_btn.gpio.d23.inv
- grove.connectors.grove_btn.gpio.d24
- grove.connectors.grove_btn.gpio.d24.inv
- grove.connectors.grove_btn.gpio.d25
- grove.connectors.grove_btn.gpio.d25.inv
- grove.connectors.grove_btn.gpio.d26
- grove.connectors.grove_btn.gpio.d26.inv
- grove.connectors.grove_btn.gpio.d27
- grove.connectors.grove_btn.gpio.d27.inv
- grove.connectors.grove_btn.gpio.d28
- grove.connectors.grove_btn.gpio.d28.inv
- grove.connectors.grove_btn.gpio.d29
- grove.connectors.grove_btn.gpio.d29.inv
- grove.connectors.grove_btn.gpio.d30
- grove.connectors.grove_btn.gpio.d30.inv
- grove.connectors.grove_btn.gpio.d31
- grove.connectors.grove_btn.gpio.d31.inv

- comment: "shield(grove.connectors.grove_btn): cytron_maker_nano_rp2040: invalid board condition."
platforms:
- cytron_maker_nano_rp2040/rp2040
scenarios:
- grove.connectors.grove_btn.gpio.d2
- grove.connectors.grove_btn.gpio.d2.inv
- grove.connectors.grove_btn.gpio.d3
- grove.connectors.grove_btn.gpio.d3.inv
- grove.connectors.grove_btn.gpio.d4
- grove.connectors.grove_btn.gpio.d4.inv
- grove.connectors.grove_btn.gpio.d5
- grove.connectors.grove_btn.gpio.d5.inv
- grove.connectors.grove_btn.gpio.d6
- grove.connectors.grove_btn.gpio.d6.inv
- grove.connectors.grove_btn.gpio.d7
- grove.connectors.grove_btn.gpio.d7.inv
- grove.connectors.grove_btn.gpio.d8
- grove.connectors.grove_btn.gpio.d8.inv
- grove.connectors.grove_btn.gpio.d9
- grove.connectors.grove_btn.gpio.d9.inv
- grove.connectors.grove_btn.gpio.d10
- grove.connectors.grove_btn.gpio.d10.inv
- grove.connectors.grove_btn.gpio.d11
- grove.connectors.grove_btn.gpio.d11.inv
- grove.connectors.grove_btn.gpio.d12
- grove.connectors.grove_btn.gpio.d12.inv
- grove.connectors.grove_btn.gpio.d13
- grove.connectors.grove_btn.gpio.d13.inv
- grove.connectors.grove_btn.gpio.d16
- grove.connectors.grove_btn.gpio.d16.inv
- grove.connectors.grove_btn.gpio.d17
- grove.connectors.grove_btn.gpio.d17.inv
- grove.connectors.grove_btn.gpio.d18
- grove.connectors.grove_btn.gpio.d18.inv
- grove.connectors.grove_btn.gpio.d19
- grove.connectors.grove_btn.gpio.d19.inv
- grove.connectors.grove_btn.gpio.d20
- grove.connectors.grove_btn.gpio.d20.inv
- grove.connectors.grove_btn.gpio.d21
- grove.connectors.grove_btn.gpio.d21.inv
- grove.connectors.grove_btn.gpio.d22
- grove.connectors.grove_btn.gpio.d22.inv
- grove.connectors.grove_btn.gpio.d23
- grove.connectors.grove_btn.gpio.d23.inv
- grove.connectors.grove_btn.gpio.d24
- grove.connectors.grove_btn.gpio.d24.inv
- grove.connectors.grove_btn.gpio.d25
- grove.connectors.grove_btn.gpio.d25.inv
- grove.connectors.grove_btn.gpio.d26
- grove.connectors.grove_btn.gpio.d26.inv
- grove.connectors.grove_btn.gpio.d27
- grove.connectors.grove_btn.gpio.d27.inv
- grove.connectors.grove_btn.gpio.d28
- grove.connectors.grove_btn.gpio.d28.inv
- grove.connectors.grove_btn.gpio.d29
- grove.connectors.grove_btn.gpio.d29.inv
- grove.connectors.grove_btn.gpio.d30
- grove.connectors.grove_btn.gpio.d30.inv
- grove.connectors.grove_btn.gpio.d31
- grove.connectors.grove_btn.gpio.d31.inv

- comment: "shield(grove.connectors.grove_btn): cytron_maker_pi_rp2040: invalid board condition."
platforms:
- cytron_maker_pi_rp2040/rp2040
scenarios:
- grove.connectors.grove_btn.gpio.d8
- grove.connectors.grove_btn.gpio.d8.inv
- grove.connectors.grove_btn.gpio.d9
- grove.connectors.grove_btn.gpio.d9.inv
- grove.connectors.grove_btn.gpio.d10
- grove.connectors.grove_btn.gpio.d10.inv
- grove.connectors.grove_btn.gpio.d11
- grove.connectors.grove_btn.gpio.d11.inv
- grove.connectors.grove_btn.gpio.d12
- grove.connectors.grove_btn.gpio.d12.inv
- grove.connectors.grove_btn.gpio.d13
- grove.connectors.grove_btn.gpio.d13.inv
- grove.connectors.grove_btn.gpio.d14
- grove.connectors.grove_btn.gpio.d14.inv
- grove.connectors.grove_btn.gpio.d15
- grove.connectors.grove_btn.gpio.d15.inv
- grove.connectors.grove_btn.gpio.d18
- grove.connectors.grove_btn.gpio.d18.inv
- grove.connectors.grove_btn.gpio.d19
- grove.connectors.grove_btn.gpio.d19.inv
- grove.connectors.grove_btn.gpio.d20
- grove.connectors.grove_btn.gpio.d20.inv
- grove.connectors.grove_btn.gpio.d21
- grove.connectors.grove_btn.gpio.d21.inv
- grove.connectors.grove_btn.gpio.d22
- grove.connectors.grove_btn.gpio.d22.inv
- grove.connectors.grove_btn.gpio.d23
- grove.connectors.grove_btn.gpio.d23.inv
- grove.connectors.grove_btn.gpio.d24
- grove.connectors.grove_btn.gpio.d24.inv
- grove.connectors.grove_btn.gpio.d25
- grove.connectors.grove_btn.gpio.d25.inv
- grove.connectors.grove_btn.gpio.d29
- grove.connectors.grove_btn.gpio.d29.inv
- grove.connectors.grove_btn.gpio.d30
- grove.connectors.grove_btn.gpio.d30.inv
- grove.connectors.grove_btn.gpio.d31
- grove.connectors.grove_btn.gpio.d31.inv

##############################################################################
#
Expand Down
71 changes: 36 additions & 35 deletions tests/shields/grove_btn/dts_bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ project(grove_btn_shields)

target_sources(app PRIVATE src/main.c)

function(test_if config node_parent node_label node_dscr)
function(test_if config node_parent node_label node_dscr node_alt_dscr)
if(${config})
dt_nodelabel(node_path NODELABEL "${node_label}")
if(DEFINED node_path AND "${node_path}" MATCHES "${node_parent}")
dt_prop(node_prop PATH "${node_path}" PROPERTY "label")
if(DEFINED node_prop AND "${node_prop}" STREQUAL "${node_dscr}")
if(DEFINED node_prop AND ("${node_prop}" STREQUAL "${node_dscr}"
OR "${node_prop}" STREQUAL "${node_alt_dscr}"))
message(STATUS "Found label \"${node_label}\" at \"${node_path}\" "
"as \"${node_prop}\"")
else()
message(FATAL_ERROR "Test failed, "
"actual either "
"the node path \"${node_path}\" at label \"${node_label}\" "
"was not found or has no \"label\" property with \"${node_dscr}\" or "
"the node labels are missing or misspelled."
"\"${node_alt_dscr}\" or the node labels are missing or misspelled."
)
endif()
else()
Expand All @@ -48,35 +49,35 @@ endif()
# )
#endif()

test_if(CONFIG_SHIELD_GROVE_BTN_D0 "/grove_btns" "grove_btn_d0" "Grove Button D0")
test_if(CONFIG_SHIELD_GROVE_BTN_D1 "/grove_btns" "grove_btn_d1" "Grove Button D1")
test_if(CONFIG_SHIELD_GROVE_BTN_D2 "/grove_btns" "grove_btn_d2" "Grove Button D2")
test_if(CONFIG_SHIELD_GROVE_BTN_D3 "/grove_btns" "grove_btn_d3" "Grove Button D3")
test_if(CONFIG_SHIELD_GROVE_BTN_D4 "/grove_btns" "grove_btn_d4" "Grove Button D4")
test_if(CONFIG_SHIELD_GROVE_BTN_D5 "/grove_btns" "grove_btn_d5" "Grove Button D5")
test_if(CONFIG_SHIELD_GROVE_BTN_D6 "/grove_btns" "grove_btn_d6" "Grove Button D6")
test_if(CONFIG_SHIELD_GROVE_BTN_D7 "/grove_btns" "grove_btn_d7" "Grove Button D7")
test_if(CONFIG_SHIELD_GROVE_BTN_D8 "/grove_btns" "grove_btn_d8" "Grove Button D8")
test_if(CONFIG_SHIELD_GROVE_BTN_D9 "/grove_btns" "grove_btn_d9" "Grove Button D9")
test_if(CONFIG_SHIELD_GROVE_BTN_D10 "/grove_btns" "grove_btn_d10" "Grove Button D10")
test_if(CONFIG_SHIELD_GROVE_BTN_D11 "/grove_btns" "grove_btn_d11" "Grove Button D11")
test_if(CONFIG_SHIELD_GROVE_BTN_D12 "/grove_btns" "grove_btn_d12" "Grove Button D12")
test_if(CONFIG_SHIELD_GROVE_BTN_D13 "/grove_btns" "grove_btn_d13" "Grove Button D13")
test_if(CONFIG_SHIELD_GROVE_BTN_D14 "/grove_btns" "grove_btn_d14" "Grove Button D14")
test_if(CONFIG_SHIELD_GROVE_BTN_D15 "/grove_btns" "grove_btn_d15" "Grove Button D15")
test_if(CONFIG_SHIELD_GROVE_BTN_D16 "/grove_btns" "grove_btn_d16" "Grove Button D16")
test_if(CONFIG_SHIELD_GROVE_BTN_D17 "/grove_btns" "grove_btn_d17" "Grove Button D17")
test_if(CONFIG_SHIELD_GROVE_BTN_D18 "/grove_btns" "grove_btn_d18" "Grove Button D18")
test_if(CONFIG_SHIELD_GROVE_BTN_D19 "/grove_btns" "grove_btn_d19" "Grove Button D19")
test_if(CONFIG_SHIELD_GROVE_BTN_D20 "/grove_btns" "grove_btn_d20" "Grove Button D20")
test_if(CONFIG_SHIELD_GROVE_BTN_D21 "/grove_btns" "grove_btn_d21" "Grove Button D21")
test_if(CONFIG_SHIELD_GROVE_BTN_D22 "/grove_btns" "grove_btn_d22" "Grove Button D22")
test_if(CONFIG_SHIELD_GROVE_BTN_D23 "/grove_btns" "grove_btn_d23" "Grove Button D23")
test_if(CONFIG_SHIELD_GROVE_BTN_D24 "/grove_btns" "grove_btn_d24" "Grove Button D24")
test_if(CONFIG_SHIELD_GROVE_BTN_D25 "/grove_btns" "grove_btn_d25" "Grove Button D25")
test_if(CONFIG_SHIELD_GROVE_BTN_D26 "/grove_btns" "grove_btn_d26" "Grove Button D26")
test_if(CONFIG_SHIELD_GROVE_BTN_D27 "/grove_btns" "grove_btn_d27" "Grove Button D27")
test_if(CONFIG_SHIELD_GROVE_BTN_D28 "/grove_btns" "grove_btn_d28" "Grove Button D28")
test_if(CONFIG_SHIELD_GROVE_BTN_D29 "/grove_btns" "grove_btn_d29" "Grove Button D29")
test_if(CONFIG_SHIELD_GROVE_BTN_D30 "/grove_btns" "grove_btn_d30" "Grove Button D30")
test_if(CONFIG_SHIELD_GROVE_BTN_D31 "/grove_btns" "grove_btn_d31" "Grove Button D31")
test_if(CONFIG_SHIELD_GROVE_BTN_D0 "/grove_btns" "grove_btn_d0" "Grove Button D0" "Grove Button D0 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D1 "/grove_btns" "grove_btn_d1" "Grove Button D1" "Grove Button D1 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D2 "/grove_btns" "grove_btn_d2" "Grove Button D2" "Grove Button D2 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D3 "/grove_btns" "grove_btn_d3" "Grove Button D3" "Grove Button D3 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D4 "/grove_btns" "grove_btn_d4" "Grove Button D4" "Grove Button D4 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D5 "/grove_btns" "grove_btn_d5" "Grove Button D5" "Grove Button D5 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D6 "/grove_btns" "grove_btn_d6" "Grove Button D6" "Grove Button D6 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D7 "/grove_btns" "grove_btn_d7" "Grove Button D7" "Grove Button D7 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D8 "/grove_btns" "grove_btn_d8" "Grove Button D8" "Grove Button D8 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D9 "/grove_btns" "grove_btn_d9" "Grove Button D9" "Grove Button D9 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D10 "/grove_btns" "grove_btn_d10" "Grove Button D10" "Grove Button D10 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D11 "/grove_btns" "grove_btn_d11" "Grove Button D11" "Grove Button D11 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D12 "/grove_btns" "grove_btn_d12" "Grove Button D12" "Grove Button D12 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D13 "/grove_btns" "grove_btn_d13" "Grove Button D13" "Grove Button D13 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D14 "/grove_btns" "grove_btn_d14" "Grove Button D14" "Grove Button D14 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D15 "/grove_btns" "grove_btn_d15" "Grove Button D15" "Grove Button D15 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D16 "/grove_btns" "grove_btn_d16" "Grove Button D16" "Grove Button D16 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D17 "/grove_btns" "grove_btn_d17" "Grove Button D17" "Grove Button D17 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D18 "/grove_btns" "grove_btn_d18" "Grove Button D18" "Grove Button D18 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D19 "/grove_btns" "grove_btn_d19" "Grove Button D19" "Grove Button D19 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D20 "/grove_btns" "grove_btn_d20" "Grove Button D20" "Grove Button D20 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D21 "/grove_btns" "grove_btn_d21" "Grove Button D21" "Grove Button D21 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D22 "/grove_btns" "grove_btn_d22" "Grove Button D22" "Grove Button D22 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D23 "/grove_btns" "grove_btn_d23" "Grove Button D23" "Grove Button D23 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D24 "/grove_btns" "grove_btn_d24" "Grove Button D24" "Grove Button D24 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D25 "/grove_btns" "grove_btn_d25" "Grove Button D25" "Grove Button D25 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D26 "/grove_btns" "grove_btn_d26" "Grove Button D26" "Grove Button D26 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D27 "/grove_btns" "grove_btn_d27" "Grove Button D27" "Grove Button D27 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D28 "/grove_btns" "grove_btn_d28" "Grove Button D28" "Grove Button D28 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D29 "/grove_btns" "grove_btn_d29" "Grove Button D29" "Grove Button D29 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D30 "/grove_btns" "grove_btn_d30" "Grove Button D30" "Grove Button D30 (inverted)")
test_if(CONFIG_SHIELD_GROVE_BTN_D31 "/grove_btns" "grove_btn_d31" "Grove Button D31" "Grove Button D31 (inverted)")
Loading

0 comments on commit 0b09e9f

Please sign in to comment.