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
cloogle.org
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cloogle
cloogle.org
Commits
f6a7c350
Verified
Commit
f6a7c350
authored
Jan 29, 2019
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use clean-test-properties in CI
parent
88cf37d6
Pipeline
#18183
passed with stages
in 19 minutes and 31 seconds
Changes
10
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
104 additions
and
95 deletions
+104
-95
.gitignore
.gitignore
+3
-1
.gitlab-ci.yml
.gitlab-ci.yml
+5
-9
Makefile
Makefile
+29
-0
backend/Builtin/Syntax.dcl
backend/Builtin/Syntax.dcl
+52
-0
backend/Builtin/Syntax.icl
backend/Builtin/Syntax.icl
+4
-1
backend/build.sh
backend/build.sh
+2
-1
backend/install_clean.sh
backend/install_clean.sh
+0
-4
backend/install_clean_vars.sh
backend/install_clean_vars.sh
+9
-0
backend/test/builtin_syntax.icl
backend/test/builtin_syntax.icl
+0
-57
test/Makefile
test/Makefile
+0
-22
No files found.
.gitignore
View file @
f6a7c350
...
...
@@ -17,4 +17,6 @@ cloogle.log
db/storage/
cache
test/builtin_syntax
backend/test/builtin_syntax
_Tests/
_Tests.*
.gitlab-ci.yml
View file @
f6a7c350
...
...
@@ -2,19 +2,15 @@ variables:
GIT_SUBMODULE_STRATEGY
:
recursive
stages
:
-
check
-
test
-
build
style syntax documentation
:
stage
:
check
test
:
stage
:
test
image
:
camilstaps/clean:nightly
only
:
changes
:
-
backend/Builtin/Syntax.icl
script
:
-
cd backend
-
./install_clean.sh
-
cd ../test
-
. ./backend/install_clean_vars.sh
-
install_clean.sh 'base lib-dynamics lib-gast lib-platform test test-properties'
-
make test
backend
:
...
...
Makefile
0 → 100644
View file @
f6a7c350
CLM
:=
clm
BACKEND_LIBS
:=
\
-I
backend
\
-I
backend/Cloogle
\
-I
backend/Cloogle/libcloogle
\
-I
backend/Cloogle/CleanRegex
\
-IL
Platform
CLMFLAGS
:=
$(BACKEND_LIBS)
-nr
-nt
BACKEND_BIN
:=
builtin_syntax
BACKEND_TEST
:=
$(
addprefix
test_,
$(BACKEND_BIN)
)
test
:
$(BACKEND_TEST) test_properties
$(BACKEND_TEST)
:
test_%: backend/test/%
./
$<
$(addprefix backend/test/,$(BACKEND_BIN))
:
.FORCE
$(CLM)
-I
$(
dir
$@
)
$(CLMFLAGS)
$(
notdir
$@
)
-o
$@
test_properties
:
.FORCE
cleantest
\
--hide
start
\
--run
testproperties
\
$(
addprefix
-O
,-d backend
$(BACKEND_LIBS)
-P
OutputTestEvents
-r
)
.FORCE
:
.PHONY
:
test .FORCE
backend/Builtin/Syntax.dcl
View file @
f6a7c350
definition
module
Builtin
.
Syntax
/**
* @property-bootstrap
* import StdEnv
* from Data.Func import mapSt
* import Data.List
* import Text
* import Regex
* from Cloogle.API import :: SyntaxExample{..}
* import Cloogle.DB
*
* // ggen isn't usually used, but required to satisfy constraints
* ggen{|SyntaxEntry|} _ = []
* derive genShow SyntaxEntry, SyntaxExample, CleanLangReportLocation, Regex, Maybe, GroupId
* gPrint{|SyntaxEntry|} se ps = gPrint{|*|} se.syntax_title ps
*
* example_lines :: !SyntaxEntry -> [String]
* example_lines se = concatMap (split "\n")
* [replaceSubString "\t" " " e.example \\ e <- se.syntax_examples]
*
* @property-test-generator list: SyntaxEntry
* builtin_syntax
*/
from
Cloogle
.
DB
import
::
SyntaxEntry
/**
* @property has examples: A.se :: SyntaxEntry:
* not (isMember se.syntax_title ["array update", "record update"])
* ==> not (isEmpty se.syntax_examples)
*
* @property comment alignment (at most two different levels): A.se :: SyntaxEntry:
* length (removeDup comment_columns) < 3
* where
* comment_columns = filter ((<>) -1) [indexOf "//" l \\ l <- example_lines se]
*
* @property spaces around comment markers: A.se :: SyntaxEntry:
* isEmpty (filter bad (example_lines se))
* where
* bad s = case indexOf "//" s of
* -1 -> False
* i -> s.[i-1] <> ' ' || s.[i+2] <> ' '
*
* @property spaces in list comprehensions: A.se :: SyntaxEntry:
* isEmpty (filter bad (example_lines se))
* where
* bad s
* # s = replaceSubString "'\\\\'" "" s // special case for '\\' in basic_values
* # (results,_) = mapSt check ["<|-","<-:","<-","\\\\"] s
* = or results
*
* check op s
* # new = replaceSubString (" " +++ op +++ " ") "" s
* = (indexOf op new >= 0, new)
*/
builtin_syntax
::
[
SyntaxEntry
]
backend/Builtin/Syntax.icl
View file @
f6a7c350
...
...
@@ -164,7 +164,10 @@ bs_comments =
,
syntax_code
=
[
"// ..."
,
"/* ... */"
]
,
syntax_description
=
"`//` adds a single-line comment. `/*` and `*/` encapsulate a multi-line comment. Multi-line comments can be nested."
,
syntax_doc_locations
=
[
CLR
15
"B.2"
"_Toc311798132"
]
,
syntax_examples
=
[]
,
syntax_examples
=
map
EX
[
"Start = 37 // Single-line comment"
,
"Start = /* inline or multi-line comment */ 37"
]
}
bs_context
=
...
...
backend/build.sh
View file @
f6a7c350
#!/bin/bash
set
-ev
./install_clean.sh
.
./install_clean_vars.sh
install_clean.sh
'base lib-platform lib-tcpip'
sed
-i
's/cocl/cocl::-wmf/'
/opt/clean/etc/IDEEnvs
PACKAGES
=
"patch jq unzip z3"
...
...
backend/install_clean.sh
deleted
100755 → 0
View file @
88cf37d6
#!/bin/bash
set
-ev
PATCHCLEANBUILD
=
"sed -i 's:clean-compiler-and-rts compiler itask:cstaps compiler master:' clean-base/linux-x64/git-sources.txt; sed -i 's:compiler-itask:compiler-master:' clean-base/linux-x64/build.sh; sed -i 's:master:cloogle:' clean-lib-platform/linux-x64/git-sources.txt; sed -i 's:platform-master:platform-cloogle:' clean-lib-platform/linux-x64/build.sh"
install_clean.sh
'base lib-dynamics lib-platform lib-tcpip'
2019-01-27
backend/install_clean_vars.sh
0 → 100755
View file @
f6a7c350
#!/bin/bash
PATCHCLEANBUILD
=
"sed -i 's:clean-compiler-and-rts compiler itask:cstaps compiler cloogle:' clean-base/linux-x64/git-sources.txt"
PATCHCLEANBUILD
=
"
$PATCHCLEANBUILD
;sed -i 's:compiler-itask:compiler-cloogle:' clean-base/linux-x64/build.sh"
PATCHCLEANBUILD
=
"
$PATCHCLEANBUILD
;sed -i 's:master:cloogle:' clean-lib-platform/linux-x64/git-sources.txt"
PATCHCLEANBUILD
=
"
$PATCHCLEANBUILD
;sed -i 's:platform-master:platform-cloogle:' clean-lib-platform/linux-x64/build.sh"
export
PATCHCLEANBUILD
export
CLEANDATE
=
"2019-01-30"
test/builtin_syntax.icl
→
backend/
test/builtin_syntax.icl
View file @
f6a7c350
...
...
@@ -6,7 +6,6 @@ import StdMaybe
import
Clean
.
Types
import
Clean
.
Types
.
Parse
from
Data
.
Func
import
mapSt
,
seqSt
import
Data
.
List
import
System
.
CommandLine
import
System
.
Directory
import
System
.
File
...
...
@@ -52,9 +51,6 @@ Start w
test
::
!
SyntaxEntry
!*(!
Int
,
!
Int
,
!*
World
)
->
*(!
Int
,
!
Int
,
!*
World
)
test
se
(
i
,
failed
,
w
)
#
(
comments_ok
,
i
,
w
)
=
check_style
se
(
i
,
w
)
#
failed
=
failed
+
if
comments_ok
0
1
#
err
=
stderr
<<<
"Checking syntax for '"
<<<
se
.
syntax_title
<<<
"': "
#
(_,
w
)
=
fclose
err
w
#
(
results
,(
j
,
w
))
=
mapSt
test_example
se
.
syntax_examples
(
i
,
w
)
...
...
@@ -67,59 +63,6 @@ test se (i,failed,w)
=
(
j
,
failed
+
length
[
f
\\
f
=:
False
<-
results
],
w
)
check_style
::
!
SyntaxEntry
!*(!
Int
,
!*
World
)
->
*(!
Bool
,
!
Int
,
!*
World
)
check_style
se
(
i
,
w
)
#
err
=
stderr
#
err
=
if
comment_alignment_ok
err
(
err
<<<
"
\033
[0;31mComment alignment is inconsistent for '"
<<<
se
.
syntax_title
<<<
"' (at most two different levels may be used):
\033
[0m
\n\t
"
<<<
join
"
\n\t
"
example_lines
<<<
"
\n
"
)
#
err
=
case
no_spaces_around_comments
of
[]
->
err
ns
->
err
<<<
"
\033
[0;31mThese lines in '"
<<<
se
.
syntax_title
<<<
"' contain comments without spaces around the '//':
\033
[0m
\n\t
"
<<<
join
"
\n\t
"
ns
<<<
"
\n
"
#
err
=
case
missing_spaces
of
[]
->
err
ns
->
err
<<<
"
\033
[0;31mThese lines in '"
<<<
se
.
syntax_title
<<<
"' contain list comprehension elements without spaces around them:
\033
[0m
\n\t
"
<<<
join
"
\n\t
"
ns
<<<
"
\n
"
#
(_,
w
)
=
fclose
err
w
=
(
True
,
i
+1
,
w
)
where
example_lines
=
concatMap
(
split
"
\n
"
)
[
replaceSubString
"
\t
"
" "
e
.
example
\\
e
<-
se
.
syntax_examples
]
comment_alignment_ok
=
length
(
removeDup
comments
)
<
3
where
comments
=
filter
((<>)
-1
)
[
indexOf
"//"
l
\\
l
<-
example_lines
]
no_spaces_around_comments
=
filter
bad
example_lines
where
bad
s
=
case
indexOf
"//"
s
of
-1
->
False
i
->
s
.[
i
-1
]
<>
' '
||
s
.[
i
+2
]
<>
' '
missing_spaces
=
filter
bad
example_lines
where
bad
s
#
s
=
replaceSubString
"'
\\\\
'"
""
s
// special case for '\\' in basic_values
#
(
results
,_)
=
mapSt
check
[
"<|-"
,
"<-:"
,
"<-"
,
"
\\\\
"
]
s
=
or
results
check
op
s
#
new
=
replaceSubString
(
" "
+++
op
+++
" "
)
""
s
=
(
indexOf
op
new
>=
0
,
new
)
test_example
::
!
SyntaxExample
!*(!
Int
,
!*
World
)
->
*(!
Bool
,
!*(!
Int
,
!*
World
))
test_example
{
example
,
cleanjs_start
,
bootstrap
,
requires_itask_compiler
}
(
i
,
w
)
|
requires_itask_compiler
...
...
test/Makefile
deleted
100644 → 0
View file @
88cf37d6
CLM
:=
clm
CLMFLAGS
:=
-nr
-nt
\
-I
../backend
\
-I
../backend/Cloogle
\
-I
../backend/Cloogle/libcloogle
\
-I
../backend/Cloogle/CleanRegex
\
-IL
Platform
BIN
:=
builtin_syntax
TEST
:=
$(
addprefix
test_,
$(BIN)
)
test
:
$(TEST)
$(TEST)
:
test_%: %
./
$<
$(BIN)
:
.FORCE
$(CLM)
$(CLMFLAGS)
$@
-o
$@
.FORCE
:
.PHONY
:
test .FORCE
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