summaryrefslogtreecommitdiffhomepage
path: root/ymake.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2024-05-09 15:37:06 +0200
committerRoland Reichwein <mail@reichwein.it>2024-05-09 15:37:06 +0200
commit242b03bc8da841a9527ad845eb60275008155afb (patch)
treeca36edb74ccfe34662c8a2b1c72295df77b50254 /ymake.cpp
parent7dabda20e11138f2235b12271d569cd3256ebf3a (diff)
Run tests
Diffstat (limited to 'ymake.cpp')
-rw-r--r--ymake.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/ymake.cpp b/ymake.cpp
index a3eec6a..cc3e00e 100644
--- a/ymake.cpp
+++ b/ymake.cpp
@@ -34,7 +34,11 @@ using namespace std::string_literals;
namespace {
void usage()
{
- std::cout << "Usage: ymake <target>" << std::endl;
+ std::cout << "Usage: ymake [<action>]" << std::endl;
+ std::cout << " with <action> one of:" << std::endl;
+ std::cout << " build (same as no action specified)" << std::endl;
+ std::cout << " clean" << std::endl;
+ std::cout << " test" << std::endl;
}
}
@@ -55,11 +59,16 @@ int ymake(int argc, char* argv[])
exit(1);
}
- Builder builder(ptree);
- if (action == "default"s || action == "build") { // build
+ if (action == "default" || action == "build") { // build
+ Builder builder(ptree, "build");
builder.build();
} else if (action == "clean") {
+ Builder builder(ptree, "*");
builder.clean();
+ } else if (action == "test") {
+ Builder builder(ptree, "test");
+ builder.build();
+ builder.run_tests();
} else if (action == "install") {
throw std::runtime_error("unimplemented");
} else if (action == "rebuild") {