Skip to content
Snippets Groups Projects
Verified Commit 12c4b662 authored by Tóth Miklós Tibor's avatar Tóth Miklós Tibor :shrug:
Browse files

comm diag

parent 3c895f8e
No related branches found
No related tags found
No related merge requests found
Pipeline #6813 passed
......@@ -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(seqb)
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
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment