diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 91993a98e1..f9a430040a 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -421,6 +421,7 @@ gnueabihf google googletest Gorang +gpg GPGGA GPINT gpio @@ -536,6 +537,7 @@ JSO jsonable kermit kevin +keyring kislyuk kitware Kooi @@ -905,6 +907,7 @@ sbb SBF SBINDIR sbt +scalasbt Scatterometer schem schematron @@ -1007,6 +1010,10 @@ subhistory subpage subseconds subtargets +subtopology +subtopologies +Subtopology +Subtopologies suppr suseconds SVCLOGFILE @@ -1202,4 +1209,8 @@ xsh xsltproc xxxx yacgen +yqq zmq + +mosa +aei \ No newline at end of file diff --git a/.github/workflows/ext-build-subtopology-ac.yml b/.github/workflows/ext-build-subtopology-ac.yml new file mode 100644 index 0000000000..51a6e76a6c --- /dev/null +++ b/.github/workflows/ext-build-subtopology-ac.yml @@ -0,0 +1,87 @@ +# Runs the subtopology autocoder tool to test the subtopology tool (https://github.com/mosa11aei/fprime-subtopology-tool) + +name: "Subtopology Autocoder Tool Test" + +on: + push: + branches: [ devel, release/** ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ devel, release/** ] + paths-ignore: + - 'docs/**' + - '**.md' + - '.github/actions/spelling/**' + - '.github/ISSUE_TEMPLATE/**' + +jobs: + get-branch: + name: "Get target branch" + uses: ./.github/workflows/reusable-get-pr-branch.yml + with: + target_repository: mosa11aei/fprime-rngLibrary + + subtopology-test: + name: "Subtopology Test" + runs-on: ubuntu-latest + needs: get-branch + steps: + - name: "Checkout target repository" + uses: actions/checkout@v4 + with: + submodules: false + repository: mosa11aei/fprime-rngLibrary + ref: ${{ needs.get-branch.outputs.target-branch }} + - name: "Overlay current F´ revision" + uses: actions/checkout@v4 + with: + submodules: true + path: ./fprime + fetch-depth: 0 + - uses: ./fprime/.github/actions/setup + with: + location: ./fprime + - name: "Verify CMake is installed" + run: | + sudo apt-get update + sudo apt-get install -y cmake + - name: "Get FPP" + uses: actions/checkout@v4 + with: + submodules: false + repository: nasa/fpp + path: ./fpp + ref: main + - name: "[fpp] Install sbt" + run: | + sudo apt-get update + sudo apt-get install -y apt-transport-https curl gnupg -yqq + echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list + echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list + curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo -H gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import + sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg + sudo apt-get update + sudo apt-get install -y sbt default-jre + - name: "Get location of fpp bin" + id: fpp-bin + run: | + echo "BIN_DIR=$(dirname $(which fpp-depend))" >> $GITHUB_OUTPUT + - name: "Install unreleased fpp" + run: | + chmod +x ./fpp/compiler/install + ./fpp/compiler/install ${{ steps.fpp-bin.outputs.BIN_DIR}} + - name: "Checkout subtopology tool" + uses: actions/checkout@v4 + with: + submodules: false + path: ./fprime-subtopology-tool + repository: mosa11aei/fprime-subtopology-tool + ref: main + - name: "Generate Subtopology Example Build Cache" + working-directory: ./MainDeployment + run: | + fprime-util generate -DFPRIME_SKIP_TOOLS_VERSION_CHECK=ON -DCMAKE_DEBUG_OUTPUT=ON + - name: "Build Example" + working-directory: ./MainDeployment + run: | + fprime-util build -v -j4 diff --git a/FppTest/struct/PrimitiveStructTest.cpp b/FppTest/struct/PrimitiveStructTest.cpp index a8875c66d7..7332410588 100644 --- a/FppTest/struct/PrimitiveStructTest.cpp +++ b/FppTest/struct/PrimitiveStructTest.cpp @@ -207,10 +207,5 @@ TEST_F(PrimitiveStructTest, ToString) { << "mF64 = " << std::fixed << testF64 << " )"; - // Truncate string output - char buf2Str[FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE]; - Fw::StringUtils::string_copy(buf2Str, buf2.str().c_str(), - FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE); - - ASSERT_STREQ(buf1.str().c_str(), buf2Str); + ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str()); } diff --git a/Fw/Buffer/Buffer.cpp b/Fw/Buffer/Buffer.cpp index 65ff479bfb..00729b5baa 100644 --- a/Fw/Buffer/Buffer.cpp +++ b/Fw/Buffer/Buffer.cpp @@ -168,16 +168,10 @@ Fw::SerializeStatus Buffer::deserialize(Fw::SerializeBufferBase& buffer) { return stat; } -#if FW_SERIALIZABLE_TO_STRING || BUILD_UT +#if FW_SERIALIZABLE_TO_STRING void Buffer::toString(Fw::StringBase& text) const { - static const char * formatString = "(data = %p, size = %u,context = %u)"; - char outputString[FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE]; - - (void)snprintf(outputString, FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE, formatString, this->m_bufferData, this->m_size, - this->m_context); - // Force NULL termination - outputString[FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE-1] = 0; - text = outputString; + static const char * formatString = "(data = %p, size = %u, context = %u)"; + text.format(formatString, this->m_bufferData, this->m_size, this->m_context); } #endif diff --git a/Fw/Cfg/ConfigCheck.cpp b/Fw/Cfg/ConfigCheck.cpp index 4eb0a69efd..832221712b 100644 --- a/Fw/Cfg/ConfigCheck.cpp +++ b/Fw/Cfg/ConfigCheck.cpp @@ -38,9 +38,15 @@ static_assert(FW_PARAM_STRING_MAX_SIZE <= FW_PARAM_BUFFER_MAX_SIZE, // Text logging needs the code generator for serializables to generate a stringified version of the // value. -static_assert((FW_ENABLE_TEXT_LOGGING == 0) || (FW_SERIALIZABLE_TO_STRING == 1), +static_assert((FW_ENABLE_TEXT_LOGGING == 0) || (FW_SERIALIZABLE_TO_STRING != 0), "FW_SERIALIZABLE_TO_STRING must be enabled to enable FW_ENABLE_TEXT_LOGGING"); +// Unit testing needs serializable strings +#ifdef BUILD_UT +static_assert(FW_SERIALIZABLE_TO_STRING != 0, + "FW_SERIALIZABLE_TO_STRING must be enabled for unit testing"); +#endif + static_assert(std::numeric_limits::max() == std::numeric_limits::max() && std::numeric_limits::min() == std::numeric_limits::min(), "FwBuffSizeType must be equivalent to FwExternalSizeType"); diff --git a/Fw/SerializableFile/test/TestSerializable/CMakeLists.txt b/Fw/SerializableFile/test/TestSerializable/CMakeLists.txt index 681efdcf53..60410093f4 100644 --- a/Fw/SerializableFile/test/TestSerializable/CMakeLists.txt +++ b/Fw/SerializableFile/test/TestSerializable/CMakeLists.txt @@ -6,7 +6,7 @@ # #### set(SOURCE_FILES - "${CMAKE_CURRENT_LIST_DIR}/TestSerializableAi.xml" + "${CMAKE_CURRENT_LIST_DIR}/TestSerializable.fpp" ) set(MOD_DEPS Fw/Cfg @@ -25,4 +25,4 @@ set_target_properties( ${MODULE_NAME} PROPERTIES EXCLUDE_FROM_ALL TRUE -) \ No newline at end of file +) diff --git a/Fw/SerializableFile/test/TestSerializable/TestSerializable.fpp b/Fw/SerializableFile/test/TestSerializable/TestSerializable.fpp new file mode 100644 index 0000000000..62b0f211e7 --- /dev/null +++ b/Fw/SerializableFile/test/TestSerializable/TestSerializable.fpp @@ -0,0 +1,10 @@ +module Fw { + + @ Test struct + struct Test { + element1: U32 @< Element 1 + element2: I8 @< Element 2 + element3: F64 @< Element 3 + } + +} diff --git a/Fw/SerializableFile/test/TestSerializable/TestSerializableAi.xml b/Fw/SerializableFile/test/TestSerializable/TestSerializableAi.xml deleted file mode 100644 index 18bde2d741..0000000000 --- a/Fw/SerializableFile/test/TestSerializable/TestSerializableAi.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - Test struct - - - - - - - diff --git a/config/FpConfig.h b/config/FpConfig.h index a280264cd3..192c46a4f6 100644 --- a/config/FpConfig.h +++ b/config/FpConfig.h @@ -233,14 +233,6 @@ typedef FwIndexType FwQueueSizeType; #endif #endif -// When querying an object as to an object-specific description, this specifies the size of the buffer to store the -// description. -#if FW_OBJECT_TO_STRING -#ifndef FW_OBJ_TO_STRING_BUFFER_SIZE -#define FW_OBJ_TO_STRING_BUFFER_SIZE 255 //!< Size of string storing toString() text -#endif -#endif - #if FW_OBJECT_REGISTRATION // For the simple object registry provided with the framework, this specifies how many objects the registry will store. #ifndef FW_OBJ_SIMPLE_REG_ENTRIES @@ -352,23 +344,6 @@ typedef FwIndexType FwQueueSizeType; #define FW_SERIALIZABLE_TO_STRING 1 //!< Indicates if autocoded serializables have toString() methods #endif -#if FW_SERIALIZABLE_TO_STRING -#ifndef FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE -#define FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE 255 //!< Size of string to store toString() string output -#endif -#endif - -// Define if arrays have toString() method. -#ifndef FW_ARRAY_TO_STRING -#define FW_ARRAY_TO_STRING 1 //!< Indicates if autocoded arrays have toString() methods -#endif - -#if FW_ARRAY_TO_STRING -#ifndef FW_ARRAY_TO_STRING_BUFFER_SIZE -#define FW_ARRAY_TO_STRING_BUFFER_SIZE 256 //!< Size of string to store toString() string output -#endif -#endif - // Some settings to enable AMPCS compatibility. This breaks regular ISF GUI compatibility #ifndef FW_AMPCS_COMPATIBLE #define FW_AMPCS_COMPATIBLE 0 //!< Whether or not JPL AMPCS ground system support is enabled. diff --git a/requirements.txt b/requirements.txt index 43a2ccc506..c3893fb9ab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,18 +18,18 @@ fprime-fpl-convert-xml==1.0.3 fprime-fpl-extract-xml==1.0.3 fprime-fpl-layout==1.0.3 fprime-fpl-write-pic==1.0.3 -fprime-fpp-check==2.1.0a11 -fprime-fpp-depend==2.1.0a11 -fprime-fpp-filenames==2.1.0a11 -fprime-fpp-format==2.1.0a11 -fprime-fpp-from-xml==2.1.0a11 -fprime-fpp-locate-defs==2.1.0a11 -fprime-fpp-locate-uses==2.1.0a11 -fprime-fpp-syntax==2.1.0a11 -fprime-fpp-to-cpp==2.1.0a11 -fprime-fpp-to-dict==2.1.0a11 -fprime-fpp-to-json==2.1.0a11 -fprime-fpp-to-xml==2.1.0a11 +fprime-fpp-check==2.1.0a12 +fprime-fpp-depend==2.1.0a12 +fprime-fpp-filenames==2.1.0a12 +fprime-fpp-format==2.1.0a12 +fprime-fpp-from-xml==2.1.0a12 +fprime-fpp-locate-defs==2.1.0a12 +fprime-fpp-locate-uses==2.1.0a12 +fprime-fpp-syntax==2.1.0a12 +fprime-fpp-to-cpp==2.1.0a12 +fprime-fpp-to-dict==2.1.0a12 +fprime-fpp-to-json==2.1.0a12 +fprime-fpp-to-xml==2.1.0a12 fprime-gds==3.4.3 fprime-tools==3.4.4 fprime-visual==1.0.2