[libcxx-commits] [libcxx] [libcxx] [test] Merge the MinGW static/shared test config files (PR #111759)

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 9 13:40:27 PDT 2024


https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/111759

These were split in 0e8208eca1c316b7302de7803ab0d85a1dd77076, with the only functional difference between them at the time being `--prepend_env PATH=%{lib-dir}` in the static config and `--prepend_env PATH=%{install-prefix}/bin` in the shared library config.

However this difference is unnecessary - the static library config doesn't need any `--prepend_env` argument at all. Before 0e8208eca1c316b7302de7803ab0d85a1dd77076, both configurations used the same config file, where the `--prepend_env` argument was unnecessary but benign in the static case.

Reduce the unnecessary config duplication in this case, and return these configs to using one single config file for both setups.

>From 023d166788f3823612094438b2ecfedb8faecfad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Wed, 9 Oct 2024 23:33:06 +0300
Subject: [PATCH] [libcxx] [test] Merge the MinGW static/shared test config
 files

These were split in 0e8208eca1c316b7302de7803ab0d85a1dd77076,
with the only functional difference between them at the time
being `--prepend_env PATH=%{lib-dir}` in the static config
and `--prepend_env PATH=%{install-prefix}/bin` in the shared
library config.

However this difference is unnecessary - the static library config
doesn't need any `--prepend_env` argument at all. Before
0e8208eca1c316b7302de7803ab0d85a1dd77076, both configurations
used the same config file, where the `--prepend_env` argument was
unnecessary but benign in the static case.

Reduce the unnecessary config duplication in this case, and return
these configs to using one single config file for both setups.
---
 libcxx/CMakeLists.txt                         |  6 +----
 ...-mingw.cfg.in => llvm-libc++-mingw.cfg.in} |  2 +-
 .../configs/llvm-libc++-static-mingw.cfg.in   | 25 -------------------
 3 files changed, 2 insertions(+), 31 deletions(-)
 rename libcxx/test/configs/{llvm-libc++-shared-mingw.cfg.in => llvm-libc++-mingw.cfg.in} (92%)
 delete mode 100644 libcxx/test/configs/llvm-libc++-static-mingw.cfg.in

diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index f1942e963ccc31..75c926f5432aea 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -131,11 +131,7 @@ option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS
 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
   set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-gcc.cfg.in")
 elseif(MINGW)
-  if (LIBCXX_ENABLE_SHARED)
-    set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-mingw.cfg.in")
-  else()
-    set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-static-mingw.cfg.in")
-  endif()
+  set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-mingw.cfg.in")
 elseif(WIN32) # clang-cl
   if (LIBCXX_ENABLE_SHARED)
     set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-clangcl.cfg.in")
diff --git a/libcxx/test/configs/llvm-libc++-shared-mingw.cfg.in b/libcxx/test/configs/llvm-libc++-mingw.cfg.in
similarity index 92%
rename from libcxx/test/configs/llvm-libc++-shared-mingw.cfg.in
rename to libcxx/test/configs/llvm-libc++-mingw.cfg.in
index 8868f0cadd2aa2..01c4d58ca05f96 100644
--- a/libcxx/test/configs/llvm-libc++-shared-mingw.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-mingw.cfg.in
@@ -1,5 +1,5 @@
 # This testing configuration handles running the test suite against LLVM's libc++
-# using a DLL with MinGW/Clang on Windows.
+# using either a DLL or a static library, with MinGW/Clang on Windows.
 
 lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
 
diff --git a/libcxx/test/configs/llvm-libc++-static-mingw.cfg.in b/libcxx/test/configs/llvm-libc++-static-mingw.cfg.in
deleted file mode 100644
index fb2f9065898a54..00000000000000
--- a/libcxx/test/configs/llvm-libc++-static-mingw.cfg.in
+++ /dev/null
@@ -1,25 +0,0 @@
-# This testing configuration handles running the test suite against LLVM's libc++
-# using a static library with MinGW/Clang on Windows.
-
-lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
-
-config.substitutions.append(('%{flags}', ''))
-config.substitutions.append(('%{compile_flags}',
-    '-nostdinc++ -I %{target-include-dir} -I %{include-dir} -I %{libcxx-dir}/test/support'
-))
-config.substitutions.append(('%{link_flags}',
-    '-nostdlib++ -L %{lib-dir} -lc++'
-))
-config.substitutions.append(('%{exec}',
-    '%{executor} --execdir %T --prepend_env PATH=%{lib-dir} -- '
-))
-
-import os, site
-site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.config
-libcxx.test.config.configure(
-    libcxx.test.params.DEFAULT_PARAMETERS,
-    libcxx.test.features.DEFAULT_FEATURES,
-    config,
-    lit_config
-)



More information about the libcxx-commits mailing list