Merge remote-tracking branch 'origin/topic/vern/CPP-when-capture-naming'

* origin/topic/vern/CPP-when-capture-naming:
  fixed "-O gen-C++" naming of "when" captures to avoid ambiguities due to inlining
  Simplified & made more robust maintenance helper script for "-O gen-C++" testing
  "-a cpp" baseline updates to reflect recent BTest changes
This commit is contained in:
Arne Welzel 2024-10-29 13:50:05 +01:00
commit 821218e7b2
6 changed files with 25 additions and 13 deletions

View file

@ -133,15 +133,13 @@ string CPPCompile::LocalName(const ID* l) const { return Canonicalize(trim_name(
string CPPCompile::CaptureName(const ID* c) const {
// We want to strip both the module and any inlining appendage.
auto n = Canonicalize(trim_name(c).c_str());
auto tn = trim_name(c);
auto appendage = n.find(".");
if ( appendage != string::npos ) {
n.erase(n.begin() + appendage, n.end());
n.push_back('_');
}
auto appendage = tn.find(".");
if ( appendage != string::npos )
tn.erase(tn.begin() + appendage, tn.end());
return n;
return Canonicalize(tn.c_str());
}
string CPPCompile::Canonicalize(const char* name) const {

View file

@ -1,10 +1,9 @@
#! /bin/sh
find ../testing/btest -type f |
grep -E -v 'Baseline|\.tmp|__load__' |
grep -E '\.(zeek|test)$' |
sort |
xargs grep -E -l '@TEST' |
xargs grep -E -l '^[ ]*(event|print)' |
xargs grep -E -c 'REQUIRES.*CPP.*((!=.*1)|(==.*0))' |
grep ':0$' |
sed 's,:0,,'
sed 's,:0,,' |
sort