From 49216fdc5054fb0c0b6745f45da963c51492be01 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 31 Oct 2026 12:02:18 +0000 Subject: [PATCH 1/5] [tests] Move cxx_standard to test/tools Paves the way for more tools tests --- .github/workflows/test.yml | 12 ++++++++---- test/{ => tools}/cxx_standard/Build.xml | 0 test/{ => tools}/cxx_standard/Build_legacy.xml | 0 test/{ => tools}/cxx_standard/Build_section.xml | 0 test/{ => tools}/cxx_standard/c11.c | 0 test/{ => tools}/cxx_standard/c17.c | 0 test/{ => tools}/cxx_standard/cxx14.cpp | 0 test/{ => tools}/cxx_standard/main.cpp | 0 8 files changed, 8 insertions(+), 4 deletions(-) rename test/{ => tools}/cxx_standard/Build.xml (100%) rename test/{ => tools}/cxx_standard/Build_legacy.xml (100%) rename test/{ => tools}/cxx_standard/Build_section.xml (100%) rename test/{ => tools}/cxx_standard/c11.c (100%) rename test/{ => tools}/cxx_standard/c17.c (100%) rename test/{ => tools}/cxx_standard/cxx14.cpp (100%) rename test/{ => tools}/cxx_standard/main.cpp (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 25d241f7b..d65e0ebfc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -130,12 +130,16 @@ jobs: - name: build tool if: ${{ !cancelled() && steps.setup.outcome == 'success' }} - working-directory: test/cxx_standard + working-directory: test/tools run: | set -x - for xml in *.xml; do - haxelib run hxcpp $xml - haxelib run hxcpp $xml clean + for dir in */; do + pushd $dir + for xml in *.xml; do + haxelib run hxcpp $xml + haxelib run hxcpp $xml clean + done + popd done cppia: diff --git a/test/cxx_standard/Build.xml b/test/tools/cxx_standard/Build.xml similarity index 100% rename from test/cxx_standard/Build.xml rename to test/tools/cxx_standard/Build.xml diff --git a/test/cxx_standard/Build_legacy.xml b/test/tools/cxx_standard/Build_legacy.xml similarity index 100% rename from test/cxx_standard/Build_legacy.xml rename to test/tools/cxx_standard/Build_legacy.xml diff --git a/test/cxx_standard/Build_section.xml b/test/tools/cxx_standard/Build_section.xml similarity index 100% rename from test/cxx_standard/Build_section.xml rename to test/tools/cxx_standard/Build_section.xml diff --git a/test/cxx_standard/c11.c b/test/tools/cxx_standard/c11.c similarity index 100% rename from test/cxx_standard/c11.c rename to test/tools/cxx_standard/c11.c diff --git a/test/cxx_standard/c17.c b/test/tools/cxx_standard/c17.c similarity index 100% rename from test/cxx_standard/c17.c rename to test/tools/cxx_standard/c17.c diff --git a/test/cxx_standard/cxx14.cpp b/test/tools/cxx_standard/cxx14.cpp similarity index 100% rename from test/cxx_standard/cxx14.cpp rename to test/tools/cxx_standard/cxx14.cpp diff --git a/test/cxx_standard/main.cpp b/test/tools/cxx_standard/main.cpp similarity index 100% rename from test/cxx_standard/main.cpp rename to test/tools/cxx_standard/main.cpp From dc7a20cde03871fd2322f6edb3eafca3032af18d Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 31 Oct 2026 12:04:52 +0000 Subject: [PATCH 2/5] Update gitignore for moved cxx_standard tests --- .gitignore | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ae80f7d57..acb17d1d8 100644 --- a/.gitignore +++ b/.gitignore @@ -29,10 +29,7 @@ hxcpp.n .vscode -test/cxx_standard/main -test/cxx_standard/main.hash -test/cxx_standard/main.exe -test/cxx_standard/main.exe.hash +test/tools/cxx_standard/main* # Created by https://www.toptal.com/developers/gitignore/api/visualstudio # Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio From 6ea1739c32fb46f9a8b013e416867f5de80d60de Mon Sep 17 00:00:00 2001 From: Chris Speciale <26172437+dimensionscape@users.noreply.github.com> Date: Mon, 12 Oct 2026 06:04:57 -0400 Subject: [PATCH 3/5] Track Options.txt changes in hxcpp libraries The libraries may need to be recompiled as some flags in Options.txt affect whether functions in hxcpp.h are inline. In the case of hxcpp_regexp, hxcpp_smart_strings affects whether it will use pcre2-16 symbols. --- src/hx/libs/mysql/Build.xml | 1 + src/hx/libs/regexp/Build.xml | 1 + src/hx/libs/sqlite/Build.xml | 1 + src/hx/libs/ssl/Build.xml | 1 + src/hx/libs/std/Build.xml | 1 + src/hx/zip/Build.xml | 3 ++- src/hx/zip/zlib/Build.xml | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/hx/libs/mysql/Build.xml b/src/hx/libs/mysql/Build.xml index 76e497850..b1463cbac 100644 --- a/src/hx/libs/mysql/Build.xml +++ b/src/hx/libs/mysql/Build.xml @@ -1,6 +1,7 @@ + diff --git a/src/hx/libs/regexp/Build.xml b/src/hx/libs/regexp/Build.xml index 46a1fba14..30e3952ed 100644 --- a/src/hx/libs/regexp/Build.xml +++ b/src/hx/libs/regexp/Build.xml @@ -27,6 +27,7 @@ + diff --git a/src/hx/libs/sqlite/Build.xml b/src/hx/libs/sqlite/Build.xml index b17ca5420..cbbe8f52c 100644 --- a/src/hx/libs/sqlite/Build.xml +++ b/src/hx/libs/sqlite/Build.xml @@ -5,6 +5,7 @@ + diff --git a/src/hx/libs/ssl/Build.xml b/src/hx/libs/ssl/Build.xml index 2240f564a..ef0e89362 100644 --- a/src/hx/libs/ssl/Build.xml +++ b/src/hx/libs/ssl/Build.xml @@ -5,6 +5,7 @@ + diff --git a/src/hx/libs/std/Build.xml b/src/hx/libs/std/Build.xml index f18ee01bb..785f3bee5 100644 --- a/src/hx/libs/std/Build.xml +++ b/src/hx/libs/std/Build.xml @@ -3,6 +3,7 @@ + diff --git a/src/hx/zip/Build.xml b/src/hx/zip/Build.xml index 0cf31265b..2a7e804c6 100644 --- a/src/hx/zip/Build.xml +++ b/src/hx/zip/Build.xml @@ -8,6 +8,7 @@ + @@ -19,4 +20,4 @@ - \ No newline at end of file + diff --git a/src/hx/zip/zlib/Build.xml b/src/hx/zip/zlib/Build.xml index 6289ab59f..131dfd7dd 100644 --- a/src/hx/zip/zlib/Build.xml +++ b/src/hx/zip/zlib/Build.xml @@ -31,6 +31,7 @@ + From b30097c66efd84b9031f97833d8c3e424d63e8e7 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 31 Oct 2026 16:19:11 +0000 Subject: [PATCH 4/5] Use include instead of import for zip xmls import changes the relative directory, which means Options.txt is no longer relative to the original Build.xml. include doesn't change it, so we can use it instead. --- src/hx/libs/zlib/Build.xml | 4 ++-- src/hx/zip/Build.xml | 2 +- src/hx/zip/zlib/Build.xml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hx/libs/zlib/Build.xml b/src/hx/libs/zlib/Build.xml index ab0b3ee41..2ef48e7a3 100644 --- a/src/hx/libs/zlib/Build.xml +++ b/src/hx/libs/zlib/Build.xml @@ -2,6 +2,6 @@ - + - \ No newline at end of file + diff --git a/src/hx/zip/Build.xml b/src/hx/zip/Build.xml index 2a7e804c6..dad228d6e 100644 --- a/src/hx/zip/Build.xml +++ b/src/hx/zip/Build.xml @@ -5,7 +5,7 @@ - + diff --git a/src/hx/zip/zlib/Build.xml b/src/hx/zip/zlib/Build.xml index 131dfd7dd..40a4337ee 100644 --- a/src/hx/zip/zlib/Build.xml +++ b/src/hx/zip/zlib/Build.xml @@ -43,8 +43,8 @@ - - + + From 628e892f9dbb7b141486ac2f9cfa03e837fae98b Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 31 Oct 2026 16:32:07 +0000 Subject: [PATCH 5/5] [tests] Check RegExp rebuild without smart strings Previously, compiling hxcpp_regexp once with smart strings and again without would lead to a stale RegExp.o that still referenced pcre2-16 symbols. This test ensures it is now working properly, since hxcpp_regexp now tracks Options.txt changes. --- .github/workflows/test.yml | 5 +++++ test/tools/rebuild-no-smart-strings/Main.hx | 3 +++ .../rebuild-no-smart-strings/build-0-smart-strings.hxml | 2 ++ .../rebuild-no-smart-strings/build-1-no-smart-strings.hxml | 3 +++ 4 files changed, 13 insertions(+) create mode 100644 test/tools/rebuild-no-smart-strings/Main.hx create mode 100644 test/tools/rebuild-no-smart-strings/build-0-smart-strings.hxml create mode 100644 test/tools/rebuild-no-smart-strings/build-1-no-smart-strings.hxml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d65e0ebfc..0aa88197b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -133,12 +133,17 @@ jobs: working-directory: test/tools run: | set -x + # some tests include only xml or only hxml, so do not error if a type doesn't exist + shopt -s nullglob for dir in */; do pushd $dir for xml in *.xml; do haxelib run hxcpp $xml haxelib run hxcpp $xml clean done + for hxml in *.hxml; do + haxe $hxml + done popd done diff --git a/test/tools/rebuild-no-smart-strings/Main.hx b/test/tools/rebuild-no-smart-strings/Main.hx new file mode 100644 index 000000000..3bacfe623 --- /dev/null +++ b/test/tools/rebuild-no-smart-strings/Main.hx @@ -0,0 +1,3 @@ +function main() { + ~/hello/.match("world"); +} diff --git a/test/tools/rebuild-no-smart-strings/build-0-smart-strings.hxml b/test/tools/rebuild-no-smart-strings/build-0-smart-strings.hxml new file mode 100644 index 000000000..b484e67e7 --- /dev/null +++ b/test/tools/rebuild-no-smart-strings/build-0-smart-strings.hxml @@ -0,0 +1,2 @@ +-m Main +--cpp bin diff --git a/test/tools/rebuild-no-smart-strings/build-1-no-smart-strings.hxml b/test/tools/rebuild-no-smart-strings/build-1-no-smart-strings.hxml new file mode 100644 index 000000000..92704f813 --- /dev/null +++ b/test/tools/rebuild-no-smart-strings/build-1-no-smart-strings.hxml @@ -0,0 +1,3 @@ +-m Main +--cpp bin +-D disable-unicode-strings