QA: Move io_benchmark into common_tools

This commit is contained in:
John Beard 2018-12-24 14:43:08 +00:00 committed by Wayne Stambaugh
parent 267e17d539
commit bb2e402bc7
6 changed files with 47 additions and 29 deletions

View File

@ -34,6 +34,8 @@ add_executable( qa_common_tools
main.cpp main.cpp
tools/coroutines/coroutines.cpp tools/coroutines/coroutines.cpp
tools/io_benchmark/io_benchmark.cpp
) )
include_directories( include_directories(

View File

@ -24,6 +24,7 @@
#include <common.h> #include <common.h>
#include "tools/coroutines/coroutine_tools.h" #include "tools/coroutines/coroutine_tools.h"
#include "tools/io_benchmark/io_benchmark.h"
#include <wx/cmdline.h> #include <wx/cmdline.h>
@ -35,6 +36,7 @@
*/ */
const static std::vector<UTILITY_PROGRAM*> known_tools = { const static std::vector<UTILITY_PROGRAM*> known_tools = {
&coroutine_tool, &coroutine_tool,
&io_benchmark_tool,
}; };

View File

@ -21,6 +21,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "io_benchmark.h"
#include <wx/wx.h> #include <wx/wx.h>
#include <richio.h> #include <richio.h>
@ -377,13 +379,7 @@ BENCH_REPORT executeBenchMark( const BENCHMARK& aBenchmark, int aReps,
} }
enum RET_CODES int io_benchmark_func( int argc, char* argv[] )
{
BAD_ARGS = 1,
};
int main( int argc, char* argv[] )
{ {
auto& os = std::cout; auto& os = std::cout;
@ -392,7 +388,7 @@ int main( int argc, char* argv[] )
os << "Usage: " << argv[0] << " <FILE> <REPS> [" << getBenchFlags() << "]\n\n"; os << "Usage: " << argv[0] << " <FILE> <REPS> [" << getBenchFlags() << "]\n\n";
os << "Benchmarks:\n"; os << "Benchmarks:\n";
os << getBenchDescriptions(); os << getBenchDescriptions();
return BAD_ARGS; return RET_CODES::BAD_CMDLINE;
} }
wxFileName inFile( argv[1] ); wxFileName inFile( argv[1] );
@ -423,5 +419,12 @@ int main( int argc, char* argv[] )
<< std::endl;; << std::endl;;
} }
return 0; return RET_CODES::OK;
} }
UTILITY_PROGRAM io_benchmark_tool = {
"io_benchmark",
"Benchmark various kinds of IO methods",
io_benchmark_func,
};

View File

@ -0,0 +1,31 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* 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, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef IO_BENCHMARK_H
#define IO_BENCHMARK_H
#include <utility_program.h>
extern UTILITY_PROGRAM io_benchmark_tool;
#endif // IO_BENCHMARK_H

View File

@ -45,6 +45,3 @@ target_link_libraries( utf8_tests
common common
${wxWidgets_LIBRARIES} ${wxWidgets_LIBRARIES}
) )
add_subdirectory( io_benchmark )

View File

@ -1,17 +0,0 @@
include_directories( BEFORE ${INC_BEFORE} )
set( IOBENCHMARK_SRCS
io_benchmark.cpp
)
add_executable( io_benchmark
${IOBENCHMARK_SRCS}
)
target_link_libraries( io_benchmark
common
qa_utils
${wxWidgets_LIBRARIES}
)