test-cli
: add llama-cli as order-only prerequisite in Makefile
This commit is contained in:
parent
82d5e91a6f
commit
ca512cc934
2 changed files with 5 additions and 2 deletions
2
Makefile
2
Makefile
|
@ -1641,7 +1641,7 @@ tests/test-chat-template: tests/test-chat-template.cpp \
|
|||
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
|
||||
|
||||
tests/test-cli: tests/test-cli.cpp \
|
||||
$(OBJ_ALL)
|
||||
$(OBJ_ALL) | llama-cli
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $(call GET_OBJ_FILE, $<)
|
||||
$(CXX) $(CXXFLAGS) $(filter-out %.h $<,$^) $(call GET_OBJ_FILE, $<) -o $@ $(LDFLAGS)
|
||||
|
||||
|
|
|
@ -54,7 +54,8 @@ int main(int argc, char ** argv) {
|
|||
std::string cli_bin = argc == 2 ? argv[1] : "./llama-cli";
|
||||
|
||||
try {
|
||||
std::system("mkdir out/");
|
||||
if (std::system("mkdir -p out/") != 0)
|
||||
throw std::runtime_error("Failed to create out/ directory.");
|
||||
|
||||
{
|
||||
auto p = run(cli_bin + " --help");
|
||||
|
@ -74,6 +75,8 @@ int main(int argc, char ** argv) {
|
|||
assert_equals(" hello was a big, red ball. He", p.out);
|
||||
assert_equals("", p.err);
|
||||
}
|
||||
|
||||
return 0;
|
||||
} catch (const std::exception & ex) {
|
||||
std::cerr << "[test-cli] Error: " << ex.what() << std::endl;
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue