diff --git a/test/tools/IsolTestOptions.cpp b/test/tools/IsolTestOptions.cpp index 3aecaeefa..7f00e88f6 100644 --- a/test/tools/IsolTestOptions.cpp +++ b/test/tools/IsolTestOptions.cpp @@ -56,20 +56,18 @@ std::string editorPath() } -IsolTestOptions::IsolTestOptions(std::string* _editor): +IsolTestOptions::IsolTestOptions(): CommonOptions(description) { - editor = _editor; enforceViaYul = true; enforceGasTest = (evmVersion() == langutil::EVMVersion{}); - enforceGasTestMinValue = 100000; } void IsolTestOptions::addOptions() { CommonOptions::addOptions(); options.add_options() - ("editor", po::value(editor)->default_value(editorPath()), "Path to editor for opening test files.") + ("editor", po::value(&editor)->default_value(editorPath()), "Path to editor for opening test files.") ("help", po::bool_switch(&showHelp)->default_value(showHelp), "Show this help screen.") ("no-color", po::bool_switch(&noColor)->default_value(noColor), "Don't use colors.") ("accept-updates", po::bool_switch(&acceptUpdates)->default_value(acceptUpdates), "Automatically accept expectation updates.") diff --git a/test/tools/IsolTestOptions.h b/test/tools/IsolTestOptions.h index f889f5b8f..5bb02c2bc 100644 --- a/test/tools/IsolTestOptions.h +++ b/test/tools/IsolTestOptions.h @@ -33,9 +33,9 @@ struct IsolTestOptions: CommonOptions bool noColor = false; bool acceptUpdates = false; std::string testFilter = std::string{}; - std::string* editor = nullptr; + std::string editor = std::string{}; - explicit IsolTestOptions(std::string* _editor); + explicit IsolTestOptions(); void addOptions() override; bool parse(int _argc, char const* const* _argv) override; void validate() const override; diff --git a/test/tools/isoltest.cpp b/test/tools/isoltest.cpp index fa7b914aa..73adbc62b 100644 --- a/test/tools/isoltest.cpp +++ b/test/tools/isoltest.cpp @@ -121,8 +121,6 @@ public: fs::path const& _basepath, fs::path const& _path ); - - static string editor; private: enum class Request { @@ -145,7 +143,6 @@ private: static bool m_exitRequested; }; -string TestTool::editor; bool TestTool::m_exitRequested = false; TestTool::Result TestTool::process() @@ -258,7 +255,7 @@ TestTool::Request TestTool::handleResponse(bool _exception) } case 'e': cout << endl << endl; - if (system((TestTool::editor + " \"" + m_path.string() + "\"").c_str())) + if (system((m_options.editor + " \"" + m_path.string() + "\"").c_str())) cerr << "Error running editor command." << endl << endl; return Request::Rerun; case 'q': @@ -425,7 +422,7 @@ int main(int argc, char const *argv[]) setupTerminal(); { - auto options = std::make_unique(&TestTool::editor); + auto options = std::make_unique(); if (!options->parse(argc, argv)) return -1;