read the feature flags in sextest in the way sexc does
Some checks failed
Sex CI / build-linux (pull_request) Failing after 5m14s

sextest resolves #+ and #- itself -- it reads the program and prints
what survives to sexc -- so a flag spelling it does not recognise
decides which branch gets compiled
This commit is contained in:
2026-09-21 01:00:26 +03:00
parent 1195e5c191
commit 7ed1e99ab0
3 changed files with 61 additions and 17 deletions

View File

@@ -0,0 +1,24 @@
(compilation "-f alpha --features beta --features=gamma --no-platform-features")
(input)
(output "alpha" "beta" "gamma" "elsewhere")
(return 0)
;;; The flags naming the features, in every spelling sexc takes. This
;;; is not pedantry about the command line: sextest reads the program
;;; itself and prints the surviving forms to sexc, so a spelling it
;;; does not recognise leaves the guards below resolved against the
;;; wrong set -- quietly, since the test then checks the output of a
;;; program it did not mean to compile.
;;;
;;; --no-platform-features is what makes `#-unix' true wherever this is
;;; compiled, and it has to be honoured on both sides for that to hold.
(include stdio.h)
(pub fn main () int
#+alpha (puts "alpha")
#+beta (puts "beta")
#+gamma (puts "gamma")
#-unix (puts "elsewhere")
#+unix (puts "here")
(return 0))