1166 |
13 Aug 10 |
peter |
// $Id$ |
1166 |
13 Aug 10 |
peter |
2 |
|
1166 |
13 Aug 10 |
peter |
3 |
/* |
1180 |
24 Aug 10 |
peter |
Copyright (C) 2010 Jari Häkkinen, Peter Johansson |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2011, 2023 Peter Johansson |
1166 |
13 Aug 10 |
peter |
6 |
|
1166 |
13 Aug 10 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
1166 |
13 Aug 10 |
peter |
8 |
|
1166 |
13 Aug 10 |
peter |
svndigest is free software; you can redistribute it and/or modify it |
1166 |
13 Aug 10 |
peter |
under the terms of the GNU General Public License as published by |
1166 |
13 Aug 10 |
peter |
the Free Software Foundation; either version 3 of the License, or |
1166 |
13 Aug 10 |
peter |
(at your option) any later version. |
1166 |
13 Aug 10 |
peter |
13 |
|
1166 |
13 Aug 10 |
peter |
svndigest is distributed in the hope that it will be useful, but |
1166 |
13 Aug 10 |
peter |
WITHOUT ANY WARRANTY; without even the implied warranty of |
1166 |
13 Aug 10 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1166 |
13 Aug 10 |
peter |
General Public License for more details. |
1166 |
13 Aug 10 |
peter |
18 |
|
1166 |
13 Aug 10 |
peter |
You should have received a copy of the GNU General Public License |
1166 |
13 Aug 10 |
peter |
along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
1166 |
13 Aug 10 |
peter |
21 |
*/ |
1166 |
13 Aug 10 |
peter |
22 |
|
1619 |
12 Mar 23 |
peter |
23 |
#include <config.h> |
1619 |
12 Mar 23 |
peter |
24 |
|
1166 |
13 Aug 10 |
peter |
25 |
#include "Suite.h" |
1166 |
13 Aug 10 |
peter |
26 |
|
1166 |
13 Aug 10 |
peter |
27 |
#include "lib/Graph.h" |
1188 |
01 Sep 10 |
peter |
28 |
#include "lib/Vector.h" |
1166 |
13 Aug 10 |
peter |
29 |
|
1166 |
13 Aug 10 |
peter |
30 |
#include <cstdlib> |
1167 |
14 Aug 10 |
peter |
31 |
#include <ostream> |
1166 |
13 Aug 10 |
peter |
32 |
|
1166 |
13 Aug 10 |
peter |
33 |
using namespace theplu::svndigest; |
1166 |
13 Aug 10 |
peter |
34 |
|
1167 |
14 Aug 10 |
peter |
35 |
void test_graph(const std::string format, test::Suite& suite); |
1167 |
14 Aug 10 |
peter |
36 |
void test_graph__(const std::string format, test::Suite& suite); |
1167 |
14 Aug 10 |
peter |
37 |
|
1166 |
13 Aug 10 |
peter |
38 |
int main(int argc, char* argv[]) |
1166 |
13 Aug 10 |
peter |
39 |
{ |
1166 |
13 Aug 10 |
peter |
40 |
test::Suite suite(argc, argv); |
1166 |
13 Aug 10 |
peter |
41 |
|
1166 |
13 Aug 10 |
peter |
42 |
#ifndef HAVE_PLPLOT |
1166 |
13 Aug 10 |
peter |
43 |
suite.out() << "no plplot: skip test\n"; |
1166 |
13 Aug 10 |
peter |
44 |
exit(EXIT_SKIP); |
1166 |
13 Aug 10 |
peter |
45 |
#endif |
1166 |
13 Aug 10 |
peter |
46 |
|
1170 |
20 Aug 10 |
jari |
47 |
test_graph("svg", suite); |
1167 |
14 Aug 10 |
peter |
48 |
test_graph("png", suite); |
1167 |
14 Aug 10 |
peter |
49 |
test_graph("pdf", suite); |
1167 |
14 Aug 10 |
peter |
50 |
|
1188 |
01 Sep 10 |
peter |
51 |
return suite.exit_status(); |
1166 |
13 Aug 10 |
peter |
52 |
} |
1167 |
14 Aug 10 |
peter |
53 |
|
1167 |
14 Aug 10 |
peter |
54 |
|
1167 |
14 Aug 10 |
peter |
55 |
void test_graph(const std::string format, test::Suite& suite) |
1167 |
14 Aug 10 |
peter |
56 |
{ |
1167 |
14 Aug 10 |
peter |
57 |
suite.out() << "testing " << format << std::endl; |
1167 |
14 Aug 10 |
peter |
58 |
for (size_t i=0; i<20; ++i) |
1167 |
14 Aug 10 |
peter |
59 |
test_graph__(format, suite); |
1167 |
14 Aug 10 |
peter |
60 |
} |
1167 |
14 Aug 10 |
peter |
61 |
|
1167 |
14 Aug 10 |
peter |
62 |
|
1167 |
14 Aug 10 |
peter |
63 |
void test_graph__(const std::string format, test::Suite& suite) |
1167 |
14 Aug 10 |
peter |
64 |
{ |
1167 |
14 Aug 10 |
peter |
65 |
std::string filename("plot."); |
1167 |
14 Aug 10 |
peter |
66 |
filename+=format; |
1167 |
14 Aug 10 |
peter |
67 |
Graph graph(filename, format); |
1167 |
14 Aug 10 |
peter |
68 |
graph.ymax(10); |
1167 |
14 Aug 10 |
peter |
69 |
graph.current_color(255, 0, 0); |
1188 |
01 Sep 10 |
peter |
70 |
SumVector data; |
1333 |
27 Jan 11 |
peter |
71 |
graph.rev_max(100); |
1188 |
01 Sep 10 |
peter |
72 |
data.set(99,1); |
1167 |
14 Aug 10 |
peter |
73 |
graph.plot(data, "label", 1); |
1167 |
14 Aug 10 |
peter |
74 |
} |