mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-01 09:49:24 +03:00
[ test ] add IDRIS2_TESTS_CG env variable
This commit is contained in:
parent
482527063c
commit
7192ef28a3
2
.github/workflows/ci-api.yml
vendored
2
.github/workflows/ci-api.yml
vendored
@ -11,6 +11,8 @@ on:
|
||||
|
||||
env:
|
||||
SCHEME: scheme
|
||||
IDRIS2_TESTS_CG: chez
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
2
.github/workflows/ci-macos.yml
vendored
2
.github/workflows/ci-macos.yml
vendored
@ -10,6 +10,8 @@ on:
|
||||
- master
|
||||
env:
|
||||
SCHEME: chez
|
||||
IDRIS2_TESTS_CG: chez
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
|
6
.github/workflows/ci-ubuntu-racket.yml
vendored
6
.github/workflows/ci-ubuntu-racket.yml
vendored
@ -9,6 +9,9 @@ on:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
IDRIS2_TESTS_CG: racket
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@ -17,9 +20,8 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y racket
|
||||
- name: Build from bootstrap
|
||||
run: make bootstrap-racket
|
||||
shell: bash
|
||||
|
||||
|
3
.github/workflows/ci-ubuntu.yml
vendored
3
.github/workflows/ci-ubuntu.yml
vendored
@ -11,6 +11,8 @@ on:
|
||||
|
||||
env:
|
||||
SCHEME: scheme
|
||||
IDRIS2_TESTS_CG: chez
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@ -27,4 +29,3 @@ jobs:
|
||||
- name: Build and test self-hosted
|
||||
run: make clean && make all && make test INTERACTIVE=''
|
||||
shell: bash
|
||||
|
||||
|
3
.github/workflows/ci-windows.yml
vendored
3
.github/workflows/ci-windows.yml
vendored
@ -12,6 +12,7 @@ env:
|
||||
MSYSTEM: MINGW64
|
||||
MSYS2_PATH_TYPE: inherit
|
||||
SCHEME: scheme
|
||||
IDRIS2_TESTS_CG: chez
|
||||
CC: gcc
|
||||
|
||||
jobs:
|
||||
@ -24,7 +25,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Get Chez Scheme
|
||||
run: |
|
||||
run: |
|
||||
git clone --depth 1 https://github.com/cisco/ChezScheme
|
||||
c:\msys64\usr\bin\bash -l -c "pacman -S --noconfirm tar make"
|
||||
echo "::set-env name=PWD::$(c:\msys64\usr\bin\cygpath -u $(pwd))"
|
||||
|
@ -165,6 +165,8 @@ record Options where
|
||||
constructor MkOptions
|
||||
||| Name of the idris2 executable
|
||||
idris2 : String
|
||||
||| Name of the codegenerator to use for `exec`
|
||||
codegen : Maybe String
|
||||
||| Should we only run some specific cases?
|
||||
onlyNames : List String
|
||||
||| Should we run the test suite interactively?
|
||||
@ -175,7 +177,7 @@ usage = "Usage: runtests <idris2 path> [--interactive] [--only [NAMES]]"
|
||||
|
||||
options : List String -> Maybe Options
|
||||
options args = case args of
|
||||
(_ :: idris2 :: rest) => go rest (MkOptions idris2 [] False)
|
||||
(_ :: idris2 :: rest) => go rest (MkOptions idris2 Nothing [] False)
|
||||
_ => Nothing
|
||||
|
||||
where
|
||||
@ -184,6 +186,7 @@ options args = case args of
|
||||
go rest opts = case rest of
|
||||
[] => pure opts
|
||||
("--interactive" :: xs) => go xs (record { interactive = True } opts)
|
||||
("--cg" :: cg :: xs) => go xs (record { codegen = Just cg } opts)
|
||||
("--only" :: xs) => pure $ record { onlyNames = xs } opts
|
||||
_ => Nothing
|
||||
|
||||
@ -247,7 +250,10 @@ runTest opts testPath
|
||||
runTest' : IO Bool
|
||||
runTest'
|
||||
= do putStr $ testPath ++ ": "
|
||||
system $ "sh ./run " ++ idris2 opts ++ " | tr -d '\\r' > output"
|
||||
let cg = case codegen opts of
|
||||
Nothing => ""
|
||||
Just cg => "env IDRIS2_TESTS_CG=" ++ cg ++ " "
|
||||
system $ cg ++ "sh ./run " ++ idris2 opts ++ " | tr -d '\\r' > output"
|
||||
Right out <- readFile "output"
|
||||
| Left err => do print err
|
||||
pure False
|
||||
@ -299,6 +305,19 @@ findNode
|
||||
= do Just chez <- getEnv "NODE" | Nothing => pathLookup ["node"]
|
||||
pure $ Just chez
|
||||
|
||||
findRacket : IO (Maybe String)
|
||||
findRacket
|
||||
= do Just racket <- getEnv "RACKET" | Nothing => pathLookup ["racket"]
|
||||
pure $ Just racket
|
||||
|
||||
findCG : IO (Maybe String)
|
||||
findCG
|
||||
= do Nothing <- getEnv "IDRIS2_CG" | p => pure p
|
||||
Nothing <- findChez | p => pure (Just "chez")
|
||||
Nothing <- findNode | p => pure (Just "node")
|
||||
Nothing <- findRacket | p => pure (Just "racket")
|
||||
pure Nothing
|
||||
|
||||
runChezTests : Options -> List String -> IO (List Bool)
|
||||
runChezTests opts tests
|
||||
= do chexec <- findChez
|
||||
@ -329,6 +348,9 @@ main
|
||||
let (Just opts) = options args
|
||||
| _ => do print args
|
||||
putStrLn usage
|
||||
opts <- case codegen opts of
|
||||
Nothing => pure $ record { codegen = !findCG } opts
|
||||
Just _ => pure opts
|
||||
let filteredNonCGTests =
|
||||
filterTests opts $ concat $
|
||||
[ testPaths "ttimp" ttimpTests
|
||||
|
Loading…
Reference in New Issue
Block a user