Skip to content

Goto-harness, memory analyzer: print version, help to stdout #6934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/goto-harness/common_harness_generator_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ Author: Diffblue Ltd.
" (default: 2)\n" \
"--" COMMON_HARNESS_GENERATOR_FUNCTION_POINTER_CAN_BE_NULL_OPT \
" <function-name>, name of the function(s) pointer parameters\n" \
" that can be NULL pointing." \
" that can be NULL pointing.\n" \
"--" COMMON_HARNESS_GENERATOR_HAVOC_MEMBER_OPT \
" path to the member to be havoced\n" \
" <member-expr> path to the member to be havoced\n" \
// COMMON_HARNESS_GENERATOR_HELP

// clang-format on
Expand Down
24 changes: 13 additions & 11 deletions src/goto-harness/goto_harness_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ Author: Diffblue Ltd.

#include "goto_harness_parse_options.h"

#include <algorithm>
#include <fstream>
#include <set>
#include <string>
#include <unordered_set>
#include <utility>

#include <util/config.h>
#include <util/exception_utils.h>
#include <util/exit_codes.h>
Expand All @@ -23,15 +16,24 @@ Author: Diffblue Ltd.
#include <util/suffix.h>
#include <util/version.h>

#include <goto-instrument/dump_c.h>
#include <goto-programs/goto_model.h>
#include <goto-programs/read_goto_binary.h>
#include <goto-programs/write_goto_binary.h>

#include <goto-instrument/dump_c.h>

#include "function_call_harness_generator.h"
#include "goto_harness_generator_factory.h"
#include "memory_snapshot_harness_generator.h"

#include <algorithm>
#include <fstream>
#include <iostream>
#include <set>
#include <string>
#include <unordered_set>
#include <utility>

std::unordered_set<irep_idt>
get_symbol_names_from_goto_model(const goto_modelt &goto_model)
{
Expand Down Expand Up @@ -96,7 +98,7 @@ int goto_harness_parse_optionst::doit()
{
if(cmdline.isset("version"))
{
log.status() << CBMC_VERSION << '\n';
std::cout << CBMC_VERSION << '\n';
return CPROVER_EXIT_SUCCESS;
}

Expand Down Expand Up @@ -170,7 +172,7 @@ int goto_harness_parse_optionst::doit()

void goto_harness_parse_optionst::help()
{
log.status()
std::cout
<< '\n'
<< banner_string("Goto-Harness", CBMC_VERSION) << '\n'
<< align_center_with_border("Copyright (C) 2019") << '\n'
Expand All @@ -195,7 +197,7 @@ void goto_harness_parse_optionst::help()
<< "--harness-type one of the harness types listed below\n"
<< "\n\n"
<< FUNCTION_HARNESS_GENERATOR_HELP << "\n\n"
<< MEMORY_SNAPSHOT_HARNESS_GENERATOR_HELP << messaget::eom;
<< MEMORY_SNAPSHOT_HARNESS_GENERATOR_HELP << '\n';
}

goto_harness_parse_optionst::goto_harness_parse_optionst(
Expand Down
27 changes: 14 additions & 13 deletions src/memory-analyzer/memory_analyzer_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,25 @@ Author: Malte Mues <mail.mues@gmail.com>
/// Commandline parser for the memory analyzer executing main work.

#include "memory_analyzer_parse_options.h"
#include "analyze_symbol.h"

#include <algorithm>
#include <fstream>

#include <ansi-c/ansi_c_language.h>
#include <util/config.h>
#include <util/exit_codes.h>
#include <util/message.h>
#include <util/string_utils.h>
#include <util/version.h>

#include <goto-programs/goto_model.h>
#include <goto-programs/read_goto_binary.h>
#include <goto-programs/show_symbol_table.h>

#include <ansi-c/ansi_c_language.h>
#include <langapi/mode.h>

#include <util/config.h>
#include <util/exit_codes.h>
#include <util/message.h>
#include <util/string_utils.h>
#include <util/version.h>
#include "analyze_symbol.h"

#include <algorithm>
#include <fstream>
#include <iostream>

memory_analyzer_parse_optionst::memory_analyzer_parse_optionst(
int argc,
Expand All @@ -53,7 +54,7 @@ int memory_analyzer_parse_optionst::doit()
{
if(cmdline.isset("version"))
{
message.status() << CBMC_VERSION << '\n';
std::cout << CBMC_VERSION << '\n';
return CPROVER_EXIT_SUCCESS;
}

Expand Down Expand Up @@ -172,7 +173,7 @@ int memory_analyzer_parse_optionst::doit()

void memory_analyzer_parse_optionst::help()
{
message.status()
std::cout
<< '\n'
<< banner_string("Memory-Analyzer", CBMC_VERSION) << '\n'
<< align_center_with_border("Copyright (C) 2019") << '\n'
Expand All @@ -193,5 +194,5 @@ void memory_analyzer_parse_optionst::help()
<< " --symtab-snapshot output snapshot as symbol table\n"
<< " --output-file <file> write snapshot to file\n"
<< " --json-ui output snapshot in JSON format\n"
<< messaget::eom;
<< '\n';
}