diff --git a/compiler/tools/fpp-to-xml/test/array/ArrayEnum2ArrayAi.ref.xml b/compiler/tools/fpp-to-xml/test/array/ArrayEnum2ArrayAi.ref.xml index 0949b8aa1..090973b93 100644 --- a/compiler/tools/fpp-to-xml/test/array/ArrayEnum2ArrayAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/array/ArrayEnum2ArrayAi.ref.xml @@ -4,16 +4,16 @@ ArrayEnum2ArrayAi.xml Generated by fpp-to-xml ====================================================================== --> - + ArrayEnumE2EnumAi.xml - ArrayEnumE2 + M::ArrayEnumE2 5 %s - ArrayEnumE2::A - ArrayEnumE2::A - ArrayEnumE2::A - ArrayEnumE2::A - ArrayEnumE2::A + M::ArrayEnumE2::A + M::ArrayEnumE2::A + M::ArrayEnumE2::A + M::ArrayEnumE2::A + M::ArrayEnumE2::A diff --git a/compiler/tools/fpp-to-xml/test/array/ArrayEnumE2EnumAi.ref.xml b/compiler/tools/fpp-to-xml/test/array/ArrayEnumE2EnumAi.ref.xml index 7f189a341..cf2a8f49e 100644 --- a/compiler/tools/fpp-to-xml/test/array/ArrayEnumE2EnumAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/array/ArrayEnumE2EnumAi.ref.xml @@ -4,7 +4,7 @@ ArrayEnumE2EnumAi.xml Generated by fpp-to-xml ====================================================================== --> - + diff --git a/compiler/tools/fpp-to-xml/test/array/ArrayOK3ArrayAi.ref.xml b/compiler/tools/fpp-to-xml/test/array/ArrayOK3ArrayAi.ref.xml index 6fe9b489d..aa4cf2ad5 100644 --- a/compiler/tools/fpp-to-xml/test/array/ArrayOK3ArrayAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/array/ArrayOK3ArrayAi.ref.xml @@ -4,12 +4,12 @@ ArrayOK3ArrayAi.xml Generated by fpp-to-xml ====================================================================== --> - + string 2 %s "\"\\" - "abc\ndef" + "abc\ndef\n" diff --git a/compiler/tools/fpp-to-xml/test/array/ArrayOK4ArrayAi.ref.xml b/compiler/tools/fpp-to-xml/test/array/ArrayOK4ArrayAi.ref.xml index 48391efb1..b97ce4029 100644 --- a/compiler/tools/fpp-to-xml/test/array/ArrayOK4ArrayAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/array/ArrayOK4ArrayAi.ref.xml @@ -9,13 +9,13 @@ Generated by fpp-to-xml Array with array arg - ArrayOK3 + M2::ArrayOK3 4 %s - ArrayOK3("\"\\", "abc\ndef") - ArrayOK3("\"\\", "abc\ndef") - ArrayOK3("\"\\", "abc\ndef") - ArrayOK3("\"\\", "abc\ndef") + M2::ArrayOK3("\"\\", "abc\ndef\n") + M2::ArrayOK3("\"\\", "abc\ndef\n") + M2::ArrayOK3("\"\\", "abc\ndef\n") + M2::ArrayOK3("\"\\", "abc\ndef\n") diff --git a/compiler/tools/fpp-to-xml/test/array/ArrayOK5ArrayAi.ref.xml b/compiler/tools/fpp-to-xml/test/array/ArrayOK5ArrayAi.ref.xml index 7b0191b3a..66cf51d97 100644 --- a/compiler/tools/fpp-to-xml/test/array/ArrayOK5ArrayAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/array/ArrayOK5ArrayAi.ref.xml @@ -4,7 +4,7 @@ ArrayOK5ArrayAi.xml Generated by fpp-to-xml ====================================================================== --> - + T.hpp T 3 diff --git a/compiler/tools/fpp-to-xml/test/array/BuiltInTypeArrayAi.ref.xml b/compiler/tools/fpp-to-xml/test/array/BuiltInTypeArrayAi.ref.xml index bceec5d3d..8ba1f7a69 100644 --- a/compiler/tools/fpp-to-xml/test/array/BuiltInTypeArrayAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/array/BuiltInTypeArrayAi.ref.xml @@ -4,7 +4,7 @@ BuiltInTypeArrayAi.xml Generated by fpp-to-xml ====================================================================== --> - + FwOpcodeType 3 %s diff --git a/compiler/tools/fpp-to-xml/test/array/array_enum.fpp b/compiler/tools/fpp-to-xml/test/array/array_enum.fpp index 2956aaabc..824a63337 100644 --- a/compiler/tools/fpp-to-xml/test/array/array_enum.fpp +++ b/compiler/tools/fpp-to-xml/test/array/array_enum.fpp @@ -6,17 +6,19 @@ module M { Z = 9 } -} + enum ArrayEnumE2 { + A = 10 + B = 20 + C = 30 + D = 40 + } -enum ArrayEnumE2 { - A = 10 - B = 20 - C = 30 - D = 40 } module N { + array ArrayEnum1 = [2] M.ArrayEnumE1 @< Array with enum argument -} -array ArrayEnum2 = [5] ArrayEnumE2 + array ArrayEnum2 = [5] M.ArrayEnumE2 + +} diff --git a/compiler/tools/fpp-to-xml/test/array/array_ok.fpp b/compiler/tools/fpp-to-xml/test/array/array_ok.fpp index 2e0f9e524..6b099ec7b 100644 --- a/compiler/tools/fpp-to-xml/test/array/array_ok.fpp +++ b/compiler/tools/fpp-to-xml/test/array/array_ok.fpp @@ -3,17 +3,22 @@ module M1 { } module M2 { + array ArrayOK2 = [3] M1.ArrayOK1 -} -array ArrayOK3 = [2] string default ["\"\\", """ -abc -def -"""] + array ArrayOK3 = [2] string default ["\"\\", """ + abc + def + """] + +} module M3 { - array ArrayOK4 = [4] ArrayOK3 @< Array with array arg + array ArrayOK4 = [4] M2.ArrayOK3 @< Array with array arg } type T -array ArrayOK5 = [3] T + +module M4 { + array ArrayOK5 = [3] T +} diff --git a/compiler/tools/fpp-to-xml/test/array/built_in_type.fpp b/compiler/tools/fpp-to-xml/test/array/built_in_type.fpp index 45eea421e..2bdd6fd5e 100644 --- a/compiler/tools/fpp-to-xml/test/array/built_in_type.fpp +++ b/compiler/tools/fpp-to-xml/test/array/built_in_type.fpp @@ -1,3 +1,7 @@ type FwOpcodeType -array BuiltInType = [3] FwOpcodeType +module M { + + array BuiltInType = [3] FwOpcodeType + +} diff --git a/compiler/tools/fpp-to-xml/test/array/check-xml b/compiler/tools/fpp-to-xml/test/array/check-xml index 1e13235fc..d06c4ef9f 100755 --- a/compiler/tools/fpp-to-xml/test/array/check-xml +++ b/compiler/tools/fpp-to-xml/test/array/check-xml @@ -2,9 +2,18 @@ export COMPILER_ROOT=$PWD/../../../.. -# F Prime ode generation is broken for built-in types +skip_xml_names=" +ArrayStruct1Array +" + +for name in $skip_xml_names +do + export SKIP_XML_FOR_$name=1 +done + skip_cpp_names=" BuiltInTypeArray +ArrayStruct1Array " for name in $skip_cpp_names diff --git a/compiler/tools/fpp-to-xml/test/component/TypesComponentAi.ref.xml b/compiler/tools/fpp-to-xml/test/component/TypesComponentAi.ref.xml index 7cf0688f3..16e0d8e9c 100644 --- a/compiler/tools/fpp-to-xml/test/component/TypesComponentAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/component/TypesComponentAi.ref.xml @@ -4,6 +4,11 @@ TypesComponentAi.xml Generated by fpp-to-xml ====================================================================== --> - + + + Types_AArrayAi.xml + Types_EEnumAi.xml + Types_SSerializableAi.xml + Types_T.hpp diff --git a/compiler/tools/fpp-to-xml/test/component/Types_AArrayAi.ref.xml b/compiler/tools/fpp-to-xml/test/component/Types_AArrayAi.ref.xml index 916117eaf..1fd1870f6 100644 --- a/compiler/tools/fpp-to-xml/test/component/Types_AArrayAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/component/Types_AArrayAi.ref.xml @@ -4,7 +4,7 @@ Types_AArrayAi.xml Generated by fpp-to-xml ====================================================================== --> - + U32 3 %u diff --git a/compiler/tools/fpp-to-xml/test/component/Types_AUseArrayAi.ref.xml b/compiler/tools/fpp-to-xml/test/component/Types_AUseArrayAi.ref.xml index 2a14761f2..57163af7e 100644 --- a/compiler/tools/fpp-to-xml/test/component/Types_AUseArrayAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/component/Types_AUseArrayAi.ref.xml @@ -4,14 +4,14 @@ Types_AUseArrayAi.xml Generated by fpp-to-xml ====================================================================== --> - + Types_AArrayAi.xml - Types_A + M::Types_A 3 %s - Types_A(0, 0, 0) - Types_A(0, 0, 0) - Types_A(0, 0, 0) + M::Types_A(0, 0, 0) + M::Types_A(0, 0, 0) + M::Types_A(0, 0, 0) diff --git a/compiler/tools/fpp-to-xml/test/component/Types_EEnumAi.ref.xml b/compiler/tools/fpp-to-xml/test/component/Types_EEnumAi.ref.xml index 799de33e1..b9c46fda0 100644 --- a/compiler/tools/fpp-to-xml/test/component/Types_EEnumAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/component/Types_EEnumAi.ref.xml @@ -4,6 +4,6 @@ Types_EEnumAi.xml Generated by fpp-to-xml ====================================================================== --> - + diff --git a/compiler/tools/fpp-to-xml/test/component/Types_EUseArrayAi.ref.xml b/compiler/tools/fpp-to-xml/test/component/Types_EUseArrayAi.ref.xml index a2f805175..f6907a5e0 100644 --- a/compiler/tools/fpp-to-xml/test/component/Types_EUseArrayAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/component/Types_EUseArrayAi.ref.xml @@ -4,14 +4,14 @@ Types_EUseArrayAi.xml Generated by fpp-to-xml ====================================================================== --> - + Types_EEnumAi.xml - Types_E + M::Types_E 3 %s - Types_E::X - Types_E::X - Types_E::X + M::Types_E::X + M::Types_E::X + M::Types_E::X diff --git a/compiler/tools/fpp-to-xml/test/component/Types_SSerializableAi.ref.xml b/compiler/tools/fpp-to-xml/test/component/Types_SSerializableAi.ref.xml index 6c2cb3d55..301d6e7c3 100644 --- a/compiler/tools/fpp-to-xml/test/component/Types_SSerializableAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/component/Types_SSerializableAi.ref.xml @@ -4,7 +4,7 @@ Types_SSerializableAi.xml Generated by fpp-to-xml ====================================================================== --> - + 0 diff --git a/compiler/tools/fpp-to-xml/test/component/Types_SUseArrayAi.ref.xml b/compiler/tools/fpp-to-xml/test/component/Types_SUseArrayAi.ref.xml index 471f8d1af..8976518d0 100644 --- a/compiler/tools/fpp-to-xml/test/component/Types_SUseArrayAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/component/Types_SUseArrayAi.ref.xml @@ -4,14 +4,14 @@ Types_SUseArrayAi.xml Generated by fpp-to-xml ====================================================================== --> - + Types_SSerializableAi.xml - Types_S + M::Types_S 3 %s - Types_S(0, 0.0f) - Types_S(0, 0.0f) - Types_S(0, 0.0f) + M::Types_S(0, 0.0f) + M::Types_S(0, 0.0f) + M::Types_S(0, 0.0f) diff --git a/compiler/tools/fpp-to-xml/test/component/Types_T.hpp b/compiler/tools/fpp-to-xml/test/component/Types_T.hpp index ad571a515..f1e205f09 100644 --- a/compiler/tools/fpp-to-xml/test/component/Types_T.hpp +++ b/compiler/tools/fpp-to-xml/test/component/Types_T.hpp @@ -3,6 +3,8 @@ #include "Fw/Types/Serializable.hpp" +namespace M { + //! C++ interface for type Types_T //! This simulates a handwritten C++ serializable class //! that is represented as an abstract type in an FPP model. @@ -31,4 +33,6 @@ class Types_T : }; +} + #endif diff --git a/compiler/tools/fpp-to-xml/test/component/Types_TUseArrayAi.ref.xml b/compiler/tools/fpp-to-xml/test/component/Types_TUseArrayAi.ref.xml index dd6c94533..9f3842b8e 100644 --- a/compiler/tools/fpp-to-xml/test/component/Types_TUseArrayAi.ref.xml +++ b/compiler/tools/fpp-to-xml/test/component/Types_TUseArrayAi.ref.xml @@ -4,14 +4,14 @@ Types_TUseArrayAi.xml Generated by fpp-to-xml ====================================================================== --> - + Types_T.hpp - Types_T + M::Types_T 3 %s - Types_T() - Types_T() - Types_T() + M::Types_T() + M::Types_T() + M::Types_T() diff --git a/compiler/tools/fpp-to-xml/test/component/check-xml b/compiler/tools/fpp-to-xml/test/component/check-xml index bfccfe2fe..927164802 100755 --- a/compiler/tools/fpp-to-xml/test/component/check-xml +++ b/compiler/tools/fpp-to-xml/test/component/check-xml @@ -2,16 +2,24 @@ export COMPILER_ROOT=$PWD/../../../.. +skip_xml_names=" +" + +for name in $skip_xml_names +do + export SKIP_XML_FOR_$name=1 +done + skip_cpp_names=" -Commands -Events -Parameters -Telemetry +CommandsComponent +EventsComponent +ParametersComponent +TelemetryComponent " for name in $skip_cpp_names do - export SKIP_CPP_FOR_$name'Component'=1 + export SKIP_CPP_FOR_$name=1 done export FPRIME_GCC_FLAGS="-Wno-zero-length-array -Wno-vla-extension -Wno-sign-conversion" diff --git a/compiler/tools/fpp-to-xml/test/component/types.fpp b/compiler/tools/fpp-to-xml/test/component/types.fpp index 44ad2fc9d..da03a0710 100644 --- a/compiler/tools/fpp-to-xml/test/component/types.fpp +++ b/compiler/tools/fpp-to-xml/test/component/types.fpp @@ -1,16 +1,20 @@ -passive component Types { +module M { - array A = [3] U32 + passive component Types { - enum E { X } + array A = [3] U32 - struct S { x: U32, y: F32 } + enum E { X } - type T + struct S { x: U32, y: F32 } -} + type T + + array AUse = [3] Types.A + array EUse = [3] Types.E + array SUse = [3] Types.S + array TUse = [3] Types.T -array Types_AUse = [3] Types.A -array Types_EUse = [3] Types.E -array Types_SUse = [3] Types.S -array Types_TUse = [3] Types.T + } + +} diff --git a/compiler/tools/fpp-to-xml/test/scripts/check-xml.sh b/compiler/tools/fpp-to-xml/test/scripts/check-xml.sh index d5b64c776..4432bf306 100644 --- a/compiler/tools/fpp-to-xml/test/scripts/check-xml.sh +++ b/compiler/tools/fpp-to-xml/test/scripts/check-xml.sh @@ -43,22 +43,33 @@ for file in $files do dir=`dirname $file` base=`basename $file Ai.ref.xml` + # Skip XML to C++ in cases where the F Prime Python autocoder is + # broken + var='SKIP_XML_FOR_'$base + skip_xml_cmd='echo $'$var xml_file=$base'Ai.xml' - cd $dir - echo "compiling $xml_file" - $fprime_codegen $xml_file > /dev/null - cd $pwd + if test -z "`eval $skip_xml_cmd`" + then + cd $dir + echo "compiling $xml_file" + $fprime_codegen $xml_file > /dev/null + cd $pwd + else + echo "skipping $xml_file" + fi done for file in $files do dir=`dirname $file` base=`basename $file Ai.ref.xml` + # Skip C++ compilation in cases where F Prime code gen is broken, + # or it isn't feasible to set up the build var='SKIP_CPP_FOR_'$base skip_cpp_cmd='echo $'$var cpp_file=$base'Ac.cpp' if test -z "`eval $skip_cpp_cmd`" - then + then echo "compiling $cpp_file" cd $dir $fprime_gcc -I $test_dir -c $cpp_file