New test for detecting overridable options for IPKG commands.

This commit is contained in:
Jan de Muijnck-Hughes 2020-05-23 20:35:05 +01:00 committed by G. Allais
parent c23958bf16
commit 68a4ad2e1c
5 changed files with 46 additions and 4 deletions

View File

@ -79,7 +79,7 @@ idrisTests
"perror001", "perror002", "perror003", "perror004", "perror005",
"perror006",
-- Packages and ipkg files
"pkg001", "pkg002",
"pkg001", "pkg002", "pkg003",
-- Larger programs arising from real usage. Typically things with
-- interesting interactions between features
"real001", "real002",
@ -205,7 +205,7 @@ runTest opts testPath
b <- getAnswer
when b $ do Right _ <- writeFile "expected" out
| Left err => print err
pure ()
pure ()
runTest' : IO Bool
runTest'
= do putStr $ testPath ++ ": "
@ -220,9 +220,9 @@ runTest opts testPath
else print FileNotFound
pure False
| Left err => do print err
pure False
pure False
let result = normalize out == normalize exp
if normalize out == normalize exp
if normalize out == normalize exp
then putStrLn "success"
else do
putStrLn "FAILURE"

View File

@ -0,0 +1,4 @@
module Main
main : IO ()
main = putStrLn "CouCou!"

View File

@ -0,0 +1,16 @@
1/1: Building Main (Main.idr)
Not all command line options can be used to override package options.
Overridable options are:
--quiet
--verbose
--timing
--dumpcases <file>
--dumplifted <file>
--dumpvmcode <file>
--debug-elab-check
Packages must have an '.ipkg' extension: "malformed-package-name".
The presented iPKG file does not exist: "non-existent-package.ipkg".
The presented iPKG file does not exist: "non-existent-package".

11
tests/idris2/pkg003/run Executable file
View File

@ -0,0 +1,11 @@
$1 --build testpkg.ipkg
rm -f build/
$1 --build testpkg.ipkg --quiet
$1 --build testpkg.ipkg --verbose
$1 --build testpkg.ipkg --timing
$1 --build testpkg.ipkg --codegen gambit
$1 --build testpkg.ipkg --ide-mode
$1 --build malformed-package-name
$1 --build non-existent-package.ipkg
$1 --build non-existent-package-with-malformed-name
rm -f build/

View File

@ -0,0 +1,11 @@
package testpkg
authors = "Joe Bloggs"
maintainers = "Joe Bloggs"
license = "BSD3 but see LICENSE for more information"
brief = "This is a dummy package."
readme = "README.md"
main = Main
modules = Main