Five consumer-feedback items, one milestone:
(1) Shared FTSC kludge plumbing in src/ma.kludge.pas
ParseKludgeLine, SplitKludgeBlob, BuildKludgePrefix,
BuildKludgeSuffix. Single source of truth for kludge naming,
INTL/FMPT/TOPT recognition, and the kludge.<lowername>
forward-compat passthrough. Eliminates the four near-identical
parsers MSG/PKT/Squish were carrying; JAM's FTSKLUDGE subfield
walking also routes through ParseKludgeLine so its unknown
kludges land in the same `kludge.<name>` slot as the others.
Bug fix folded in: the parser previously split kludge name from
value at the first ':' it found, which broke INTL (the value
contains an FTN address with ':' in it). Now picks the earlier
of space and colon, which handles both colon-form ("MSGID: foo")
and space-form ("INTL <to> <from>") kludges correctly.
(2) INTL / FMPT / TOPT slots in attributes registry
FSC-4008 cross-zone routing kludges every netmail tosser carries.
Added to JAM/Squish/MSG/PKT capability lists, parsed natively,
emitted on Write. Round-trip covered by tests.
(3) Unified `kludge.*` namespace for unknown FTSC kludges
Squish's `squish.kludge.<name>`, MSG's `msg.kludge.<name>`, and
PKT's `pkt.kludge.<name>` all collapse to plain `kludge.<name>`.
Consumers find passthrough kludges without switching on format.
JAM's numeric `jam.subfield.<id>` stays — those are JAM-specific
binary subfields, not FTSC-form kludges.
(4) `area` auto-populated from base.AreaTag on Read
When the caller passes AAreaTag to MessageBaseOpen (or sets
the AreaTag property post-construction), every successful
ReadMessage fills msg.Attributes['area'] unless the adapter
already populated it from on-disk data (e.g. PKT AREA kludge).
Saves echomail consumers from copying AreaTag into every
message attribute manually.
(5) TMsgAttributes multi-line helpers
GetList / SetList / AppendListItem on TMsgAttributes for the
multi-instance attributes (seen-by, path, via, trace) that
store with #13 between entries. Consumers don't have to roll
their own split/join.
Plus two PKT polish items from the same feedback round:
(6) ma.fmt.pkt.uni.DoWriteMessage now raises EMessageBase
explicitly with a pointer to the Native API instead of
silently returning False.
(7) TPktFile.CreateFromStream / CreateNewToStream constructors
accept any TStream (with optional ownership), so unit tests
that round-trip via TMemoryStream don't have to tempfile-dance.
FStream is now TStream; FOwnsStream gates Free in destructor.
TStringDynArray moved from ma.api.pas to ma.types.pas so both
the capabilities API and the new attribute helpers can share it.
Docs sweep:
- docs/attributes-registry.md: intl/fmpt/topt added; unknown-kludge
convention documented; multi-line helper section added.
- docs/architecture.md: ma.kludge layer surfaced; .uni adapter
registration gotcha called out loudly with the recommended
uses clause; area auto-pop documented.
- docs/API.md: TUniMessage section rewritten for Body+Attributes
model (was still pre-0.2); HWM API documented; PKT cheat-sheet
notes Native + CreateFromStream; tests/programs list updated.
- README.md: Building section flags the .uni gotcha first
thing; ma.kludge added to features.
tests/test_consumer_round1.pas: 7 new tests covering INTL/FMPT/
TOPT round-trip on JAM/Squish/MSG, area auto-pop, GetList/SetList/
AppendListItem, PKT raise, and TPktFile in-memory stream
round-trip.
Suite: 47/47 across 10 programs (test_consumer_round1 adds 7).
66 lines
1.5 KiB
Bash
Executable File
66 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# run_tests.sh - build and run every test against the native
|
|
# x86_64-linux target. Tests that don't need network / FS features
|
|
# that are linux-specific should also work on other native hosts,
|
|
# but we only run them here.
|
|
#
|
|
# Exits non-zero on any failure.
|
|
|
|
set -e
|
|
|
|
FPCNATIVE=/opt/fpcup/fpc/bin/x86_64-linux/fpc
|
|
TGT=x86_64-linux
|
|
|
|
cd "$(dirname "$0")"
|
|
mkdir -p "units/$TGT" "exe/$TGT"
|
|
|
|
compile() {
|
|
local src=$1
|
|
echo " compile $(basename "$src")"
|
|
"$FPCNATIVE" -Mobjfpc -Sh -Sgic \
|
|
-Fusrc -Fusrc/formats -Fusrc/wc_sdk -Futests \
|
|
-FUunits/"$TGT" -FEexe/"$TGT" \
|
|
"$src" >/tmp/ma_test_build.$$.log 2>&1 || {
|
|
cat /tmp/ma_test_build.$$.log
|
|
rm -f /tmp/ma_test_build.$$.log
|
|
exit 1
|
|
}
|
|
rm -f /tmp/ma_test_build.$$.log
|
|
}
|
|
|
|
run() {
|
|
local name=$1
|
|
echo " run $name"
|
|
rm -rf "/tmp/ma_$name"
|
|
"./exe/$TGT/$name"
|
|
}
|
|
|
|
echo "Building tests..."
|
|
compile tests/test_read.pas
|
|
compile tests/test_roundtrip.pas
|
|
compile tests/test_roundtrip_attrs.pas
|
|
compile tests/test_lock.pas
|
|
compile tests/test_batch.pas
|
|
compile tests/test_wildcat.pas
|
|
compile tests/test_write_existing.pas
|
|
compile tests/test_pack.pas
|
|
compile tests/test_hwm.pas
|
|
compile tests/test_consumer_round1.pas
|
|
|
|
echo
|
|
echo "Running tests..."
|
|
run test_read
|
|
run test_roundtrip
|
|
run test_roundtrip_attrs
|
|
run test_lock
|
|
run test_batch
|
|
run test_wildcat
|
|
run test_write_existing
|
|
run test_pack
|
|
run test_hwm
|
|
run test_consumer_round1
|
|
|
|
echo
|
|
echo "All tests passed."
|