Skip to content

Commit 66510a4

Browse files
Removed build_interpreter from main() (#292)
* removed build_interpreter from main() Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 1158ecd commit 66510a4

File tree

4 files changed

+1
-37
lines changed

4 files changed

+1
-37
lines changed

include/xeus-cpp/xutils.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ namespace xcpp
2424
XEUS_CPP_API
2525
void stop_handler(int sig);
2626

27-
XEUS_CPP_API
28-
interpreter_ptr build_interpreter(int argc, char** argv);
29-
3027
XEUS_CPP_API
3128
std::string retrieve_tagconf_dir();
3229

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int main(int argc, char* argv[])
5959
signal(SIGINT, xcpp::stop_handler);
6060

6161
std::string file_name = xeus::extract_filename(argc, argv);
62-
interpreter_ptr interpreter = xcpp::build_interpreter(argc, argv);
62+
auto interpreter = std::make_unique<xcpp::interpreter>(argc, argv);
6363
std::unique_ptr<xeus::xcontext> context = xeus::make_zmq_context();
6464

6565
if (!file_name.empty())

src/xutils.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,6 @@ namespace xcpp
5050
exit(0);
5151
}
5252

53-
interpreter_ptr build_interpreter(int argc, char** argv)
54-
{
55-
std::vector<const char*> interpreter_argv(argc);
56-
interpreter_argv[0] = "xeus-cpp";
57-
58-
// Copy all arguments in the new vector excepting the process name.
59-
for (int i = 1; i < argc; i++)
60-
{
61-
interpreter_argv[i] = argv[i];
62-
}
63-
64-
interpreter_ptr interp_ptr = std::make_unique<interpreter>(argc, interpreter_argv.data());
65-
return interp_ptr;
66-
}
67-
6853
std::string retrieve_tagconf_dir()
6954
{
7055
const char* tagconf_dir_env = std::getenv("XCPP_TAGCONFS_DIR");

test/test_interpreter.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -344,24 +344,6 @@ TEST_SUITE("trim"){
344344

345345
}
346346

347-
TEST_SUITE("build_interpreter")
348-
{
349-
// This test case checks if the function `build_interpreter` returns a non-null pointer
350-
// when valid arguments are passed. It sets up a scenario with valid command line arguments
351-
// and checks if the function returns a non-null pointer.
352-
TEST_CASE("build_interpreter_pointer_not_null")
353-
{
354-
char arg1[] = "program_name";
355-
char arg2[] = "-option1";
356-
char* argv[] = {arg1, arg2};
357-
int argc = 2;
358-
359-
interpreter_ptr interp_ptr = xcpp::build_interpreter(argc, argv);
360-
361-
REQUIRE(interp_ptr != nullptr);
362-
}
363-
}
364-
365347
TEST_SUITE("is_match_magics_manager")
366348
{
367349
// This test case checks if the function `is_match` correctly identifies strings that match

0 commit comments

Comments
 (0)