[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 41fce79a 08/10: Test with clang as well as gc
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 41fce79a 08/10: Test with clang as well as gcc |
Date: |
Sun, 26 Jun 2022 17:47:48 -0400 (EDT) |
branch: master
commit 41fce79a8362ba30dd9cdaeb26d3bbcd11bdad78
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Test with clang as well as gcc
---
gwc/unit_test.sh | 31 +++++++++++++++++++++++++------
nychthemeral_test.sh | 32 ++++++++++++++++++++++++++------
2 files changed, 51 insertions(+), 12 deletions(-)
diff --git a/gwc/unit_test.sh b/gwc/unit_test.sh
index 17095564..632d1dfb 100755
--- a/gwc/unit_test.sh
+++ b/gwc/unit_test.sh
@@ -1,18 +1,37 @@
#!/bin/zsh
-
-# 'triplets' really is used, but in a zsh-specific way
+#
+# 'lmi_toolchains' really is used, but in a zsh-specific way
# shellcheck disable=SC2034
- triplets="x86_64-pc-linux-gnu x86_64-w64-mingw32"
-export LMI_COMPILER=gcc
+ lmi_toolchains="clang_gnu64 gcc_gnu64 gcc_msw64"
+export LMI_COMPILER
export LMI_TRIPLET
# shellcheck disable=SC2043
-for LMI_TRIPLET in ${=triplets} ;
+for toolchain in ${=lmi_toolchains} ;
do
+case "$toolchain" in
+ (clang_gnu64)
+ LMI_COMPILER="clang"
+ LMI_TRIPLET="x86_64-pc-linux-gnu"
+ ;;
+ (gcc_gnu64)
+ LMI_COMPILER="gcc"
+ LMI_TRIPLET="x86_64-pc-linux-gnu"
+ ;;
+ (gcc_msw64)
+ LMI_COMPILER="gcc"
+ LMI_TRIPLET="x86_64-w64-mingw32"
+ ;;
+ (*)
+ printf 'Unknown toolchain "%s".\n' "$toolchain"
+ return 1;
+ ;;
+esac
prefix=/opt/lmi
exec_prefix="$prefix/${LMI_COMPILER}_${LMI_TRIPLET}"
log_dir="$exec_prefix"/logs
+mkdir --parents "$log_dir"
{
-printf 'LMI_TRIPLET = "%s"\n' "$LMI_TRIPLET" > /dev/tty
+printf 'toolchain: %s\n' "${LMI_COMPILER}_${LMI_TRIPLET}" > /dev/tty
# shellcheck disable=SC2039,SC2154,SC3001
make "$coefficiency" --output-sync=recurse unit_tests 2>&1 \
| tee \
diff --git a/nychthemeral_test.sh b/nychthemeral_test.sh
index c5bc14b6..18dceccd 100755
--- a/nychthemeral_test.sh
+++ b/nychthemeral_test.sh
@@ -52,6 +52,8 @@ build_clutter='
/^[^ ]*cpp *-x /d
/^[^ ]*g++ *-[Mo]/d
/^[^ ]*gcc *-[Mo]/d
+/^[^ ]*clang++ *-[Mo]/d
+/^[^ ]*clang *-[Mo]/d
/^[^ ]*windres -o /d
'
@@ -278,20 +280,38 @@ esac
# This for-loop can iterate over as many toolchains as desired.
# Make sure the current production architecture is built last, so that
# it's the one installed to /opt/lmi/bin/ when this script ends.
-triplets="x86_64-w64-mingw32"
+lmi_toolchains="gcc_msw64"
if [ "Cygwin" != "$platform" ] && [ "WSL" != "$platform" ]
then
-# 'triplets' really is used, but in a zsh-specific way
+# 'lmi_toolchains' really is used, but in a zsh-specific way
# shellcheck disable=SC2034
- triplets="x86_64-pc-linux-gnu x86_64-w64-mingw32"
+ lmi_toolchains="clang_gnu64 gcc_gnu64 gcc_msw64"
fi
-export LMI_COMPILER=gcc
+export LMI_COMPILER
export LMI_TRIPLET
# shellcheck disable=SC2043
# "${=...} expansion--see zsh faq 3.1:
# "Why does $var where var="foo bar" not do what I expect?"
-for LMI_TRIPLET in ${=triplets} ;
+for toolchain in ${=lmi_toolchains} ;
do
+case "$toolchain" in
+ (clang_gnu64)
+ LMI_COMPILER="clang"
+ LMI_TRIPLET="x86_64-pc-linux-gnu"
+ ;;
+ (gcc_gnu64)
+ LMI_COMPILER="gcc"
+ LMI_TRIPLET="x86_64-pc-linux-gnu"
+ ;;
+ (gcc_msw64)
+ LMI_COMPILER="gcc"
+ LMI_TRIPLET="x86_64-w64-mingw32"
+ ;;
+ (*)
+ printf 'Unknown toolchain "%s".\n' "$toolchain"
+ return 1;
+ ;;
+esac
# Directory for test logs.
#
# It seems redundant to construct yet another $prefix and $exec_prefix here;
@@ -301,7 +321,7 @@ exec_prefix="$prefix/${LMI_COMPILER}_${LMI_TRIPLET}"
log_dir="$exec_prefix"/logs
mkdir --parents "$log_dir"
{
-printf 'LMI_TRIPLET = "%s"\n' "$LMI_TRIPLET" > /dev/tty
+printf 'toolchain: %s\n' "${LMI_COMPILER}_${LMI_TRIPLET}" > /dev/tty
# Cannot recursively check script on path determined at runtime, so
# a directive like 'source="$srcdir"' doesn't work.
- [lmi-commits] [lmi] master updated (ee23febb -> fd6587af), Greg Chicares, 2022/06/26
- [lmi-commits] [lmi] master 41fce79a 08/10: Test with clang as well as gcc,
Greg Chicares <=
- [lmi-commits] [lmi] master 9eae460d 06/10: Support clang, Greg Chicares, 2022/06/26
- [lmi-commits] [lmi] master d0b24945 04/10: Add a useful command, Greg Chicares, 2022/06/26
- [lmi-commits] [lmi] master fd6587af 10/10: Import improved commentary, Greg Chicares, 2022/06/26
- [lmi-commits] [lmi] master 606e9355 01/10: Permit clang version macros, Greg Chicares, 2022/06/26
- [lmi-commits] [lmi] master 5175f188 02/10: Don't use 'volatile' in a context where it is deprecated, Greg Chicares, 2022/06/26
- [lmi-commits] [lmi] master 815897a8 09/10: Remove an obsolete comment, Greg Chicares, 2022/06/26
- [lmi-commits] [lmi] master 3db28e83 07/10: Make clang '-ffp' flags work without crashing, Greg Chicares, 2022/06/26
- [lmi-commits] [lmi] master 95add508 05/10: Forestall a clang complaint, Greg Chicares, 2022/06/26
- [lmi-commits] [lmi] master 3e9c5f3f 03/10: Remove disused 'platform_cgicc_libraries', Greg Chicares, 2022/06/26