Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FPP v2.3.0a1 #3066

Merged
merged 265 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
265 commits
Select commit Hold shift + click to select a range
79e7b8f
Update requirements to use new fpp version
Aug 12, 2024
112b60b
Removed unneeded files
Aug 13, 2024
ff7b023
update FppTest for new autocoder changes
Aug 26, 2024
08d8135
Get unit tests updated and working for fpp state machines phase 1 del…
Aug 28, 2024
443da3b
Rename Fw/SMTest to Fw/Sm
Sep 3, 2024
0448d15
Update STARS to use FW_ASSERT
Sep 3, 2024
41cd2e5
Rename SMSignalBuffer to SmSignalBuffer
Sep 3, 2024
de9296f
Fix spelling issues with CI
Sep 5, 2024
003f591
Update requirements to the FPP alpha release v2.2.0a3
Sep 5, 2024
b728ae7
Merge branch 'devel' into sm-test
garthwatney Sep 5, 2024
e27598d
Fix requirements.txt
bocchino Sep 5, 2024
ae5727b
Fix requirements.txt
bocchino Sep 5, 2024
042adb7
Initialize data in the constructor of SmSignalBuffer
Sep 5, 2024
132d4b4
Merge branch 'sm-test' of github.com:garthwatney/fprime into sm-test
Sep 5, 2024
fa3db99
Add constructor list to all the constructors in SmSignalBuffer
Sep 5, 2024
b8add88
Reorganize FppTest directories
bocchino Sep 17, 2024
fbff019
Add missing file
bocchino Sep 17, 2024
185f27f
Reorganize FppTest/state_machine
bocchino Sep 17, 2024
4ed9bac
Add state machine test harness
bocchino Sep 17, 2024
b996498
Revise SmGuard
bocchino Sep 17, 2024
e9d929d
Fix include guard
bocchino Sep 17, 2024
e078f51
Add header file for test harness
bocchino Sep 17, 2024
d8e1df8
Revise Basic state machine
bocchino Sep 17, 2024
4cda44c
Revise Basic test
bocchino Sep 18, 2024
561a845
Add Junction test
bocchino Sep 18, 2024
9dde82d
Add missing file
bocchino Sep 18, 2024
ec3dbe0
Refactor internal state machine tests
bocchino Sep 18, 2024
236febf
Add Nested state machine
bocchino Sep 18, 2024
8744317
Revise Nested test
bocchino Sep 18, 2024
b31b497
Revise state machine tests
bocchino Sep 18, 2024
7d4200c
Merge branch 'devel' into fpp-issue-506-sm-code-gen
bocchino Sep 19, 2024
0cc5e37
Fix issues in string utils
bocchino Sep 19, 2024
ec73044
Revise FppTest
bocchino Sep 21, 2024
b673efb
Refactor state machine test harness
bocchino Sep 21, 2024
bfd670b
Revise autocode for Basic test
bocchino Sep 21, 2024
a70ec7b
Update fpp version
bocchino Sep 21, 2024
4f38f52
Revise FppTest
bocchino Sep 22, 2024
4852d29
Update fpp version
bocchino Sep 22, 2024
fe1497f
Update fpp version
bocchino Sep 23, 2024
4fd9932
Start to add State/Basic test
bocchino Sep 23, 2024
19ad040
Revise FppTest
bocchino Sep 23, 2024
0c5c6a2
Revise SmState::Basic test
bocchino Sep 23, 2024
08bf343
Update fpp version
bocchino Sep 23, 2024
1a894a4
Update FppTest
bocchino Sep 24, 2024
bccda53
Add SmState/BasicSelf test
bocchino Sep 26, 2024
35a6433
Add state/BasicGuard test
bocchino Sep 26, 2024
036510c
Add SmState/BasicU32 test
bocchino Sep 26, 2024
fde82ec
Revise state machine tests
bocchino Sep 26, 2024
8d8c394
Refactor state machine tests
bocchino Sep 27, 2024
9a66a16
Revise FppTest
bocchino Sep 27, 2024
40e77d0
Revise comments
bocchino Sep 27, 2024
d4f4e7b
Refactor state machine tests
bocchino Sep 27, 2024
d845eb0
Refactor state machine tests
bocchino Sep 27, 2024
1e0c7dd
Refactor state machine tests
bocchino Sep 27, 2024
65b1fa7
Refactor state machine tests
bocchino Sep 27, 2024
6e95db3
Revise state machine tests
bocchino Sep 27, 2024
111de82
Revise state machine tests
bocchino Sep 27, 2024
193d50e
Revise state machine tests
bocchino Sep 27, 2024
bc99a83
Revise state machine tests
bocchino Sep 27, 2024
c225db4
Revise fpp tests
bocchino Sep 27, 2024
1a49c72
Revise state machine tests
bocchino Sep 27, 2024
f0a97ed
Revise state machine tests
bocchino Sep 27, 2024
2d7b6e5
Revise state machine tests
bocchino Sep 27, 2024
2ff7f94
Revise state machine tests
bocchino Sep 27, 2024
9b4a4d6
Revise state machine tests
bocchino Sep 27, 2024
ddf220d
Add README files to FPP tests
bocchino Sep 28, 2024
8e89ba2
Start to add StateToState test
bocchino Sep 28, 2024
e19f5d2
Revise StateToState test
bocchino Sep 29, 2024
7a6bfbc
Revise StateToState test
bocchino Sep 29, 2024
b17f67a
Revise StateToState test
bocchino Sep 29, 2024
e0f4fde
Revise StateToState test
bocchino Sep 29, 2024
c048d8e
Revise StateToState test
bocchino Sep 29, 2024
b69aef7
Revise StateToState tests
bocchino Sep 29, 2024
fd886a8
Add BasicInternal test
bocchino Sep 29, 2024
acc39d1
Update fpp version
bocchino Sep 29, 2024
4800904
Revise state machine tests
bocchino Sep 29, 2024
b408956
Add state-to-junction test
bocchino Sep 29, 2024
e21b36c
Add Internal state machine test
bocchino Sep 29, 2024
b5c1ff1
Add Polymorphism test
bocchino Sep 29, 2024
6efb3e8
Add StateToChild test
bocchino Sep 29, 2024
338d45b
Merge branch 'devel' into fpp-issue-506-sm-code-gen
bocchino Oct 1, 2024
933c241
Revise README files
bocchino Oct 1, 2024
d686460
Add junction/Basic test
bocchino Oct 1, 2024
92cbf1e
Revise FppTest build
bocchino Oct 1, 2024
ddc5a74
Update fpp version; revise Basic test
bocchino Oct 2, 2024
9554a33
Revise junction tests
bocchino Oct 3, 2024
f5ac36f
Add BasicGuardU32 test
bocchino Oct 3, 2024
e545882
Add BasicGuardString test
bocchino Oct 3, 2024
9e1931c
Add BasicGuardTestAbsType test
bocchino Oct 3, 2024
66c3ca5
Add BasicGuardTestArray test
bocchino Oct 3, 2024
4826858
Add BasicGuardTestEnum test
bocchino Oct 3, 2024
7f154a4
Add BasicGuardTestStruct test
bocchino Oct 3, 2024
909e074
Add junction/Sequence test
bocchino Oct 3, 2024
ef47686
Add junction/SequenceU32 test
bocchino Oct 3, 2024
7c1b348
Add junction/InputPairU16U32 test
bocchino Oct 3, 2024
688da92
Add JunctionToState.fpp
bocchino Oct 4, 2024
aa04dcf
Add junction/JunctionToState test
bocchino Oct 4, 2024
19d85fe
Add junction/JunctionToJunction test
bocchino Oct 4, 2024
3dfa656
Update fpp version
bocchino Oct 5, 2024
c811a8e
Update fpp version
bocchino Oct 7, 2024
19f9f53
Update fpp version
bocchino Oct 9, 2024
5d9573c
Update fpp version
bocchino Oct 9, 2024
de55b43
Fix CMakeLists
bocchino Oct 10, 2024
a0eefcb
Merge branch 'devel' into fpp-issue-507-sm-comp-code-gen
bocchino Oct 11, 2024
332fe7b
Update fpp version
bocchino Oct 11, 2024
2e4caee
Update fpp version
bocchino Oct 14, 2024
8edbb90
Refactor sm tests
bocchino Oct 14, 2024
8283e18
Refactor sm tests
bocchino Oct 14, 2024
c842ba7
Refactor sm tests
bocchino Oct 14, 2024
dcbc517
Update fpp version
bocchino Oct 15, 2024
5e222d8
Start to add internal_instance tests
bocchino Oct 15, 2024
ebcbdcd
Add missing files
bocchino Oct 15, 2024
05b0c3f
Revise state machine tests
bocchino Oct 15, 2024
2e12a39
Revise state machine tests
bocchino Oct 16, 2024
6e8cd1b
Revise sm instance initial tests
bocchino Oct 16, 2024
689d8c5
Revise sm instance init tests
bocchino Oct 16, 2024
4e8c6f0
Revise sm instance initial tests
bocchino Oct 16, 2024
e56291b
Revise sm instance initial tests
bocchino Oct 16, 2024
1495b1e
Add sm instance state tests
bocchino Oct 16, 2024
b9bf8ae
Revise sm instance state tests
bocchino Oct 16, 2024
a702eb0
Revise sm instance state tests
bocchino Oct 16, 2024
abfae0f
Revise sm instance state tests
bocchino Oct 16, 2024
4407518
Revise sm instance state tests
bocchino Oct 16, 2024
ef16934
Revise internal instance state tests
bocchino Oct 16, 2024
a6a6cf1
Revise sm instance state tests
bocchino Oct 16, 2024
9721994
Revise sm instance state tests
bocchino Oct 16, 2024
e9cb07a
Revsie BasicGuardTestAbsType
bocchino Oct 16, 2024
c5d92a1
Revise sm instance state tests
bocchino Oct 16, 2024
a966be4
Revise BasicGuardTestAbsType
bocchino Oct 16, 2024
1bcf87e
Add BasicGuardTestArray
bocchino Oct 17, 2024
a399613
Add BasicGuardTestEnum
bocchino Oct 17, 2024
475f635
Add BasicGuardTestStruct
bocchino Oct 17, 2024
2aa9155
Add BasicGuardU32
bocchino Oct 17, 2024
d340d47
Add BasicInternal
bocchino Oct 17, 2024
ed6a03e
Revise BasicInternal
bocchino Oct 17, 2024
440f77b
Add BasicSelf
bocchino Oct 17, 2024
b33f5ac
Reformat code
bocchino Oct 17, 2024
eac87d3
Add BasicString test
bocchino Oct 17, 2024
48b51c5
Add BasicTestAbsType
bocchino Oct 17, 2024
dde154c
Add BasicTestArray
bocchino Oct 17, 2024
6e5112e
Add BasicTestEnum
bocchino Oct 17, 2024
9a1fd13
Add BasicTestStruct
bocchino Oct 17, 2024
bbfcbce
Add BasicU32
bocchino Oct 17, 2024
01541bd
Remove extraneous file
bocchino Oct 17, 2024
c3b8731
Remove extraneous files
bocchino Oct 17, 2024
c2ed4ad
Revise sm tests
bocchino Oct 17, 2024
4f30e6b
Revise state machine tests
bocchino Oct 17, 2024
b1974ef
Add Internal test
bocchino Oct 17, 2024
f3956ad
Add Polymorphism test
bocchino Oct 17, 2024
68c9389
Add StateToChild test
bocchino Oct 17, 2024
1b4319e
Add StateToJunction test
bocchino Oct 17, 2024
53e8c6d
Add StateToSelf test
bocchino Oct 17, 2024
e5f0364
Add StateToState test
bocchino Oct 17, 2024
5ea0ca1
Add junction/Basic
bocchino Oct 21, 2024
9cfeadb
Add BasicU32 test
bocchino Oct 21, 2024
f9f08a5
Add InputPairU16U32
bocchino Oct 21, 2024
200a8f6
Add JunctionToJunction
bocchino Oct 21, 2024
a83dd0d
Revise comments
bocchino Oct 22, 2024
cafefb5
Add JunctionToState
bocchino Oct 22, 2024
4dc91be
Revise JunctionToState
bocchino Oct 22, 2024
e19edda
Revise JunctionToJunction
bocchino Oct 22, 2024
787b48a
Add Sequence test
bocchino Oct 25, 2024
1b4623a
Add Sequence test
bocchino Oct 25, 2024
eb45183
Merge branch 'fpp-issue-519-sm-tests' of github.com:bocchino/fprime i…
bocchino Oct 25, 2024
9ad72ee
Revise SequenceU32 test
bocchino Oct 25, 2024
3c022f8
Revise state machine tests
bocchino Oct 25, 2024
d04b6d9
Revise Basic test
bocchino Oct 25, 2024
2f4a6f9
Revise junction/Basic test
bocchino Oct 25, 2024
f816bf8
Revise state/Basic test
bocchino Oct 25, 2024
bf30dd9
Revise initial/Basic test
bocchino Oct 25, 2024
2e2548f
Revise state/Basic test
bocchino Oct 25, 2024
9c1a69f
Reformat code
bocchino Oct 25, 2024
b428ce2
Update fpp version
bocchino Oct 25, 2024
f8fd277
Update fpp; revise FppTest
bocchino Nov 5, 2024
3b521f0
Refactor internal/initial tests
bocchino Nov 5, 2024
43ea35b
Revise state machine tests
bocchino Nov 5, 2024
38a221b
Revise internal/state tests
bocchino Nov 5, 2024
56c653e
Revise state-machine/internal tests
bocchino Nov 5, 2024
d3dd481
Revise state-machine/internal tests
bocchino Nov 5, 2024
4c7aa3a
Reformat C++ files
bocchino Nov 5, 2024
5d72d6f
Revise state-machine/internal_instance/initial tests
bocchino Nov 5, 2024
47ecab1
Revise internal_instance/state tests
bocchino Nov 5, 2024
14aa716
Format code
bocchino Nov 5, 2024
af67901
Revise internal_instance/choice tests
bocchino Nov 5, 2024
7fdb409
Merge branch 'devel' into fpp-issue-527-choices
bocchino Nov 5, 2024
8991c57
Update fpp version
bocchino Nov 5, 2024
eee46ef
Format code
bocchino Nov 5, 2024
37f8415
Update fpp version
bocchino Nov 5, 2024
d3f5589
Improve const correctness in Fw/Port
bocchino Nov 6, 2024
285d82c
Update design
bocchino Nov 9, 2024
96d21a9
Revise state machines design
bocchino Nov 10, 2024
7424393
Revise state machine design
bocchino Nov 10, 2024
0540606
Revise state machine design
bocchino Nov 10, 2024
a7a1004
Revise state machine design
bocchino Nov 10, 2024
1f006ef
Revise state machine design
bocchino Nov 10, 2024
8e77b1e
Revise state machines design
bocchino Nov 10, 2024
011a73f
Revise state machines design
bocchino Nov 10, 2024
581c719
Revise state machines design
bocchino Nov 11, 2024
5e292e6
Revise state machines design
bocchino Nov 11, 2024
eaf7c78
Revise state machines design
bocchino Nov 11, 2024
52cbc57
Revise state machines design
bocchino Nov 11, 2024
72a6a92
Revise state machines design
bocchino Nov 11, 2024
ee3a22b
Revise state machines design
bocchino Nov 11, 2024
9d224eb
Revise state machines design
bocchino Nov 11, 2024
5f49a71
Revise state machines design
bocchino Nov 11, 2024
940ea2b
Revise state machines design
bocchino Nov 11, 2024
57721d5
Revise state machines design
bocchino Nov 11, 2024
7d3e045
Revise state machines design
bocchino Nov 11, 2024
5132ac1
Revise state machines design
bocchino Nov 11, 2024
eafeea6
Revise state machines design
bocchino Nov 11, 2024
725af8f
Revise state machines design
bocchino Nov 11, 2024
0be6554
Revise state machines design
bocchino Nov 11, 2024
4b85185
Revise state machines design
bocchino Nov 11, 2024
f38777b
Revise state machines design
bocchino Nov 11, 2024
d9baa01
Revise state machines design
bocchino Nov 11, 2024
f3c4682
Revise state machines design
bocchino Nov 11, 2024
68c11bf
Revise state machines design
bocchino Nov 11, 2024
20d4195
Revise state machines design
bocchino Nov 11, 2024
02f99e3
Revise state machines design
bocchino Nov 11, 2024
02ae1fb
Revise state machines design
bocchino Nov 11, 2024
6a86ecd
Revise state machines design
bocchino Nov 11, 2024
21205b1
Revise state machines design
bocchino Nov 11, 2024
2f09111
Revise state machines design
bocchino Nov 11, 2024
75890f3
Revise state machine instances design
bocchino Nov 11, 2024
b743ef0
Revise state machines design
bocchino Nov 11, 2024
7d4aff0
Revise state machines design
bocchino Nov 11, 2024
fa91d89
Revise state machines design
bocchino Nov 11, 2024
f255d15
Update fpp version
bocchino Nov 13, 2024
d2d26cd
Update fpp version; revise code to match
bocchino Nov 14, 2024
f9e115e
Update fpp version
bocchino Nov 20, 2024
a4fbc92
Revise state machines design
bocchino Nov 21, 2024
391c8e1
Revise state machines design
bocchino Nov 21, 2024
4539162
Revise state machines design
bocchino Nov 21, 2024
0454374
Revise state machines design
bocchino Nov 21, 2024
93512d3
Revise typography
bocchino Nov 22, 2024
3fb8715
Revise state machines design
bocchino Nov 22, 2024
3e63b63
Revise state machines design
bocchino Nov 22, 2024
a0c6120
Revise state machines design
bocchino Nov 22, 2024
0a8a9d1
Merge branch 'devel' into fpp-state-machines
bocchino Nov 22, 2024
ae8aec0
Merge branch 'devel' into fpp-state-machines
bocchino Dec 7, 2024
e094869
Merge branch 'devel' into fpp-state-machines
bocchino Dec 7, 2024
048e075
Revise state machine unit tests
bocchino Dec 9, 2024
0fc4ff7
Revise state machine tests
bocchino Dec 9, 2024
106cc31
Revise state machine tests
bocchino Dec 9, 2024
be3854c
Update fpp version
bocchino Dec 10, 2024
f4e2bd0
Update spelling
bocchino Dec 10, 2024
7c44eb4
Remove Design directory
bocchino Dec 10, 2024
69787c5
Update mkdocs
bocchino Dec 10, 2024
3cdcf15
Merge branch 'devel' into fpp-v2.3.0a1
bocchino Dec 12, 2024
6871e58
Merge branch 'devel' into fpp-v2.3.0a1
LeStarch Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions FppTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/struct/")
set(SOURCE_FILES "source.cpp")
set(MOD_DEPS
${PROJECT_NAME}/array
${PROJECT_NAME}/component/active
${PROJECT_NAME}/component/empty
${PROJECT_NAME}/component/passive
${PROJECT_NAME}/component/queued
${PROJECT_NAME}/dp
${PROJECT_NAME}/state_machine
${PROJECT_NAME}/enum
${PROJECT_NAME}/state_machine/external_instance
${PROJECT_NAME}/state_machine/internal/initial
${PROJECT_NAME}/state_machine/internal/junction
${PROJECT_NAME}/state_machine/internal/state
${PROJECT_NAME}/state_machine/internal_instance/initial
${PROJECT_NAME}/state_machine/internal_instance/junction
${PROJECT_NAME}/state_machine/internal_instance/state
${PROJECT_NAME}/struct
${PROJECT_NAME}/component/empty
${PROJECT_NAME}/component/active
${PROJECT_NAME}/component/queued
${PROJECT_NAME}/component/passive
)

register_fprime_deployment()
24 changes: 3 additions & 21 deletions FppTest/state_machine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
set(SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/SmTest.cpp"
"${CMAKE_CURRENT_LIST_DIR}/SmTest.fpp"
"${CMAKE_CURRENT_LIST_DIR}/DeviceSm.cpp"
"${CMAKE_CURRENT_LIST_DIR}/HackSm.cpp"
)
set(MOD_DEPS Fw/Sm)

register_fprime_module()

set(UT_SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/SmTest.fpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/SmTestTestMain.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/SmTestTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/DeviceSm.cpp"
"${CMAKE_CURRENT_LIST_DIR}/HackSm.cpp"
)

set(UT_MOD_DEPS STest)
set(UT_AUTO_HELPERS ON)
register_fprime_ut()
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/external_instance/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/internal/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/internal_instance/")
3 changes: 3 additions & 0 deletions FppTest/state_machine/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# state_machine

Tests for FPP state machines.
20 changes: 20 additions & 0 deletions FppTest/state_machine/external_instance/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
set(SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/SmTest.cpp"
"${CMAKE_CURRENT_LIST_DIR}/SmTest.fpp"
"${CMAKE_CURRENT_LIST_DIR}/DeviceSm.cpp"
"${CMAKE_CURRENT_LIST_DIR}/HackSm.cpp"
)
set(MOD_DEPS Fw/Sm)

register_fprime_module()

set(UT_SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/SmTest.fpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/SmTestTestMain.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/SmTestTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/DeviceSm.cpp"
"${CMAKE_CURRENT_LIST_DIR}/HackSm.cpp"
)
set(UT_MOD_DEPS STest)
set(UT_AUTO_HELPERS ON)
register_fprime_ut()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <cstdio>

#include "FppTest/state_machine/SmTest.hpp"
#include "FppTest/state_machine/external_instance/SmTest.hpp"
#include "Fw/Types/Assert.hpp"

namespace FppTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <array>

#include "FppTest/state_machine/SmTestComponentAc.hpp"
#include "FppTest/state_machine/external_instance/SmTestComponentAc.hpp"
#include "Fw/Types/String.hpp"

namespace FppTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SmTestTestMain.cpp
// ----------------------------------------------------------------------

#include "FppTest/state_machine/test/ut/SmTestTester.hpp"
#include "FppTest/state_machine/external_instance/test/ut/SmTestTester.hpp"
#include "Fw/Test/UnitTest.hpp"
#include "STest/Random/Random.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <cstring>

#include "FppTest/state_machine/test/ut/SmTestTester.hpp"
#include "FppTest/state_machine/external_instance/test/ut/SmTestTester.hpp"
#include "Fw/Types/ExternalString.hpp"
#include "STest/Pick/Pick.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define FppTest_SmTest_Tester_HPP

#include "SmTestGTestBase.hpp"
#include "FppTest/state_machine/SmTest.hpp"
#include "FppTest/state_machine/external_instance/SmTest.hpp"
#include "STest/Pick/Pick.hpp"

namespace FppTest {
Expand Down
4 changes: 4 additions & 0 deletions FppTest/state_machine/internal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/choice/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/harness/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/initial/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/state/")
4 changes: 4 additions & 0 deletions FppTest/state_machine/internal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# state_machine/internal

Tests for internal FPP state machines, i.e., state machines whose behavior
is expressed in FPP.
82 changes: 82 additions & 0 deletions FppTest/state_machine/internal/choice/Basic.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// ======================================================================
//
// \title Basic.hpp
// \author R. Bocchino
// \brief Test class for basic state machine with a choice (implementation)
//
// \copyright
// Copyright 2024, by the California Institute of Technology.
// ALL RIGHTS RESERVED. United States Government Sponsorship
// acknowledged.
//
// ======================================================================

#include <gtest/gtest.h>

#include "FppTest/state_machine/internal/choice/Basic.hpp"
#include "STest/STest/Pick/Pick.hpp"

namespace FppTest {

namespace SmChoice {

Basic::Basic() : BasicStateMachineBase(), m_action_a_history(), m_action_b_history(), m_guard_g() {}

void Basic::action_a(Signal signal) {
this->m_action_a_history.push(signal);
}

void Basic::action_b(Signal signal) {
this->m_action_b_history.push(signal);
}

bool Basic::guard_g(Signal signal) const {
return this->m_guard_g.call(signal);
}

void Basic::testTrue() {
this->m_action_a_history.clear();
this->m_action_b_history.clear();
this->m_guard_g.reset();
this->m_guard_g.setReturnValue(true);
const FwEnumStoreType id = SmHarness::Pick::stateMachineId();
this->initBase(id);
ASSERT_EQ(this->m_id, id);
ASSERT_EQ(this->getState(), State::S1);
ASSERT_EQ(this->m_guard_g.getCallHistory().getSize(), 0);
ASSERT_EQ(this->m_action_a_history.getSize(), 0);
ASSERT_EQ(this->m_action_b_history.getSize(), 0);
this->sendSignal_s();
this->sendSignal_s();
ASSERT_EQ(this->m_guard_g.getCallHistory().getSize(), 1);
ASSERT_EQ(this->m_guard_g.getCallHistory().getItemAt(0), Signal::s);
ASSERT_EQ(this->m_action_a_history.getSize(), 1);
ASSERT_EQ(this->m_action_a_history.getItemAt(0), Signal::s);
ASSERT_EQ(this->m_action_b_history.getSize(), 0);
ASSERT_EQ(this->getState(), State::S2);
}

void Basic::testFalse() {
this->m_action_a_history.clear();
this->m_action_b_history.clear();
this->m_guard_g.reset();
const FwEnumStoreType id = SmHarness::Pick::stateMachineId();
this->initBase(id);
ASSERT_EQ(this->m_id, id);
ASSERT_EQ(this->getState(), State::S1);
ASSERT_EQ(this->m_guard_g.getCallHistory().getSize(), 0);
ASSERT_EQ(this->m_action_a_history.getSize(), 0);
ASSERT_EQ(this->m_action_b_history.getSize(), 0);
this->sendSignal_s();
this->sendSignal_s();
ASSERT_EQ(this->m_guard_g.getCallHistory().getSize(), 1);
ASSERT_EQ(this->m_guard_g.getCallHistory().getItemAt(0), Signal::s);
ASSERT_EQ(this->m_action_a_history.getSize(), 0);
ASSERT_EQ(this->m_action_b_history.getSize(), 1);
ASSERT_EQ(this->m_action_b_history.getItemAt(0), Signal::s);
ASSERT_EQ(this->getState(), State::S3);
}

} // namespace SmChoice

} // end namespace FppTest
9 changes: 9 additions & 0 deletions FppTest/state_machine/internal/choice/Basic.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module FppTest {

module SmChoice {

include "include/Basic.fppi"

}

}
69 changes: 69 additions & 0 deletions FppTest/state_machine/internal/choice/Basic.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// ======================================================================
//
// \title Basic.hpp
// \author R. Bocchino
// \brief Test class for basic state machine with a choice (header)
//
// \copyright
// Copyright 2024, by the California Institute of Technology.
// ALL RIGHTS RESERVED. United States Government Sponsorship
// acknowledged.
//
// ======================================================================

#ifndef FppTest_State_Basic_HPP
#define FppTest_State_Basic_HPP

#include "FppTest/state_machine/internal/choice/BasicStateMachineAc.hpp"
#include "FppTest/state_machine/internal/harness/Harness.hpp"

namespace FppTest {

namespace SmChoice {

//! A basic state machine with a choice
class Basic final : public BasicStateMachineBase {
public:
//! The history size
static constexpr FwSizeType historySize = 10;

public:
//! Constructor
Basic();

private:
//! Implementation of action a
void action_a(Signal signal //!< The signal
) final;

//! Implementation of action b
void action_b(Signal signal //!< The signal
) final;

//! Implementation of guard g
bool guard_g(Signal signal //!< The signal
) const final;

public:
//! Run the test with the true guard
void testTrue();

//! Run the test with the false guard
void testFalse();

private:
//! The history associated with action a
SmHarness::History<Signal, historySize> m_action_a_history;

//! The history associated with action b of Basic
SmHarness::History<Signal, historySize> m_action_b_history;

//! The guard g
SmHarness::NoArgGuard<Signal, historySize> m_guard_g;
};

} // namespace SmChoice

} // end namespace FppTest

#endif
87 changes: 87 additions & 0 deletions FppTest/state_machine/internal/choice/BasicU32.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// ======================================================================
//
// \title BasicU32.hpp
// \author R. Bocchino
// \brief Test class for basic state machine with a U32 choice (implementation)
//
// \copyright
// Copyright 2024, by the California Institute of Technology.
// ALL RIGHTS RESERVED. United States Government Sponsorship
// acknowledged.
//
// ======================================================================

#include <gtest/gtest.h>

#include "FppTest/state_machine/internal/choice/BasicU32.hpp"
#include "STest/STest/Pick/Pick.hpp"

namespace FppTest {

namespace SmChoice {

BasicU32::BasicU32() : BasicU32StateMachineBase(), m_action_a_history(), m_action_b_history(), m_guard_g() {}

void BasicU32::action_a(Signal signal, U32 value) {
this->m_action_a_history.push(signal, value);
}

void BasicU32::action_b(Signal signal) {
this->m_action_b_history.push(signal);
}

bool BasicU32::guard_g(Signal signal, U32 value) const {
return this->m_guard_g.call(signal, value);
}

void BasicU32::testTrue() {
this->m_action_a_history.clear();
this->m_action_b_history.clear();
this->m_guard_g.reset();
this->m_guard_g.setReturnValue(true);
const FwEnumStoreType id = SmHarness::Pick::stateMachineId();
this->initBase(id);
ASSERT_EQ(this->m_id, id);
ASSERT_EQ(this->getState(), State::S1);
ASSERT_EQ(this->m_guard_g.getCallHistory().getSize(), 0);
ASSERT_EQ(this->m_action_a_history.getSize(), 0);
ASSERT_EQ(this->m_action_b_history.getSize(), 0);
const U32 value = STest::Pick::any();
this->sendSignal_s(value);
this->sendSignal_s(value);
ASSERT_EQ(this->m_guard_g.getCallHistory().getSize(), 1);
ASSERT_EQ(this->m_guard_g.getCallHistory().getSignals().getItemAt(0), Signal::s);
ASSERT_EQ(this->m_guard_g.getCallHistory().getValues().getItemAt(0), value);
ASSERT_EQ(this->m_action_a_history.getSize(), 1);
ASSERT_EQ(this->m_action_a_history.getSignals().getItemAt(0), Signal::s);
ASSERT_EQ(this->m_action_a_history.getValues().getItemAt(0), value);
ASSERT_EQ(this->m_action_b_history.getSize(), 0);
ASSERT_EQ(this->getState(), State::S2);
}

void BasicU32::testFalse() {
this->m_action_a_history.clear();
this->m_action_b_history.clear();
this->m_guard_g.reset();
const FwEnumStoreType id = SmHarness::Pick::stateMachineId();
this->initBase(id);
ASSERT_EQ(this->m_id, id);
ASSERT_EQ(this->getState(), State::S1);
ASSERT_EQ(this->m_guard_g.getCallHistory().getSize(), 0);
ASSERT_EQ(this->m_action_a_history.getSize(), 0);
ASSERT_EQ(this->m_action_b_history.getSize(), 0);
const U32 value = STest::Pick::any();
this->sendSignal_s(value);
this->sendSignal_s(value);
ASSERT_EQ(this->m_guard_g.getCallHistory().getSize(), 1);
ASSERT_EQ(this->m_guard_g.getCallHistory().getSignals().getItemAt(0), Signal::s);
ASSERT_EQ(this->m_guard_g.getCallHistory().getValues().getItemAt(0), value);
ASSERT_EQ(this->m_action_a_history.getSize(), 0);
ASSERT_EQ(this->m_action_b_history.getSize(), 1);
ASSERT_EQ(this->m_action_b_history.getItemAt(0), Signal::s);
ASSERT_EQ(this->getState(), State::S3);
}

} // namespace SmChoice

} // end namespace FppTest
9 changes: 9 additions & 0 deletions FppTest/state_machine/internal/choice/BasicU32.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module FppTest {

module SmChoice {

include "include/BasicU32.fppi"

}

}
Loading
Loading