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
298aa3c8
Verified
Commit
298aa3c8
authored
Mar 16, 2021
by
Tóth Miklós Tibor
Browse files
Options
Downloads
Patches
Plain Diff
oof
parent
2cfa948f
Branches
Branches containing commit
Tags
5.2.5
Tags containing commit
No related merge requests found
Pipeline
#6801
passed
Mar 16, 2021
Stage: build
Stage: docker
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
plab/main.go
+2
-1
2 additions, 1 deletion
plab/main.go
plab/tests/runtest.go
+34
-0
34 additions, 0 deletions
plab/tests/runtest.go
plab/tests/testsToLatex.go
+72
-0
72 additions, 0 deletions
plab/tests/testsToLatex.go
with
108 additions
and
1 deletion
plab/main.go
+
2
−
1
View file @
298aa3c8
...
...
@@ -2,11 +2,12 @@ package main
import
(
"git.sch.bme.hu/insert-epic-projlab-team-name-here/tooling/plab/helpers"
"git.sch.bme.hu/insert-epic-projlab-team-name-here/tooling/plab/tests"
"os"
)
func
main
()
{
mainCmds
:=
helpers
.
CmdFrom
(
os
.
Args
[
0
],
"go projlab tool"
,
Timetable
,
Javadoc
,
Classdiag
,
Check
)
mainCmds
:=
helpers
.
CmdFrom
(
os
.
Args
[
0
],
"go projlab tool"
,
Timetable
,
Javadoc
,
Classdiag
,
Check
,
tests
.
TestsToLatex
)
if
len
(
os
.
Args
)
<
2
{
os
.
Args
=
append
(
os
.
Args
,
"help"
)
}
...
...
This diff is collapsed.
Click to expand it.
plab/tests/runtest.go
0 → 100644
+
34
−
0
View file @
298aa3c8
package
tests
import
(
"fmt"
"io"
"os"
"os/exec"
)
func
runTest
(
name
string
)
error
{
fmt
.
Println
(
name
)
cmd
:=
exec
.
Command
(
"java"
,
"-jar"
,
"../src/projlab.jar"
)
file
,
err
:=
os
.
Open
(
name
)
if
err
!=
nil
{
return
err
}
stdin
,
err
:=
cmd
.
StdinPipe
()
if
err
!=
nil
{
return
err
}
_
,
err
=
io
.
Copy
(
stdin
,
file
)
if
err
!=
nil
{
return
err
}
err
=
stdin
.
Close
()
if
err
!=
nil
{
return
err
}
b
,
err
:=
cmd
.
CombinedOutput
()
if
err
!=
nil
{
fmt
.
Println
(
string
(
b
))
}
return
err
}
This diff is collapsed.
Click to expand it.
plab/tests/testsToLatex.go
0 → 100644
+
72
−
0
View file @
298aa3c8
package
tests
import
(
"bytes"
"fmt"
"git.sch.bme.hu/insert-epic-projlab-team-name-here/tooling/plab/helpers"
"io/ioutil"
"os"
"os/exec"
"strings"
)
var
TestsToLatex
=
helpers
.
Subcommand
{
Name
:
"testtolatex"
,
Command
:
func
(
args
[]
string
)
{
const
dir
=
"../tests/"
tests
,
e
:=
ioutil
.
ReadDir
(
dir
)
if
e
!=
nil
{
panic
(
e
)
}
var
buf
bytes
.
Buffer
for
_
,
t
:=
range
tests
{
e
:=
runTest
(
dir
+
t
.
Name
())
if
e
!=
nil
{
panic
(
e
)
}
e
=
plantumlToLatex
()
if
e
!=
nil
{
panic
(
e
)
}
b
,
e
:=
ioutil
.
ReadFile
(
"../seq.latex"
)
buf
.
WriteString
(
"
\\
subsubsection{"
)
testname
:=
""
tmp
:=
strings
.
Split
(
t
.
Name
(),
"."
)
for
i
,
part
:=
range
tmp
{
if
i
<
len
(
tmp
)
-
1
{
testname
+=
part
}
if
i
<
len
(
tmp
)
-
2
{
testname
+=
"."
}
}
buf
.
WriteString
(
testname
)
buf
.
WriteString
(
"}
\n
"
)
buf
.
WriteString
(
`
\begin{figure}[H]
\begin{center}
\resizebox*{!}{\textheight-2cm}{`
)
buf
.
Write
(
b
)
buf
.
WriteString
(
`
}
\end{center}
\end{figure}
`
)
buf
.
WriteString
(
"
\n\\
newpage
\n
"
)
}
e
=
ioutil
.
WriteFile
(
"/tmp/testseq.latex"
,
buf
.
Bytes
(),
os
.
ModePerm
)
if
e
!=
nil
{
panic
(
e
)
}
},
Help
:
"gen seq from test into latex"
,
}
func
plantumlToLatex
()
error
{
b
,
e
:=
exec
.
Command
(
"plantuml"
,
"-tlatex:nopreamble"
,
"../seq.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