FFI: Print whether FFI is enabled in -v/:v command

This commit is contained in:
Bretton 2022-08-04 20:39:09 -07:00
parent 9efd822614
commit 59f0b30a0c
3 changed files with 22 additions and 3 deletions

View File

@ -153,7 +153,12 @@ jobs:
cmd="cat \$1.stdout.mingw32 2>/dev/null || $cmd"
fi
./bin/test-runner --ext=.icry -r ./output --exe=$(which bash) -F -c -F "$cmd" -F -- ./tests
TARGETS_JSON=$(echo -n "$(ls -1 ./output/tests)" | jq -Rsc 'split("\n")')
if cabal v2-exec cryptol -- -v | grep -q 'FFI enabled'; then
filter="cat"
else
filter="grep -v ffi"
fi
TARGETS_JSON=$(echo -n "$(ls -1 ./output/tests)" | $filter | jq -Rsc 'split("\n")')
echo "::set-output name=targets-json::$TARGETS_JSON"
- shell: bash

14
cry
View File

@ -79,11 +79,21 @@ case $COMMAND in
test)
echo Running tests
setup_external_tools
if [ "$#" == "0" ]; then TESTS=tests; else TESTS=$*; fi
if [ "$#" == "0" ]; then
if cabal v2-exec cryptol -- -v | grep -q 'FFI enabled'; then
TESTS=(tests/*)
else
GLOBIGNORE="tests/ffi"
TESTS=(tests/*)
unset GLOBIGNORE
fi
else
TESTS=("$*")
fi
$BIN/test-runner --ext=.icry \
--exe=cabal \
-F v2-run -F -v0 -F exe:cryptol -F -- -F -b \
$TESTS
"${TESTS[@]}"
;;
rpc-test)

View File

@ -6,6 +6,7 @@
-- Stability : provisional
-- Portability : portable
{-# LANGUAGE CPP #-}
{-# LANGUAGE Safe #-}
module Cryptol.Version (
@ -39,6 +40,9 @@ displayVersion putLn = do
putLn ("Cryptol " ++ ver)
putLn ("Git commit " ++ commitHash)
putLn (" branch " ++ commitBranch ++ dirtyLab)
#ifdef FFI_ENABLED
putLn "FFI enabled"
#endif
where
dirtyLab | commitDirty = " (non-committed files present during build)"
| otherwise = ""