The intention is to create a library of convenient building blocks; providing a visualisation should be as simple as invoking a free function with CSV data, yet with the ability to tweak some lables or display variations if desired. This can be achieved by.. * having a series of ready-made standard visualisations * expose a function call for each, accepting a data-context builder * provide secondary convenience shortcuts, which add some of the expected bindings * notably a shortcut is provided to take the data as CSV-string * augmented by a wrapper/builder to allow defining data points inline
150 lines
3.8 KiB
C++
150 lines
3.8 KiB
C++
/*
|
|
GnuplotGen(Test) - verify the minimalistic text substitution engine
|
|
|
|
Copyright (C) Lumiera.org
|
|
2024, Hermann Vosseler <Ichthyostega@web.de>
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License as
|
|
published by the Free Software Foundation; either version 2 of
|
|
the License, or (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
* *****************************************************/
|
|
|
|
/** @file gnuplot-gen-test.cpp
|
|
** unit test \ref GnuplotGen_test
|
|
*/
|
|
|
|
|
|
|
|
#include "lib/test/run.hpp"
|
|
#include "lib/test/test-helper.hpp"///////////////////////TODO
|
|
#include "lib/gnuplot-gen.hpp"
|
|
#include "lib/iter-explorer.hpp"
|
|
#include "lib/format-cout.hpp"///////////////////////TODO
|
|
#include "lib/test/diagnostic-output.hpp"///////////////////////TODO
|
|
|
|
//#include <chrono>
|
|
#include <array>
|
|
|
|
using std::array;
|
|
|
|
|
|
namespace lib {
|
|
namespace test {
|
|
|
|
using gnuplot_gen::CSVData;
|
|
|
|
|
|
/***************************************************************************//**
|
|
* @test verify data visualisation by generated Gnuplot scripts
|
|
* - generate a simple pot
|
|
* - generate a scatter plot with regression line
|
|
* @see gnuplot-gen.hpp
|
|
* @see TextTemplate_test
|
|
*/
|
|
class GnuplotGen_test : public Test
|
|
{
|
|
|
|
virtual void
|
|
run (Arg)
|
|
{
|
|
simpeUsage();
|
|
verify_instantiation();
|
|
verify_keySubstituton();
|
|
verify_conditional();
|
|
verify_iteration();
|
|
verify_Map_binding();
|
|
verify_ETD_binding();
|
|
|
|
}
|
|
|
|
|
|
/** @test TODO
|
|
* @todo WIP 4/24 🔁 define ⟶ implement
|
|
*/
|
|
void
|
|
simpeUsage()
|
|
{
|
|
string gnuplot = gnuplot_gen::dataPlot (CSVData{{"step","fib"}
|
|
,{{0,1}
|
|
,{1,1}
|
|
,{2,2}
|
|
,{3,3}
|
|
,{4,5}
|
|
,{5,8}
|
|
,{6,13}
|
|
,{7,21}
|
|
}});
|
|
cout << gnuplot <<endl;
|
|
}
|
|
|
|
|
|
/** @test TODO
|
|
* @todo WIP 4/24 🔁 define ⟶ implement
|
|
*/
|
|
void
|
|
verify_instantiation()
|
|
{
|
|
}
|
|
|
|
|
|
/** @test TODO
|
|
* @todo WIP 4/24 🔁 define ⟶ implement
|
|
*/
|
|
void
|
|
verify_keySubstituton()
|
|
{
|
|
UNIMPLEMENTED ("nebbich");
|
|
}
|
|
|
|
|
|
/** @test TODO
|
|
* @todo WIP 4/24 🔁 define ⟶ implement
|
|
*/
|
|
void
|
|
verify_conditional()
|
|
{
|
|
}
|
|
|
|
|
|
/** @test TODO
|
|
* @todo WIP 4/24 🔁 define ⟶ implement
|
|
*/
|
|
void
|
|
verify_iteration()
|
|
{
|
|
}
|
|
|
|
|
|
/** @test TODO
|
|
* @todo WIP 4/24 🔁 define ⟶ implement
|
|
*/
|
|
void
|
|
verify_Map_binding()
|
|
{
|
|
}
|
|
|
|
|
|
/** @test TODO
|
|
* @todo WIP 4/24 🔁 define ⟶ implement
|
|
*/
|
|
void
|
|
verify_ETD_binding()
|
|
{
|
|
}
|
|
};
|
|
|
|
LAUNCHER (GnuplotGen_test, "unit common");
|
|
|
|
|
|
}} // namespace lib::test
|