source: configs/testing/bash/post.sh @ 560

Last change on this file since 560 was 560, checked in by dubos, 7 years ago

testing : fix some issues with auto-generated correctness report

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/bash
2
3function to_latex() {
4echo "$1" | sed 's/_/\\_/g'
5}
6
7function svn_info() {
8    cd $1
9    svn info | grep URL
10    echo '\\'
11    svn info | grep Revision
12    echo '\\'
13}
14
15function abstract()
16{
17    cd $ROOT
18    hostname ; echo '\\'
19    pwd ; echo '\\'
20    ls -l DYNAMICO ; echo '\\'
21    svn_info $ROOT/XIOS
22    svn_info $ROOT/DYNAMICO
23    svn_info $ROOT
24}
25
26function all_results()
27{
28    cd $ROOT/RUNS
29    for TEST in * ; do
30        NAME=$(to_latex $TEST)
31        echo "\subsection{$NAME}"
32        grep Elapsed logs/gcm.log
33        echo
34        for GRAPH in $(ls $TEST/*.png) ; do
35            cat <<EOF
36\begin{figure}
37\centering{}
38\includegraphics[scale=0.5]{$ROOT/RUNS/$GRAPH}
39\caption{$NAME}
40\end{figure}
41EOF
42        done
43        echo '\newpage{}'
44    done
45#    cd $ROOT/tmp
46}
47
48function all_params()
49{
50    cd $ROOT/RUNS
51    for TEST in * ; do
52        NAME=$(to_latex $TEST)
53        cat <<EOF
54\subsection{$NAME}
55\begin{lstlisting}
56$(cat $TEST/run.def)
57\end{lstlisting}
58EOF
59    done
60#    cd $ROOT/tmp
61}
62
63ROOT=$PWD
64
65for dir in $ROOT/RUNS/* ; do
66    cd $dir
67    echo
68    pwd
69    ls -l post.py netcdf
70    python post.py &
71done
72wait
73
74cd $ROOT/tmp
75rm -f *.aux *.log *.toc *.tex
76
77cat <<EOF >report.tex
78\documentclass[10pt,a4paper,english]{article}
79\usepackage{graphicx}
80\usepackage{listings}
81% the line below tries to avoid font issues on Curie
82\usepackage{lmodern}
83\usepackage[T1]{fontenc}
84\usepackage[latin9]{inputenc}
85\usepackage{color}
86\usepackage{babel}
87\usepackage[unicode=true,pdfusetitle,
88 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
89 breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=true]
90 {hyperref}
91\usepackage{geometry}
92\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
93
94\begin{document}
95
96\title{DYNAMICO correctness report ($arch)}
97\date{}
98\author{Thomas Dubos}
99\maketitle
100
101\begin{abstract}
102$(to_latex "$(abstract)")
103\end{abstract}
104
105\tableofcontents{}
106\section{Results}
107$(all_results)
108
109\twocolumn
110
111\section{Parameters}
112$(all_params)
113\end{document}
114EOF
115
116pdflatex -interaction=batchmode report.tex
117pdflatex -interaction=batchmode report.tex
118mailx -s "DYNAMICO correctness report " -a report.pdf dubos@lmd.polytechnique.fr </dev/null
Note: See TracBrowser for help on using the repository browser.