Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions compiler/tools/fpp-to-cpp/test/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*TesterBase.hpp
default-tests.sh
default-update-ref.sh
names.txt

!*/include/*
!*.ref.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define TStringAliasAc_HPP

#include "Fw/Types/String.hpp"
#include "FwSizeStoreTypeAliasAc.hpp"
#include "config/FwSizeStoreTypeAliasAc.hpp"

using TString = Fw::String;

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

#include "Fw/Types/String.hpp"
#include "FwSizeStoreTypeAliasAc.hpp"
#include "config/FwSizeStoreTypeAliasAc.hpp"

using TStringSize = Fw::String;

Expand Down
3 changes: 0 additions & 3 deletions compiler/tools/fpp-to-cpp/test/alias/basic.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ struct Basic {
C: TString,
D: TStringSize
}

type FwSizeStoreType = U16
constant FW_FIXED_LENGTH_STRING_SIZE = 256
8 changes: 8 additions & 0 deletions compiler/tools/fpp-to-cpp/test/alias/fpp-options.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
test_dir=`(cd $PWD/..; pwd)`
fprime_dir=$test_dir/fprime
config_dir=$fprime_dir/config
platform_dir=$fprime_dir/Platform
fpp_options="
-p $PWD,$fprime_dir
-i $config_dir/FpConfig.fpp,$config_dir/FpConstants.fpp,$config_dir/ComCfg.fpp,$platform_dir/PlatformTypes.fpp
"
12 changes: 7 additions & 5 deletions compiler/tools/fpp-to-cpp/test/alias/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
. ./fpp-options.sh

abs_type()
{
run_test "-p $PWD" abs_type && \
run_test "$fpp_options" abs_type && \
diff_hpp AbsTypeAlias && \
diff_cpp AbsSerializable
}

basic()
{
run_test "-p $PWD" basic && \
run_test "$fpp_options" basic && \
diff_h_hpp TU32Alias && \
diff_h_hpp TF32Alias && \
diff_hpp TStringAlias && \
Expand All @@ -17,14 +19,14 @@ basic()

component()
{
run_test "-p $PWD" component && \
run_test "$fpp_options" component && \
diff_hpp C_XAlias && \
diff_cpp C_AArray
}

namespace()
{
run_test "-p $PWD" namespace && \
run_test "$fpp_options" namespace && \
diff_h_hpp SimpleCTypeAlias && \
diff_h_hpp SimpleCType2Alias && \
diff_hpp NamespacedAliasTypeAlias && \
Expand All @@ -34,7 +36,7 @@ namespace()

state_machine()
{
run_test "-p $PWD" state_machine && \
run_test "$fpp_options" state_machine && \
diff_hpp SM_XAlias && \
diff_cpp SM_AArray
}
12 changes: 7 additions & 5 deletions compiler/tools/fpp-to-cpp/test/alias/update-ref.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
. ./fpp-options.sh

abs_type()
{
update "-p $PWD" abs_type
update "$fpp_options" abs_type
move_hpp AbsTypeAlias
move_cpp AbsSerializable
}

basic()
{
update "-p $PWD" basic
update "$fpp_options" basic
move_h_hpp TF32Alias
move_h_hpp TU32Alias
move_hpp TStringAlias
Expand All @@ -17,13 +19,13 @@ basic()

component()
{
update "-p $PWD" component
update "$fpp_options" component
move_hpp C_XAlias && \
move_cpp C_AArray
}
namespace()
{
update "-p $PWD" namespace
update "$fpp_options" namespace
move_h_hpp SimpleCTypeAlias
move_h_hpp SimpleCType2Alias
move_hpp NamespacedAliasTypeAlias
Expand All @@ -33,7 +35,7 @@ namespace()

state_machine()
{
update "-p $PWD" state_machine
update "$fpp_options" state_machine
move_hpp SM_XAlias && \
move_cpp SM_AArray
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "Fw/Types/ExternalString.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
#include "FwSizeStoreTypeAliasAc.hpp"
#include "config/FwSizeStoreTypeAliasAc.hpp"

namespace M {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Fw/Types/ExternalString.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
#include "FwSizeStoreTypeAliasAc.hpp"
#include "config/FwSizeStoreTypeAliasAc.hpp"

//! An array of strings
class String1 :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Fw/Types/ExternalString.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
#include "FwSizeStoreTypeAliasAc.hpp"
#include "config/FwSizeStoreTypeAliasAc.hpp"

//! An array of strings with specified default value and format string
class String2 :
Expand Down
8 changes: 8 additions & 0 deletions compiler/tools/fpp-to-cpp/test/array/fpp-options.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
test_dir=`(cd $PWD/..; pwd)`
fprime_dir=$test_dir/fprime
config_dir=$fprime_dir/config
platform_dir=$fprime_dir/Platform
fpp_options="
-p $PWD,$fprime_dir
-i $config_dir/FpConfig.fpp,$config_dir/FpConstants.fpp,$config_dir/ComCfg.fpp,$platform_dir/PlatformTypes.fpp
"
24 changes: 13 additions & 11 deletions compiler/tools/fpp-to-cpp/test/array/run.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
. ./fpp-options.sh

abs_type()
{
run_test "-p $PWD" abs_type && \
run_test "$fpp_options" abs_type && \
diff_cpp AbsTypeArray
}

alias_type()
{
run_test "-p $PWD" alias_type && \
run_test "$fpp_options" alias_type && \
diff_cpp AliasTypeArray && \
diff -u ATAliasAc.ref.h ATAliasAc.h && \
diff -u ATAliasAc.ref.hpp ATAliasAc.hpp
}

component()
{
run_test "-p $PWD" component && \
run_test "$fpp_options" component && \
diff_cpp C_AArray && \
diff_cpp AArray
}

enum()
{
run_test "-p $PWD" enum && \
run_test "$fpp_options" enum && \
diff_cpp E1Enum && \
diff_cpp E2Enum && \
diff_cpp Enum1Array && \
Expand All @@ -30,19 +32,19 @@ enum()

header_path()
{
run_test "-p $PWD" "include/T.fpp header_path" header_path && \
run_test "$fpp_options" "include/T.fpp header_path" header_path && \
diff_cpp HeaderPathArray
}

large_size()
{
run_test "-p $PWD" large_size && \
run_test "$fpp_options" large_size && \
diff_cpp LargeSizeArray
}

primitive()
{
run_test "-p $PWD" primitive && \
run_test "$fpp_options" primitive && \
diff_cpp PrimitiveBoolArray && \
diff_cpp PrimitiveU8Array && \
diff_cpp PrimitiveU16Array && \
Expand All @@ -56,27 +58,27 @@ primitive()

single_element()
{
run_test "-p $PWD" single_element && \
run_test "$fpp_options" single_element && \
diff_cpp SingleElementArray
}

state_machine()
{
run_test "-p $PWD" state_machine && \
run_test "$fpp_options" state_machine && \
diff_cpp SM_AArray
}

string()
{
run_test "-p $PWD" string && \
run_test "$fpp_options" string && \
diff_cpp String1Array && \
diff_cpp String2Array && \
diff_cpp StringArrayArray
}

struct()
{
run_test "-p $PWD" struct && \
run_test "$fpp_options" struct && \
diff_cpp Struct1Array && \
diff_cpp Struct2Array && \
diff_cpp Struct3Array && \
Expand Down
3 changes: 0 additions & 3 deletions compiler/tools/fpp-to-cpp/test/array/string.fpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
type FwSizeStoreType = U16
constant FW_FIXED_LENGTH_STRING_SIZE = 256

@ An array of strings
array String1 = [3] string

Expand Down
3 changes: 0 additions & 3 deletions compiler/tools/fpp-to-cpp/test/array/struct.fpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
type FwSizeStoreType = U16
constant FW_FIXED_LENGTH_STRING_SIZE = 256

module M {
struct S1 {
mF32: F32
Expand Down
24 changes: 13 additions & 11 deletions compiler/tools/fpp-to-cpp/test/array/update-ref.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
. ./fpp-options.sh

abs_type()
{
update "-p $PWD" abs_type
update "$fpp_options" abs_type
move_cpp AbsTypeArray
}

alias_type()
{
update "-p $PWD" alias_type
update "$fpp_options" alias_type
move_cpp AliasTypeArray
mv ATAliasAc.hpp ATAliasAc.ref.hpp
mv ATAliasAc.h ATAliasAc.ref.h
}

component()
{
update "-p $PWD" component
update "$fpp_options" component
move_cpp C_AArray
move_cpp AArray
}

enum()
{
update "-p $PWD" enum
update "$fpp_options" enum
move_cpp E1Enum
move_cpp E2Enum
move_cpp Enum1Array
Expand All @@ -30,19 +32,19 @@ enum()

header_path()
{
update "-p $PWD" "include/T.fpp header_path" header_path
update "$fpp_options" "include/T.fpp header_path" header_path
move_cpp HeaderPathArray
}

large_size()
{
update "-p $PWD" large_size
update "$fpp_options" large_size
move_cpp LargeSizeArray
}

primitive()
{
update "-p $PWD" primitive
update "$fpp_options" primitive
move_cpp PrimitiveBoolArray
move_cpp PrimitiveU8Array
move_cpp PrimitiveU16Array
Expand All @@ -56,27 +58,27 @@ primitive()

single_element()
{
update "-p $PWD" single_element
update "$fpp_options" single_element
move_cpp SingleElementArray
}

state_machine()
{
update "-p $PWD" state_machine
update "$fpp_options" state_machine
move_cpp SM_AArray
}

string()
{
update "-p $PWD" string
update "$fpp_options" string
move_cpp String1Array
move_cpp String2Array
move_cpp StringArrayArray
}

struct()
{
update "-p $PWD" struct
update "$fpp_options" struct
move_cpp Struct1Array
move_cpp Struct2Array
move_cpp Struct3Array
Expand Down
7 changes: 7 additions & 0 deletions compiler/tools/fpp-to-cpp/test/constants/fpp-options.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test_dir=`(cd $PWD/..; pwd)`
fprime_dir=$test_dir/fprime
config_dir=$fprime_dir/config
platform_dir=$fprime_dir/Platform
fpp_import_option="
-i $config_dir/FpConfig.fpp,$config_dir/FpConstants.fpp,$config_dir/ComCfg.fpp,$platform_dir/PlatformTypes.fpp
"
Loading