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

Last change on this file since 518 was 518, checked in by dubos, 8 years ago

Testing : fix bash/post.sh

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