shithub: puzzles

Download patch

ref: b591bbdb5f1588f34bb07729057101d4f8b6907a
parent: 873d613dd597f550b1b64946c4577b012d61d1c9
author: Simon Tatham <[email protected]>
date: Sat Feb 18 03:53:59 EST 2023

Buildscr: include a test build with clang + STRICT.

I've just enabled a warning that only fires in that mode, so we need
to keep running the build in that configuration to ensure further
instances of the warning aren't introduced.

--- a/Buildscr
+++ b/Buildscr
@@ -3,7 +3,7 @@
 #
 # You can cut out large components of the build by defining a subset
 # of these options on the bob command line:
-# -DNOSIGN -DNOWINDOWS -DNOMACOS -DNOICONS -DNOJAVA -DNOJS
+# -DNOTEST -DNOSIGN -DNOWINDOWS -DNOMACOS -DNOICONS -DNOJAVA -DNOJS
 
 module puzzles
 
@@ -39,6 +39,19 @@
   # Copy the C icon files into the icons source subdirectory, for the
   # distribution tarball.
   in . do cp build-icons/icons/*-icon.c puzzles/icons
+endif
+
+ifneq "$(NOTEST)" yes then
+  # Run tests. In particular, ensure we build in 'strict' mode with
+  # both gcc and clang.
+  ifeq "$(NOICONS)" yes then
+    # We don't need to run the gcc build if we did it above for the icons
+    in . do cmake -B test-gcc puzzles -DSTRICT=ON
+    in test-gcc do make -j$(nproc)
+  endif
+
+  in . do cmake -B test-clang puzzles -DSTRICT=ON -DCMAKE_C_COMPILER=clang
+  in test-clang do make -j$(nproc)
 endif
 
 # The very first thing we do is to make the source archive, before we