From 19b280e089b5218a68c8a271326c2f37f854071f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Oct 2017 08:20:51 +0200 Subject: [PATCH] Add persist to gnuplot terminal --- src/tests/common-files/gnuplot_i.h | 6 ++--- .../unit-tests/arithmetic/fft_length_test.cc | 25 +++---------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 9427bcaac..183e51101 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -1050,7 +1050,7 @@ Gnuplot& Gnuplot::set_smooth(const std::string &stylestr) Gnuplot& Gnuplot::showonscreen() { cmd("set output"); - cmd("set terminal " + Gnuplot::terminal_std); + cmd("set terminal " + Gnuplot::terminal_std + " persist"); return *this; } @@ -1062,10 +1062,8 @@ Gnuplot& Gnuplot::showonscreen() // Gnuplot& Gnuplot::savetops(const std::string &filename) { - cmd("set terminal postscript color"); - std::ostringstream cmdstr; - cmdstr << "set term postscript\n"; + cmdstr << "set term postscript landscape enhanced color dashed \"Times-Roman\" 18\n"; cmdstr << "set output \"" << filename << ".ps\"\n"; cmdstr << "replot"; cmd(cmdstr.str()); diff --git a/src/tests/unit-tests/arithmetic/fft_length_test.cc b/src/tests/unit-tests/arithmetic/fft_length_test.cc index 1b7a98427..e04455c04 100644 --- a/src/tests/unit-tests/arithmetic/fft_length_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_length_test.cc @@ -46,26 +46,10 @@ DEFINE_int32(fft_iterations_test, 1000, "Number of averaged iterations in FFT length timing test"); -DEFINE_bool(plot_fft_length_test, false, "Plots results of FFTLengthTest"); - - -class FFTLengthTest: public ::testing::Test -{ -public: - void wait_for_key(); -}; - - -void FFTLengthTest::wait_for_key() -{ - std::cout << std::endl << "Press ENTER to continue..." << std::endl; - - std::cin.clear(); - std::cin.ignore(std::cin.rdbuf()->in_avail()); - std::cin.get(); - return; -} +DEFINE_bool(plot_fft_length_test, false, "Plots results of FFTLengthTest with gnuplot"); +// Note from FFTW documentation: the standard FFTW distribution works most efficiently for arrays whose +// size can be factored into small primes (2, 3, 5, and 7), and otherwise it uses a slower general-purpose routine. TEST_F(FFTLengthTest, MeasureExecutionTime) { @@ -160,9 +144,6 @@ TEST_F(FFTLengthTest, MeasureExecutionTime) g2.set_style("points").plot_xy(powers_of_two, execution_times_powers_of_two, "Power of 2"); g2.savetops("FFT_execution_times"); g2.showonscreen(); // window output -#if !defined __APPLE__ - wait_for_key(); -#endif } catch (GnuplotException ge) {