lmi-commits
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]