git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: "Alejandro R. Sedeño" <asedeno@mit.edu>,
	"Toon Claes" <toon@iotcl.com>, "Taylor Blau" <me@ttaylorr.com>,
	"Ed Reel" <edreel@gmail.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Bagas Sanjaya" <bagasdotme@gmail.com>,
	"Edgar Bonet" <bonet@grenoble.cnrs.fr>,
	"Jeff King" <peff@peff.net>,
	"brian m. carlson" <sandals@crustytoothpaste.net>
Subject: [PATCH v2 0/5] t/unit-tests: improve clar platform compatibility
Date: Mon, 21 Oct 2024 12:56:30 +0200	[thread overview]
Message-ID: <cover.1729506329.git.ps@pks.im> (raw)
In-Reply-To: <CAOO-Oz3KsyeSjxbRpU-SdPgU5K+mPDcntT6Y4s46Mg_0ko9e_w@mail.gmail.com>

Hi,

this is the second version of my patch series that addresses some
platform compatibility issues with clar. Changes compared to v1:

  - I've merged the CMake fixes at [1] into this patch series to avoid
    conflicts. @Taylor, please drop that other series, which is
    "ps/cmake-clar".

  - I've fixed up the "generate-clar-decls.h" script.

  - I've updated the clar such that it includes upstreamed changes for
    improved uClibc support when we lack support for `wchar_t`.

Thanks!

Patrick

[1]: <cover.1728914219.git.ps@pks.im>

Alejandro R. Sedeño (1):
  Makefile: adjust sed command for generating "clar-decls.h"

Patrick Steinhardt (4):
  t/unit-tests: update clar to 206accb
  Makefile: extract script to generate clar declarations
  cmake: fix compilation of clar-based unit tests
  cmake: set up proper dependencies for generated clar headers

 Makefile                                   |   4 +-
 contrib/buildsystems/CMakeLists.txt        |  52 +++------
 t/unit-tests/clar/.editorconfig            |  13 +++
 t/unit-tests/clar/.github/workflows/ci.yml |  20 +++-
 t/unit-tests/clar/.gitignore               |   1 +
 t/unit-tests/clar/CMakeLists.txt           |  28 +++++
 t/unit-tests/clar/clar.c                   | 127 ++++++++++++---------
 t/unit-tests/clar/clar/print.h             |  11 +-
 t/unit-tests/clar/clar/sandbox.h           |  17 ++-
 t/unit-tests/clar/clar/summary.h           |  14 +--
 t/unit-tests/clar/test/.gitignore          |   4 -
 t/unit-tests/clar/test/CMakeLists.txt      |  39 +++++++
 t/unit-tests/clar/test/Makefile            |  39 -------
 t/unit-tests/generate-clar-decls.sh        |  16 +++
 14 files changed, 219 insertions(+), 166 deletions(-)
 create mode 100644 t/unit-tests/clar/.editorconfig
 create mode 100644 t/unit-tests/clar/.gitignore
 create mode 100644 t/unit-tests/clar/CMakeLists.txt
 delete mode 100644 t/unit-tests/clar/test/.gitignore
 create mode 100644 t/unit-tests/clar/test/CMakeLists.txt
 delete mode 100644 t/unit-tests/clar/test/Makefile
 create mode 100755 t/unit-tests/generate-clar-decls.sh

Range-diff against v1:
1:  a96fbdbb5f9 ! 1:  06145a141dd t/unit-tests: update clar to 0810a36
    @@ Metadata
     Author: Patrick Steinhardt <ps@pks.im>
     
      ## Commit message ##
    -    t/unit-tests: update clar to 0810a36
    +    t/unit-tests: update clar to 206accb
     
         Update clar from:
     
    @@ Commit message
     
         To:
     
    -        - 0810a36 (Merge pull request #107 from pks-t/pks-sunos-compatibility, 2024-10-14)
    +        - 206accb (Merge pull request #108 from pks-t/pks-uclibc-without-wchar, 2024-10-21)
     
         This update includes a bunch of fixes and improvements that we have
         discussed in Git when initial support for clar was merged:
    @@ Commit message
           - We now use the combination of mktemp(3) and mkdir(3) on SunOS, same
             as we do on NonStop.
     
    +      - We now support uClibc without support for <wchar.h>.
    +
         The most important bits here are the improved platform compatibility
    -    with Windows, OpenSUSE and SunOS.
    +    with Windows, OpenSUSE, SunOS and uClibc.
     
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
     
    @@ t/unit-tests/clar/clar.c
      
      /* required for sandboxing */
      #include <sys/types.h>
    + #include <sys/stat.h>
    + 
    ++#if defined(__UCLIBC__) && ! defined(__UCLIBC_HAS_WCHAR__)
    ++	/*
    ++	 * uClibc can optionally be built without wchar support, in which case
    ++	 * the installed <wchar.h> is a stub that only defines the `whar_t`
    ++	 * type but none of the functions typically declared by it.
    ++	 */
    ++#else
    ++#	define CLAR_HAVE_WCHAR
    ++#endif
    ++
    + #ifdef _WIN32
    + #	define WIN32_LEAN_AND_MEAN
    + #	include <windows.h>
     @@
      
      #	ifndef stat
    @@ t/unit-tests/clar/clar.c: void clar__assert_equal(
      			}
      		}
      	}
    ++#ifdef CLAR_HAVE_WCHAR
    + 	else if (!strcmp("%ls", fmt)) {
    + 		const wchar_t *wcs1 = va_arg(args, const wchar_t *);
    + 		const wchar_t *wcs2 = va_arg(args, const wchar_t *);
    +@@ t/unit-tests/clar/clar.c: void clar__assert_equal(
    + 			}
    + 		}
    + 	}
     -	else if (!strcmp("%"PRIuZ, fmt) || !strcmp("%"PRIxZ, fmt)) {
     -		size_t sz1 = va_arg(args, size_t), sz2 = va_arg(args, size_t);
    ++#endif /* CLAR_HAVE_WCHAR */
     +	else if (!strcmp("%"PRIuMAX, fmt) || !strcmp("%"PRIxMAX, fmt)) {
     +		uintmax_t sz1 = va_arg(args, uintmax_t), sz2 = va_arg(args, uintmax_t);
      		is_equal = (sz1 == sz2);
2:  dda9b8e033c = 2:  17d77f36d41 Makefile: adjust sed command for generating "clar-decls.h"
-:  ----------- > 3:  c2e3fbcd853 Makefile: extract script to generate clar declarations
-:  ----------- > 4:  a30017a4d89 cmake: fix compilation of clar-based unit tests
-:  ----------- > 5:  bb005979e7e cmake: set up proper dependencies for generated clar headers

base-commit: 3a0677f8601d8937562ba14665d773fd8f2d71da
-- 
2.47.0.72.gef8ce8f3d4.dirty


  parent reply	other threads:[~2024-10-21 10:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-12  2:10 git no longer builds on SunOS 5.10, a report Alejandro R. Sedeño
2024-10-12  8:19 ` Patrick Steinhardt
2024-10-12 14:34   ` Alejandro R. Sedeño
2024-10-12 14:40     ` [PATCH] Makefile: adjust sed command for generating "clar-decls.h" Alejandro R. Sedeño
2024-10-12 14:42     ` git no longer builds on SunOS 5.10, a report Alejandro R. Sedeño
2024-10-13 19:57     ` Patrick Steinhardt
2024-10-13 22:50       ` Alejandro R. Sedeño
2024-10-14  6:20         ` Patrick Steinhardt
2024-10-14 11:45 ` [PATCH 0/2] t/unit-tests: improve clar platform compatibility Patrick Steinhardt
2024-10-14 11:45   ` [PATCH 1/2] t/unit-tests: update clar to 0810a36 Patrick Steinhardt
2024-10-14 11:45   ` [PATCH 2/2] Makefile: adjust sed command for generating "clar-decls.h" Patrick Steinhardt
2024-10-18 15:45     ` Toon Claes
2024-10-18 21:14       ` Taylor Blau
2024-10-21  7:00         ` Patrick Steinhardt
2024-10-21 10:56 ` Patrick Steinhardt [this message]
2024-10-21 10:56   ` [PATCH v2 1/5] t/unit-tests: update clar to 206accb Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 2/5] Makefile: adjust sed command for generating "clar-decls.h" Patrick Steinhardt
2024-10-21 11:07     ` Kristoffer Haugsbakk
2024-10-21 11:35       ` Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 3/5] Makefile: extract script to generate clar declarations Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 4/5] cmake: fix compilation of clar-based unit tests Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 5/5] cmake: set up proper dependencies for generated clar headers Patrick Steinhardt
2024-11-05 19:55     ` Johannes Schindelin
2024-11-06 10:59       ` Phillip Wood
2024-11-08 12:59         ` Patrick Steinhardt
2024-10-21 20:52   ` [PATCH v2 0/5] t/unit-tests: improve clar platform compatibility Taylor Blau
2024-10-25 12:17   ` karthik nayak
2024-10-26  5:01   ` Bagas Sanjaya
2024-10-27 13:01     ` Patrick Steinhardt
2024-10-27 23:56       ` Taylor Blau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1729506329.git.ps@pks.im \
    --to=ps@pks.im \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=asedeno@mit.edu \
    --cc=bagasdotme@gmail.com \
    --cc=bonet@grenoble.cnrs.fr \
    --cc=edreel@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    --cc=sandals@crustytoothpaste.net \
    --cc=toon@iotcl.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).