Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,325
Issues
4,325
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
389
Merge Requests
389
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
48b81a3a
Commit
48b81a3a
authored
Jun 19, 2018
by
Tao He
Committed by
Andrey Mokhov
Jun 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement build rules for testsuite/timeout (
#499
)
parent
f3192439
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
28 deletions
+30
-28
src/GHC.hs
src/GHC.hs
+2
-1
src/GHC/Packages.hs
src/GHC/Packages.hs
+3
-1
src/Rules/Test.hs
src/Rules/Test.hs
+25
-26
No files found.
src/GHC.hs
View file @
48b81a3a
...
...
@@ -109,7 +109,8 @@ testsuitePackages = return [ checkApiAnnotations
,
checkPpr
,
ghcPkg
,
parallel
,
hp2ps
]
,
hp2ps
,
timeout
]
-- | Given a 'Context', compute the name of the program that is built in it
-- assuming that the corresponding package's type is 'Program'. For example, GHC
...
...
src/GHC/Packages.hs
View file @
48b81a3a
...
...
@@ -17,7 +17,8 @@ ghcPackages =
,
ghcHeap
,
ghci
,
ghcPkg
,
ghcPrim
,
ghcTags
,
haddock
,
haskeline
,
hsc2hs
,
hp2ps
,
hpc
,
hpcBin
,
integerGmp
,
integerSimple
,
iserv
,
libffi
,
libiserv
,
mtl
,
parsec
,
parallel
,
pretty
,
process
,
rts
,
runGhc
,
stm
,
templateHaskell
,
terminfo
,
text
,
time
,
touchy
,
transformers
,
unlit
,
unix
,
win32
,
xhtml
]
,
terminfo
,
text
,
time
,
touchy
,
transformers
,
unlit
,
unix
,
win32
,
xhtml
,
timeout
]
-- TODO: Optimise by switching to sets of packages.
isGhcPackage
::
Package
->
Bool
...
...
@@ -81,6 +82,7 @@ unlit = hsUtil "unlit"
unix
=
hsLib
"unix"
win32
=
hsLib
"Win32"
xhtml
=
hsLib
"xhtml"
timeout
=
hsUtil
"timeout"
`
setPath
`
"testsuite/timeout"
-- | Construct a Haskell library package, e.g. @array@.
hsLib
::
PackageName
->
Package
...
...
src/Rules/Test.hs
View file @
48b81a3a
...
...
@@ -3,6 +3,7 @@ module Rules.Test (testRules, runTestGhcFlags, timeoutProgPath) where
import
Base
import
Expression
import
GHC
import
GHC.Packages
(
timeout
)
import
Oracles.Flag
import
Oracles.Setting
import
Settings
...
...
@@ -14,25 +15,6 @@ import System.Environment
-- TODO: clean up after testing
testRules
::
Rules
()
testRules
=
do
root
<-
buildRootRules
root
-/-
timeoutPyPath
~>
do
copyFile
"testsuite/timeout/timeout.py"
(
root
-/-
timeoutPyPath
)
-- TODO windows is still not supported.
--
-- See: https://github.com/ghc/ghc/blob/master/testsuite/timeout/Makefile#L23
root
-/-
timeoutProgPath
~>
do
python
<-
builderPath
Python
need
[
root
-/-
timeoutPyPath
]
let
script
=
unlines
[
"#!/usr/bin/env sh"
,
"exec "
++
python
++
" $0.py
\"
$@
\"
"
]
liftIO
$
do
writeFile
(
root
-/-
timeoutProgPath
)
script
makeExecutable
(
root
-/-
timeoutProgPath
)
"validate"
~>
do
needTestBuilders
build
$
target
(
vanillaContext
Stage2
compiler
)
(
Make
"testsuite/tests"
)
[]
[]
...
...
@@ -40,9 +22,6 @@ testRules = do
"test"
~>
do
needTestBuilders
-- Prepare the timeout program.
need
[
root
-/-
timeoutProgPath
]
-- TODO This approach doesn't work.
-- Set environment variables for test's Makefile.
env
<-
sequence
...
...
@@ -78,6 +57,28 @@ needTestsuiteBuilders = do
|
isLibrary
pkg
=
pkgConfFile
(
vanillaContext
stage
pkg
)
|
otherwise
=
programPath
=<<
programContext
stage
pkg
-- | Build the timeout program.
-- See: https://github.com/ghc/ghc/blob/master/testsuite/timeout/Makefile#L23
timeoutProgBuilder
::
Action
()
timeoutProgBuilder
=
do
root
<-
buildRoot
windows
<-
windowsHost
if
windows
then
do
prog
<-
programPath
=<<
programContext
Stage1
timeout
need
[
prog
]
copyFile
prog
(
root
-/-
timeoutProgPath
)
else
do
python
<-
builderPath
Python
copyFile
"testsuite/timeout/timeout.py"
(
root
-/-
"test/bin/timeout.py"
)
let
script
=
unlines
[
"#!/usr/bin/env sh"
,
"exec "
++
python
++
" $0.py
\"
$@
\"
"
]
liftIO
$
do
writeFile
(
root
-/-
timeoutProgPath
)
script
makeExecutable
(
root
-/-
timeoutProgPath
)
needTestBuilders
::
Action
()
needTestBuilders
=
do
needBuilder
$
Ghc
CompileHs
Stage2
...
...
@@ -85,6 +86,7 @@ needTestBuilders = do
needBuilder
Hpc
needBuilder
(
Hsc2Hs
Stage1
)
needTestsuiteBuilders
timeoutProgBuilder
-- | Extra flags to send to the Haskell compiler to run tests.
runTestGhcFlags
::
Action
String
...
...
@@ -116,8 +118,5 @@ runTestGhcFlags = do
,
pure
"-dno-debug-output"
]
timeoutPyPath
::
FilePath
timeoutPyPath
=
"test/bin/timeout.py"
timeoutProgPath
::
FilePath
timeoutProgPath
=
"test/bin/timeout"
<.>
exe
timeoutProgPath
=
"test
suite/timeout/install-inplace
/bin/timeout"
<.>
exe
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment