From f93a3ee2d672ee42e01c972cb3bf569d966cfcc1 Mon Sep 17 00:00:00 2001 From: Rob Bocchino Date: Thu, 4 Dec 2025 18:45:08 -0800 Subject: [PATCH] Revise top tests --- .../test/top/check-cpp-dir/check_topology.sh | 4 ++-- .../NestedNamespacesTopologyAc.ref.cpp | 0 .../NestedNamespacesTopologyAc.ref.hpp | 0 .../test/top/nested_namespaces/components.fpp | 15 +++++++++++++++ .../topology.fpp} | 16 ---------------- .../top/nested_namespaces/topology.ref.txt | 0 .../tools/fpp-to-cpp/test/top/update-ref.sh | 18 ++++++++++-------- 7 files changed, 27 insertions(+), 26 deletions(-) rename compiler/tools/fpp-to-cpp/test/top/{ => nested_namespaces}/NestedNamespacesTopologyAc.ref.cpp (100%) rename compiler/tools/fpp-to-cpp/test/top/{ => nested_namespaces}/NestedNamespacesTopologyAc.ref.hpp (100%) create mode 100644 compiler/tools/fpp-to-cpp/test/top/nested_namespaces/components.fpp rename compiler/tools/fpp-to-cpp/test/top/{nested_namespaces.fpp => nested_namespaces/topology.fpp} (51%) create mode 100644 compiler/tools/fpp-to-cpp/test/top/nested_namespaces/topology.ref.txt diff --git a/compiler/tools/fpp-to-cpp/test/top/check-cpp-dir/check_topology.sh b/compiler/tools/fpp-to-cpp/test/top/check-cpp-dir/check_topology.sh index aec35f255..ae66e41a9 100644 --- a/compiler/tools/fpp-to-cpp/test/top/check-cpp-dir/check_topology.sh +++ b/compiler/tools/fpp-to-cpp/test/top/check-cpp-dir/check_topology.sh @@ -1,7 +1,7 @@ check_topology() { - top_dir=$1 + src_dir=$1 top_name=$2 dir=`dirname $0` @@ -16,7 +16,7 @@ check_topology() echo ' generating C++' ( - cd $dir/../../$top_dir; + cd $dir/../../$src_dir; $FPP_TO_CPP -p $PWD -i $FPRIME_DEPS,../phases.fpp -d $dir components.fpp topology.fpp ) diff --git a/compiler/tools/fpp-to-cpp/test/top/NestedNamespacesTopologyAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/top/nested_namespaces/NestedNamespacesTopologyAc.ref.cpp similarity index 100% rename from compiler/tools/fpp-to-cpp/test/top/NestedNamespacesTopologyAc.ref.cpp rename to compiler/tools/fpp-to-cpp/test/top/nested_namespaces/NestedNamespacesTopologyAc.ref.cpp diff --git a/compiler/tools/fpp-to-cpp/test/top/NestedNamespacesTopologyAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/top/nested_namespaces/NestedNamespacesTopologyAc.ref.hpp similarity index 100% rename from compiler/tools/fpp-to-cpp/test/top/NestedNamespacesTopologyAc.ref.hpp rename to compiler/tools/fpp-to-cpp/test/top/nested_namespaces/NestedNamespacesTopologyAc.ref.hpp diff --git a/compiler/tools/fpp-to-cpp/test/top/nested_namespaces/components.fpp b/compiler/tools/fpp-to-cpp/test/top/nested_namespaces/components.fpp new file mode 100644 index 000000000..fb16d0761 --- /dev/null +++ b/compiler/tools/fpp-to-cpp/test/top/nested_namespaces/components.fpp @@ -0,0 +1,15 @@ +module M { + + module N { + + module O { + + passive component C { + + } + + } + + } + +} diff --git a/compiler/tools/fpp-to-cpp/test/top/nested_namespaces.fpp b/compiler/tools/fpp-to-cpp/test/top/nested_namespaces/topology.fpp similarity index 51% rename from compiler/tools/fpp-to-cpp/test/top/nested_namespaces.fpp rename to compiler/tools/fpp-to-cpp/test/top/nested_namespaces/topology.fpp index 5ba3845be..629a9a927 100644 --- a/compiler/tools/fpp-to-cpp/test/top/nested_namespaces.fpp +++ b/compiler/tools/fpp-to-cpp/test/top/nested_namespaces/topology.fpp @@ -1,19 +1,3 @@ -module M { - - module N { - - module O { - - passive component C { - - } - - } - - } - -} - instance c: M.N.O.C base id 0x100 module M { diff --git a/compiler/tools/fpp-to-cpp/test/top/nested_namespaces/topology.ref.txt b/compiler/tools/fpp-to-cpp/test/top/nested_namespaces/topology.ref.txt new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tools/fpp-to-cpp/test/top/update-ref.sh b/compiler/tools/fpp-to-cpp/test/top/update-ref.sh index 392c809bf..f90c4de7a 100644 --- a/compiler/tools/fpp-to-cpp/test/top/update-ref.sh +++ b/compiler/tools/fpp-to-cpp/test/top/update-ref.sh @@ -1,50 +1,49 @@ basic() { - cd basic + cd $TOP_DIR/basic update "-p $PWD -i $FPRIME_DEPS,../phases.fpp,components.fpp -n basic.names.txt" topology mv basic.names.txt basic.names.ref.txt move_cpp BasicTopology - cd .. } commands() { - cd commands + cd $TOP_DIR/commands update "-p $PWD -i $FPRIME_DEPS,../phases.fpp,components.fpp" topology move_cpp CommandsTopology - cd .. } health() { - cd health + cd $TOP_DIR/health update "-p $PWD -i $FPRIME_DEPS,../phases.fpp,components.fpp" topology move_cpp HealthTopology - cd .. } nested_namespaces() { - cd nested_namespaces + cd $TOP_DIR/nested_namespaces update "-p $PWD -i $FPRIME_DEPS,../phases.fpp,components.fpp" topology move_cpp NestedNamespacesTopology - cd .. } no_namespace() { + cd $TOP_DIR update "-p $PWD" no_namespace move_cpp NoNamespaceTopology } params() { + cd $TOP_DIR update "-i builtin.fpp -p $PWD" params move_cpp ParamsTopology } tlm_packets() { + cd $TOP_DIR update "-i builtin.fpp -p $PWD" tlm_packets move_cpp NoInstancesTopology move_cpp NoInstances_P1TlmPackets @@ -59,6 +58,7 @@ tlm_packets() typed_ports_active() { + cd $TOP_DIR src_dir=$PWD/typed_ports_active update "-d $src_dir -p $PWD,$src_dir -i $src_dir/components.fpp" \ $src_dir/topology @@ -67,6 +67,7 @@ typed_ports_active() typed_ports_passive() { + cd $TOP_DIR src_dir=$PWD/typed_ports_passive update "-d $src_dir -p $PWD,$src_dir -i $src_dir/components.fpp" \ $src_dir/topology @@ -75,6 +76,7 @@ typed_ports_passive() typed_ports_queued() { + cd $TOP_DIR src_dir=$PWD/typed_ports_queued update "-d $src_dir -p $PWD,$src_dir -i $src_dir/components.fpp" \ $src_dir/topology