Merge pull request #78 from build-cpp/fix-tests

Successfully fail when running cmkr subcommands
main
Duncan Ogilvie 2 years ago committed by GitHub
commit 2627864383
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,7 +19,7 @@ description = "Dependencies from vcpkg"
# See https://github.com/microsoft/vcpkg/releases for vcpkg versions
# See https://vcpkg.io/en/packages.html for available packages
[vcpkg]
version = "2021.05.12"
version = "2022.11.14"
packages = ["fmt"]
[find-package]

@ -7,5 +7,3 @@ const char *handle_args(int argc, char **argv);
} // namespace args
} // namespace cmkr
const char *cmkr_args_handle_args(int, char **);

@ -37,17 +37,17 @@ const char *handle_args(int argc, char **argv) {
} else if (main_arg == "build") {
auto ret = build::run(argc, argv);
if (ret)
return "CMake build error!";
throw std::runtime_error("CMake build failed!");
return "CMake build completed!";
} else if (main_arg == "install") {
auto ret = build::install();
if (ret)
return "CMake install error!";
throw std::runtime_error("CMake install failed!");
return "CMake install completed!";
} else if (main_arg == "clean") {
auto ret = build::clean();
if (ret)
return "CMake clean error!";
throw std::runtime_error("CMake clean failed!");
return "Cleaned build directory!";
} else {
throw std::runtime_error(cmkr::help::message());
@ -55,13 +55,3 @@ const char *handle_args(int argc, char **argv) {
}
} // namespace args
} // namespace cmkr
const char *cmkr_args_handle_args(int argc, char **argv) {
try {
return cmkr::args::handle_args(argc, argv);
} catch (const std::exception &e) {
return e.what();
} catch (...) {
return "Unknown error!";
}
}

@ -4,5 +4,5 @@
int main()
{
printf("mylib version: %s\n", mylib::version())
}
printf("mylib version: %s\n", mylib::version());
}

@ -7,7 +7,7 @@ description = "Dependencies from vcpkg"
# See https://github.com/microsoft/vcpkg/releases for vcpkg versions
# See https://vcpkg.io/en/packages.html for available packages
[vcpkg]
version = "2021.05.12"
version = "2022.11.14"
packages = ["fmt"]
[find-package]

Loading…
Cancel
Save