Update test-cli.cpp
This commit is contained in:
parent
ca512cc934
commit
243fd5dd37
1 changed files with 5 additions and 3 deletions
|
@ -42,11 +42,13 @@ struct Out {
|
||||||
static Out run(const std::string & cmd) {
|
static Out run(const std::string & cmd) {
|
||||||
auto full_cmd = cmd + " > out/out.txt 2> out/err.txt";
|
auto full_cmd = cmd + " > out/out.txt 2> out/err.txt";
|
||||||
std::cerr << "Running: " << full_cmd << std::endl;
|
std::cerr << "Running: " << full_cmd << std::endl;
|
||||||
|
auto out = read("out/out.txt");
|
||||||
|
auto err = read("out/err.txt");
|
||||||
if (std::system(full_cmd.c_str()) != 0)
|
if (std::system(full_cmd.c_str()) != 0)
|
||||||
throw std::runtime_error("llama-cli binary failed to run.");
|
throw std::runtime_error("llama-cli binary failed to run.\nstdout: " + out + "\nstderr: " + err);
|
||||||
return {
|
return {
|
||||||
/* .out = */ read("out/out.txt"),
|
/* .out = */ out,
|
||||||
/* .err = */ read("out/err.txt"),
|
/* .err = */ err,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue