Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tooling
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
insert epic projlab name here
Tooling
Commits
12c4b662
Verified
Commit
12c4b662
authored
Mar 16, 2021
by
Tóth Miklós Tibor
Browse files
Options
Downloads
Patches
Plain Diff
comm diag
parent
3c895f8e
No related branches found
No related tags found
No related merge requests found
Pipeline
#6813
passed
Mar 16, 2021
Stage: build
Stage: docker
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
plab/tests/testsToLatex.go
+42
-10
42 additions, 10 deletions
plab/tests/testsToLatex.go
with
42 additions
and
10 deletions
plab/tests/testsToLatex.go
+
42
−
10
View file @
12c4b662
...
...
@@ -18,7 +18,8 @@ var TestsToLatex = helpers.Subcommand{
if
e
!=
nil
{
panic
(
e
)
}
var
buf
bytes
.
Buffer
var
seq
bytes
.
Buffer
var
com
bytes
.
Buffer
for
_
,
t
:=
range
tests
{
e
:=
runTest
(
dir
+
t
.
Name
())
if
e
!=
nil
{
...
...
@@ -28,8 +29,16 @@ var TestsToLatex = helpers.Subcommand{
if
e
!=
nil
{
panic
(
e
)
}
b
,
e
:=
ioutil
.
ReadFile
(
"../seq.latex"
)
buf
.
WriteString
(
"
\\
subsubsection{"
)
seqb
,
e
:=
ioutil
.
ReadFile
(
"../seq.latex"
)
if
e
!=
nil
{
panic
(
e
)
}
commb
,
e
:=
ioutil
.
ReadFile
(
"../comm.latex"
)
if
e
!=
nil
{
panic
(
e
)
}
seq
.
WriteString
(
"
\\
subsubsection{"
)
com
.
WriteString
(
"
\\
subsubsection{"
)
testname
:=
""
tmp
:=
strings
.
Split
(
t
.
Name
(),
"."
)
for
i
,
part
:=
range
tmp
{
...
...
@@ -40,21 +49,39 @@ var TestsToLatex = helpers.Subcommand{
testname
+=
"."
}
}
buf
.
WriteString
(
testname
)
buf
.
WriteString
(
"}
\n
"
)
buf
.
WriteString
(
`
seq
.
WriteString
(
testname
)
com
.
WriteString
(
testname
)
seq
.
WriteString
(
"}
\n
"
)
com
.
WriteString
(
"}
\n
"
)
seq
.
WriteString
(
`
\begin{figure}[H]
\begin{center}
\resizebox{\textwidth}{\textheight-2cm}{`
)
buf
.
Write
(
b
)
buf
.
WriteString
(
`
seq
.
Write
(
seq
b
)
seq
.
WriteString
(
`
}
\end{center}
\end{figure}
`
)
buf
.
WriteString
(
"
\n\\
newpage
\n
"
)
seq
.
WriteString
(
"
\n\\
newpage
\n
"
)
com
.
WriteString
(
`
\begin{figure}[H]
\begin{center}
\resizebox{\textwidth}{\textheight-2cm}{`
)
com
.
Write
(
commb
)
com
.
WriteString
(
`
}
e
=
ioutil
.
WriteFile
(
"/tmp/testseq.latex"
,
buf
.
Bytes
(),
os
.
ModePerm
)
\end{center}
\end{figure}
`
)
com
.
WriteString
(
"
\n\\
newpage
\n
"
)
}
e
=
ioutil
.
WriteFile
(
"/tmp/testseq.latex"
,
seq
.
Bytes
(),
os
.
ModePerm
)
if
e
!=
nil
{
panic
(
e
)
}
e
=
ioutil
.
WriteFile
(
"/tmp/testcom.latex"
,
com
.
Bytes
(),
os
.
ModePerm
)
if
e
!=
nil
{
panic
(
e
)
}
...
...
@@ -68,5 +95,10 @@ func plantumlToLatex() error {
fmt
.
Println
(
string
(
b
))
return
e
}
b
,
e
=
exec
.
Command
(
"plantuml"
,
"-tlatex:nopreamble"
,
"../comm.puml"
)
.
CombinedOutput
()
if
e
!=
nil
{
fmt
.
Println
(
string
(
b
))
return
e
}
return
nil
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment