Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clean-test
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
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
clean-and-itasks
clean-test
Commits
22e94fd3
Commit
22e94fd3
authored
May 08, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add makecleantest program
parent
74f238df
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
166 additions
and
13 deletions
+166
-13
.gitignore
.gitignore
+3
-1
Tools/Cloogle
Tools/Cloogle
+1
-0
Tools/Makefile
Tools/Makefile
+22
-5
Tools/cleantest.icl
Tools/cleantest.icl
+2
-7
Tools/makecleantest.icl
Tools/makecleantest.icl
+138
-0
No files found.
.gitignore
View file @
22e94fd3
Clean System Files/
Tools/ctest
Tools/clean-compiler/
Tools/cleantest
Tools/makecleantest
Cloogle
@
f7c26a57
Subproject commit f7c26a577fe7994912b67e9f38132fe024b7f8e2
Tools/Makefile
View file @
22e94fd3
BIN
:=
ctest
SRC
:=
CleanTest
BIN
:=
cleantest makecleantest
CLM
:=
clm
CLMFLAGS
:=
-nr
-nt
-nortsopts
\
-I
$$
CLEAN_HOME/lib/Platform
-IL
ArgEnv
\
-IL
Platform
\
-IL
Platform/Deprecated/StdLib
\
-IL
TCPIP
\
-I
Cloogle
\
-I
Cloogle/libcloogle
\
-I
Cloogle/CleanTypeUnifier
\
-I
Cloogle/CleanPrettyPrint
\
-I
clean-compiler/frontend
\
-I
clean-compiler/backend
\
-I
clean-compiler/main
\
-I
clean-compiler/main/Unix
.PHONY
:
all clean
all
:
$(BIN)
$(BIN)
:
.FORCE
$(CLM)
$(CLMFLAGS)
$(SRC)
-o
$@
$(BIN)
:
clean-compiler .FORCE
$(CLM)
$(CLMFLAGS)
$@
-o
$@
clean-compiler
:
svn checkout
-r
2838 https://svn.cs.ru.nl/repos/clean-compiler/branches/itask/ clean-compiler
cd
clean-compiler
;
for
f
in
../Cloogle/compiler-patch/
*
.patch
;
do
patch
-p1
<
"
$$
f"
;
done
$(MAKE)
-j
-C
clean-compiler/main/Unix
$(MAKE)
-j
-C
clean-compiler/backendC/CleanCompilerSources
-f
Makefile.linux64
ln
-s
../../backendC/CleanCompilerSources/backend.a clean-compiler/backend/Clean
\
System
\
Files/backend_library
clean
:
$(RM)
-r
**
/Clean
\
System
\
Files
$(BIN)
...
...
Tools/
CleanT
est.icl
→
Tools/
cleant
est.icl
View file @
22e94fd3
module
CleanT
est
module
cleant
est
import
StdArray
import
StdBool
...
...
@@ -207,12 +207,7 @@ Start w
=
w
where
exit
::
String
*
World
->
*
World
exit
error
w
#
io
=
stderr
#
io
=
io
<<<
error
<<<
"
\n
"
#
(_,
w
)
=
fclose
io
w
#
w
=
setReturnCode
1
w
=
w
exit
error
w
=
snd
$
fclose
(
stderr
<<<
error
<<<
"
\n
"
)
$
setReturnCode
1
w
makeRuns
::
[
RunResult
]
Strategy
[
TestRun
]
->
[
SubTestRun
]
makeRuns
_
S_Default
runs
=
map
JustRun
runs
...
...
Tools/makecleantest.icl
0 → 100644
View file @
22e94fd3
module
makecleantest
import
StdBool
import
StdFile
import
StdOrdList
import
StdString
import
StdTuple
import
Data
.
Error
from
Data
.
Func
import
$,
on
,
`
on`
import
Data
.
Functor
import
Data
.
GenDefault
import
Data
.
List
import
Data
.
Maybe
import
System
.
CommandLine
import
System
.
File
import
System
.
FilePath
import
System
.
Options
import
Text
import
CloogleDBFactory
import
Doc
import
TypeUtil
::
Options
=
{
name
::
!
String
,
input
::
!
FilePath
,
output
::
!
FilePath
,
print_options
::
![
String
]
,
test_options
::
![
String
]
}
derive
gDefault
Options
Start
w
#
([
prog
:
args
],
w
)
=
getCommandLine
w
#
opts
=
parseOptions
optionDescription
args
gDefault
{|*|}
|
isError
opts
=
exit
(
join
"
\n
"
$
fromError
opts
)
w
#
opts
=
fromOk
opts
|
any
((==)
""
)
[
opts
.
Options
.
name
,
opts
.
input
,
opts
.
output
]
=
exit
(
"Usage: "
+++
prog
+++
" -n NAME -i FILE -o FILE"
)
w
#
(
funs
,_,_,_,_,_,_,_,(_,
mod
,_),
w
)
=
findModuleContents
False
(
dropExtension
opts
.
input
)
w
#
props
=
generatePropertyModule
opts
.
Options
.
name
opts
.
print_options
opts
.
test_options
mod
[
f
\\
(_,
f
,_)
<-
funs
]
#
(
ok
,
w
)
=
writeFile
opts
.
output
props
w
|
isError
ok
=
exit
(
fromError
ok
<+
" "
+++
opts
.
output
)
w
=
w
where
exit
::
String
*
World
->
*
World
exit
error
w
=
snd
$
fclose
(
stderr
<<<
error
<<<
"
\n
"
)
$
setReturnCode
1
w
optionDescription
::
Option
Options
optionDescription
=
WithHelp
True
$
Options
[
Shorthand
"-n"
"--name"
$
Option
"--name"
(\
n
opts
->
Ok
{
Options
|
opts
&
name
=
n
})
"NAME"
"The name for the test module"
,
Shorthand
"-i"
"--input"
$
Option
"--input"
(\
f
opts
->
Ok
{
opts
&
input
=
f
})
"FILE"
"The file name of a Clean module to generate tests for"
,
Shorthand
"-o"
"--output"
$
Option
"--output"
(\
f
opts
->
Ok
{
opts
&
output
=
f
})
"FILE"
"The file name to write the test to"
,
Shorthand
"-P"
"--print-option"
$
Option
"--print-option"
(\
po
opts
->
Ok
{
opts
&
print_options
=
opts
.
print_options
++
[
po
]})
"OPT"
"Add OPT to the print options (see Gast's PrintOption type)"
,
Shorthand
"-T"
"--test-option"
$
Option
"--test-option"
(\
po
opts
->
Ok
{
opts
&
test_options
=
opts
.
test_options
++
[
po
]})
"OPT"
"Add OPT to the test options (see Gast's Testoption type)"
]
generatePropertyModule
::
!
String
![
String
]
![
String
]
!
ModuleEntry
![
FunctionEntry
]
->
String
generatePropertyModule
name
print_options
test_options
me
fes
=
join
"
\n\n
"
[
"module "
+++
name
,
"import Gast, Gast.CommandLine"
,
bootstrap
,
start
:
[
gp
.
gp_implementation
\\
gp
<-
props
]
]
where
props
=
concatMap
generateProperties
fes
bootstrap
=
case
me
.
me_documentation
of
Just
d
->
fromMaybe
""
$
fromMultiLine
<$>
d
.
property_bootstrap
Nothing
->
""
start
=
join
"
\n\t
"
[
"Start w = exposeProperties"
,
"["
+++
join
","
print_options
+++
"]"
,
"["
+++
join
","
test_options
+++
"]"
,
"[ EP "
+++
join
"
\n\t
, EP "
[
gp
.
gp_name
\\
gp
<-
props
]
,
"] w"
]
::
GeneratedProperty
=
{
gp_name
::
!
String
,
gp_implementation
::
!
String
}
generateProperties
::
!
FunctionEntry
->
[
GeneratedProperty
]
generateProperties
fe
=:{
fe_documentation
=
Just
doc
}
=
[
gen
p
config
\\
p
<-
doc
.
properties
,
config
<-
configurations
$
groupInstantiations
doc
.
property_test_with
]
where
groupInstantiations
::
[
PropertyVarInstantiation
]
->
[[(
String
,
Type
)]]
groupInstantiations
pvis
=
groupBy
((==)
`
on`
fst
)
$
sortBy
((<)
`
on`
fst
)
[
vi
\\
PropertyVarInstantiation
vi
<-
pvis
]
configurations
::
[[(
String
,
Type
)]]
->
[[(
String
,
Type
)]]
configurations
[
vis
:
viss
]
=
[[
vi`
:
vis`
]
\\
vi`
<-
vis
,
vis`
<-
configurations
viss
]
configurations
[]
=
[[]]
gen
::
!
Property
![(
String
,
Type
)]
->
GeneratedProperty
gen
(
ForAll
name
ts
imp
)
vis
=
{
gp_name
=
name`
,
gp_implementation
=
join
"
\n
"
[
name`
+++
" :: "
+++
toString
type
,
join
" "
[
name`
:
map
fst
ts
]
+++
" = "
+++
imp
]
}
where
name`
=
"prop_"
+++
name
type
=
fromJust
$
assignAll
vis
$
Func
(
map
snd
ts
)
(
Type
"Property"
[])
[]
generateProperties
_
=
[]
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