Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4345c74
Support readonly required-member constructors
jwillemsen Oct 27, 2026
cdddcce
Allow copies in readonly generated types
jwillemsen Oct 27, 2026
4f88fb1
Add optional C++17 constructor arguments
jwillemsen Oct 27, 2026
b149ad5
Fix optional constructor argument commas
jwillemsen Oct 27, 2026
4e40ee3
Fix readonly enum constructor CI regression
jwillemsen Oct 27, 2026
3b2624d
Traverse inherited readonly constructor arguments
jwillemsen Oct 27, 2026
23b6dba
Make optional argument conversion explicit
jwillemsen Oct 27, 2026
86ddbbe
Test ACE XML utilities through generated code
jwillemsen Oct 27, 2026
c988387
Reject temporary optional arguments and fix base forwarding
jwillemsen Oct 27, 2026
124921e
Run XSC runtime tests through ACE test runner
jwillemsen Oct 27, 2026
4f57433
Test rejection of negative unsigned XML values
jwillemsen Oct 27, 2026
93988b6
Generate a single OptionalArg rvalue rejection overload
jwillemsen Oct 27, 2026
c079aef
Fix XMLUtils test workspace setup
jwillemsen Oct 28, 2026
8707a10
Validate readonly required XML members
jwillemsen Oct 28, 2026
99c5ba7
Test negative zero in unsigned XML parsing
jwillemsen Oct 28, 2026
3da8b39
Cover XML Utils runtime edge cases
jwillemsen Oct 28, 2026
ad81765
Test XML ID assignment rollback
jwillemsen Oct 28, 2026
dfa62b1
Test duplicate XML ID registration failures
jwillemsen Oct 28, 2026
3274bf4
Default empty constructors
jwillemsen Oct 28, 2026
75372e3
Use ACE Xerces string utility
jwillemsen Oct 28, 2026
e06cce3
Modernize XSC traversal loops
jwillemsen Oct 28, 2026
d871047
Modernize XSC code and cardinality accessors
jwillemsen Oct 28, 2026
7a7c3e0
Test ACE XML utility edge cases
jwillemsen Oct 28, 2026
971c218
Allow implicit lvalue conversion for OptionalArg
jwillemsen Oct 28, 2026
93d9230
Test XMLSchema IDREF comparisons
jwillemsen Oct 28, 2026
2ae7ed4
Format required-member checks in generated code
jwillemsen Oct 28, 2026
62f0e05
Omit field constructors from read-only types
jwillemsen Oct 28, 2026
625051d
Test XSCRT subtree ID rollback
jwillemsen Oct 28, 2026
d709a7c
Use ACE XML Utils MPC base project
jwillemsen Oct 29, 2026
94afa3f
Use try_emplace in C++17 generated type info
jwillemsen Oct 29, 2026
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
33 changes: 2 additions & 31 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,28 +94,6 @@ jobs:
Pop-Location
}
shell: pwsh
- name: Run XSC validation rejection test
run: |
Push-Location ${env:XSC_ROOT}/Tests/Validation
try {
perl run_test.pl
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
finally {
Pop-Location
}
shell: pwsh
- name: Run read-only mode compatibility tests
run: |
Push-Location ${env:XSC_ROOT}/Tests/ReadOnly
try {
perl run_test.pl
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
finally {
Pop-Location
}
shell: pwsh
- name: Build XSC generated schema tests
run: |
Push-Location ${env:XSC_ROOT}/Tests
Expand All @@ -127,14 +105,7 @@ jobs:
Pop-Location
}
shell: pwsh
- name: Run DanceX11 generated-code test
- name: Run XSC tests
run: |
Push-Location ${env:XSC_ROOT}/Tests/DanceX11
try {
perl run_test.pl
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
finally {
Pop-Location
}
perl ${env:ACE_ROOT}/bin/auto_run_tests.pl -r ${env:XSC_ROOT} -l Tests/run_test.lst
shell: pwsh
87 changes: 87 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,90 @@ Release/
# Generated example output kept local.
/Examples/Recursive/recursive.cpp
/Examples/Recursive/recursive.hpp
/Tests/ReadOnly/readonly.cpp
/Tests/ReadOnly/readonly.hpp
/Examples/Reference/reference.cpp
/Examples/Reference/reference.hpp
/Tests/Abstract/abstract.cpp
/Tests/Abstract/abstract.hpp
/Tests/Anonymous/test.cpp
/Tests/Anonymous/test.hpp
/Tests/Chameleon/includer.cpp
/Tests/Chameleon/includer.hpp
/Tests/DanceX11/Basic_Deployment_Data.cpp
/Tests/DanceX11/Basic_Deployment_Data.hpp
/Tests/DanceX11/Basic_Deployment_Data.readonly.cpp
/Tests/DanceX11/Basic_Deployment_Data.readonly.hpp
/Tests/DanceX11/Deployment.cpp
/Tests/DanceX11/Deployment.hpp
/Tests/DanceX11/Deployment.readonly.cpp
/Tests/DanceX11/Deployment.readonly.hpp
/Tests/DanceX11/XMI.cpp
/Tests/DanceX11/XMI.hpp
/Tests/DanceX11/XMI.readonly.cpp
/Tests/DanceX11/XMI.readonly.hpp
/Tests/DanceX11/ccd.cpp
/Tests/DanceX11/ccd.hpp
/Tests/DanceX11/ccd.readonly.cpp
/Tests/DanceX11/ccd.readonly.hpp
/Tests/DanceX11/cdd.cpp
/Tests/DanceX11/cdd.hpp
/Tests/DanceX11/cdd.readonly.cpp
/Tests/DanceX11/cdd.readonly.hpp
/Tests/DanceX11/cdp.cpp
/Tests/DanceX11/cdp.hpp
/Tests/DanceX11/cdp.readonly.cpp
/Tests/DanceX11/cdp.readonly.hpp
/Tests/DanceX11/cid.cpp
/Tests/DanceX11/cid.hpp
/Tests/DanceX11/cid.readonly.cpp
/Tests/DanceX11/cid.readonly.hpp
/Tests/DanceX11/cpd.cpp
/Tests/DanceX11/cpd.hpp
/Tests/DanceX11/cpd.readonly.cpp
/Tests/DanceX11/cpd.readonly.hpp
/Tests/DanceX11/iad.cpp
/Tests/DanceX11/iad.hpp
/Tests/DanceX11/iad.readonly.cpp
/Tests/DanceX11/iad.readonly.hpp
/Tests/DanceX11/pcd.cpp
/Tests/DanceX11/pcd.hpp
/Tests/DanceX11/pcd.readonly.cpp
/Tests/DanceX11/pcd.readonly.hpp
/Tests/DanceX11/toplevel.cpp
/Tests/DanceX11/toplevel.hpp
/Tests/DanceX11/toplevel.readonly.cpp
/Tests/DanceX11/toplevel.readonly.hpp
/Tests/DateTime/datetime.cpp
/Tests/DateTime/datetime.hpp
/Tests/Escape/test.cpp
/Tests/Escape/test.hpp
/Tests/Group/test.cpp
/Tests/Group/test.hpp
/Tests/Import/importee.cpp
/Tests/Import/importee.hpp
/Tests/Import/importer.cpp
/Tests/Import/importer.hpp
/Tests/Include/includee.cpp
/Tests/Include/includee.hpp
/Tests/Include/includer.cpp
/Tests/Include/includer.hpp
/Tests/NoNamespace/test.cpp
/Tests/NoNamespace/test.hpp
/Tests/ReadOnly/enum_constructor.cpp
/Tests/ReadOnly/enum_constructor.hpp
/Tests/ReadOnly/readonly.cpp03.cpp
/Tests/ReadOnly/readonly.cpp03.hpp
/Tests/SequenceAccessorCollision/test.cpp
/Tests/SequenceAccessorCollision/test.hpp
/Tests/XMLUtils/GNUmakefile*
/Tests/XMLUtils/generated_types.cpp
/Tests/XMLUtils/generated_types.hpp
/Tests/XMLUtils/runtime
/Tests/XMLUtils/xscrt_registration
/abstract.cpp
/abstract.hpp
/dds_qos.cpp
/dds_qos.hpp
/test.cpp
/test.hpp
2 changes: 1 addition & 1 deletion CCF/utility/Utility/Introspection/TypeInfo.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace Utility
inline void TypeInfo::
add_base (Access::Value access, bool virtual_base, TypeInfo const& ti)
{
base_.push_back (BaseInfo (access, virtual_base, ti));
base_.emplace_back (access, virtual_base, ti);
}
}
}
2 changes: 1 addition & 1 deletion MPC/config/xsc_utils.mpb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project : xsc_common {
project : xsc_common, ace_xml_utils {
after += XSC_Utils
libs += XSC_Utils
}
19 changes: 19 additions & 0 deletions Tests/DanceX11/dancex11.mpc
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,22 @@ project (xsc_test_dancex11_optional_copy): xscrt {
optional_copy.cpp
}
}

project (xsc_test_dancex11_required_members): xscrt, ace_xml_utils {
after += xsc_test_dancex11_readonly

Source_Files {
Basic_Deployment_Data.readonly.cpp
Deployment.readonly.cpp
XMI.readonly.cpp
ccd.readonly.cpp
cdd.readonly.cpp
cdp.readonly.cpp
cid.readonly.cpp
cpd.readonly.cpp
iad.readonly.cpp
pcd.readonly.cpp
toplevel.readonly.cpp
required_members.cpp
}
}
29 changes: 29 additions & 0 deletions Tests/DanceX11/optional_copy.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
#include "Basic_Deployment_Data.hpp"
#include <type_traits>

static_assert (!std::is_convertible_v<::XMLSchema::IDREF<char>,
::XSCRT::OptionalArg<::XMLSchema::IDREF<char>>>);
static_assert (std::is_convertible_v<::XMLSchema::IDREF<char> const&,
::XSCRT::OptionalArg<::XMLSchema::IDREF<char>>>);
static_assert (std::is_constructible_v<::XSCRT::OptionalArg<::XMLSchema::IDREF<char>>,
::XMLSchema::IDREF<char> const&>);
static_assert (!std::is_constructible_v<::XSCRT::OptionalArg<::XMLSchema::IDREF<char>>,
::XMLSchema::IDREF<char>&&>);
static_assert (!std::is_constructible_v<::XSCRT::OptionalArg<::XMLSchema::IDREF<char>>,
::XMLSchema::IDREF<char> const&&>);

int
main ()
Expand All @@ -16,5 +28,22 @@ main ()
Deployment::IdRef source;
destination = source;

XMLSchema::IDREF<char> idref ("urn:idref");
XMLSchema::IDREF<char> same_idref ("urn:idref");
XMLSchema::IDREF<char> different_idref ("urn:other");
if (idref != same_idref || idref == different_idref)
return 1;

Deployment::IdRef constructed (
std::nullopt, ::XSCRT::OptionalArg<::XMLSchema::IDREF<char>> (idref));
if (constructed.idref_if_set () == nullptr)
return 1;

Deployment::DataValue::short_container_type shorts;
shorts.emplace_back (1);
Deployment::DataValue sequence_constructed (shorts);
if (sequence_constructed._cxx_short ().size () != 1)
return 1;

return destination.href_if_set () != nullptr;
}
16 changes: 15 additions & 1 deletion Tests/DanceX11/readonly_api.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "toplevel.readonly.hpp"
#include "Basic_Deployment_Data.readonly.hpp"

#include <list>
#include <type_traits>
Expand All @@ -7,13 +8,21 @@
namespace
{
using TopLevel = Deployment::TopLevelPackageDescription;
using DataValue = Deployment::DataValue;
using DataType = Deployment::DataType;
using Any = Deployment::Any;
using ExternalReferenceEndpoint = Deployment::ExternalReferenceEndpoint;
using Package = Deployment::PackageConfiguration;
using Packages = TopLevel::package_container_type;
using LocalityKind = Deployment::PlanLocalityKind;
using PlanLocality = Deployment::PlanLocality;

static_assert (std::is_same_v<Packages, std::list<Package>>);
static_assert (!std::is_copy_constructible_v<Package>);
static_assert (std::is_default_constructible_v<DataValue>);
static_assert (std::is_copy_constructible_v<DataValue>);
static_assert (!std::is_move_constructible_v<DataValue>);
static_assert (std::is_copy_constructible_v<DataType>);
static_assert (std::is_copy_constructible_v<Package>);
static_assert (!std::is_move_constructible_v<Package>);
static_assert (std::is_same_v<decltype (*std::declval<Packages const&> ().begin ()),
Package const&>);
Expand All @@ -22,4 +31,9 @@ namespace
static_assert (std::is_same_v<decltype (std::declval<PlanLocality const&> ().constraint () ==
LocalityKind::SameProcess),
bool>);

static_assert (!std::is_constructible_v<Any, DataType const&, DataValue const&>);
static_assert (!std::is_constructible_v<ExternalReferenceEndpoint,
::XMLSchema::string<char> const&,
::XMLSchema::boolean const&>);
}
57 changes: 57 additions & 0 deletions Tests/DanceX11/required_members.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include "iad.readonly.hpp"

#include <ace/XML_Utils/XML_Helper.h>
#include <ace/XML_Utils/XercesString.h>
#include <ace/XML_Utils/XSCRT/XML.hpp>

#include <stdexcept>

namespace
{
bool
rejected (bool include_name, bool include_referenced_artifact)
{
XML::XML_Helper<> helper;
XERCES_CPP_NAMESPACE::DOMDocument* const document = helper.create_dom (
ACE_TEXT ("NamedImplementationArtifact"),
ACE_TEXT ("http://www.omg.org/Deployment"));
XERCES_CPP_NAMESPACE::DOMElement* const root (document->getDocumentElement ());

if (include_name)
{
XERCES_CPP_NAMESPACE::DOMElement* const name = document->createElementNS (
static_cast<XMLCh const*> (XML::XStr ("http://www.omg.org/Deployment")),
static_cast<XMLCh const*> (XML::XStr ("name")));
name->appendChild (document->createTextNode (
static_cast<XMLCh const*> (XML::XStr ("artifact"))));
root->appendChild (name);
}

if (include_referenced_artifact)
{
root->appendChild (document->createElementNS (
static_cast<XMLCh const*> (XML::XStr ("http://www.omg.org/Deployment")),
static_cast<XMLCh const*> (XML::XStr ("referencedArtifact"))));
}

bool missing_member_rejected (false);
try
{
XSCRT::XML::Element<char> const element (root);
Deployment::NamedImplementationArtifact value (element);
}
catch (std::invalid_argument const&)
{
missing_member_rejected = true;
}

document->release ();
return missing_member_rejected;
}
}

int
main ()
{
return rejected (false, true) && rejected (true, false) ? 0 : 1;
}
22 changes: 22 additions & 0 deletions Tests/DanceX11/run_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,26 @@
print "DanceX11 generated copy assignment passed\n";
}

my $required_members_test = "$ENV{XSC_ROOT}/Tests/DanceX11/required_members";
unless (-x $required_members_test) {
die "ERROR: Cannot find executable $required_members_test\n";
}

$target->AddLibPath ("$ENV{XSC_ROOT}/Tests/DanceX11");
my $required_members_process = $target->CreateProcess ($required_members_test);
my $required_members_result = $required_members_process->SpawnWaitKill (
$target->ProcessStartWaitInterval ());

if ($required_members_result == -1) {
print STDERR "ERROR: DanceX11 required-member test could not be started or timed out\n";
$status = 1;
}
elsif ($required_members_result != 0) {
print STDERR "ERROR: read-only parser accepted a missing required child element\n";
$status = 1;
}
else {
print "DanceX11 generated required-member checks passed\n";
}

exit $status;
20 changes: 20 additions & 0 deletions Tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# XSC tests

The generated-code tests are compiled through `Tests.mwc`. From the XSC repository
root, set the environment variables for your ACE/TAO and MPC checkouts, then run
the full test suite after building XSC and its ACE dependencies:

```sh
export XSC_ROOT="$(pwd)"
export DOC_ROOT="/path/to/ACE_TAO"
export ACE_ROOT="$DOC_ROOT/ACE"
export TAO_ROOT="$DOC_ROOT/TAO"
export MPC_ROOT="/path/to/MPC"
export LD_LIBRARY_PATH="$XSC_ROOT/XSC/utils:$XSC_ROOT/lib:$ACE_ROOT/lib:$LD_LIBRARY_PATH"
perl "$ACE_ROOT/bin/mwc.pl" -type gnuace Tests/Tests.mwc -workers 4
make -j8 -C Tests
perl "$ACE_ROOT/bin/auto_run_tests.pl" -r "$XSC_ROOT" -l Tests/run_test.lst
```

`run_test.lst` lists the runtime test drivers. The other test directories contain
compile-time generated-code and API checks, which run as part of the MPC build.
17 changes: 17 additions & 0 deletions Tests/ReadOnly/enum_constructor.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="ReadOnlyKind">
<xs:restriction base="xs:string">
<xs:enumeration value="first"/>
<xs:enumeration value="second"/>
</xs:restriction>
</xs:simpleType>

<xs:complexType name="ReadOnlyKindWithOptionalAttribute">
<xs:simpleContent>
<xs:extension base="ReadOnlyKind">
<xs:attribute name="label" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:schema>
5 changes: 5 additions & 0 deletions Tests/ReadOnly/enum_constructor_api.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "enum_constructor.hpp"

#include <type_traits>

static_assert (!std::is_constructible_v<ReadOnlyKindWithOptionalAttribute, ReadOnlyKind const&>);
Loading