]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Expose list of enabled features (#897)
authorGregor Jasny <gregor.jasny@logmein.com>
Wed, 14 Jul 2021 09:37:14 +0000 (11:37 +0200)
committerGitHub <noreply@github.com>
Wed, 14 Jul 2021 09:37:14 +0000 (11:37 +0200)
src/ccache.cpp
test/CMakeLists.txt
test/suites/secondary_redis.bash

index 2115752164e62da19a0524295d9e9a81ea399d2b..26d17fc774df00f5e4413aa0d329d87fb5c0fe02 100644 (file)
@@ -95,6 +95,7 @@ using nonstd::string_view;
 
 constexpr const char VERSION_TEXT[] =
   R"({} version {}
+Features: {}
 
 Copyright (C) 2002-2007 Andrew Tridgell
 Copyright (C) 2009-2021 Joel Rosdahl and other contributors
@@ -161,6 +162,13 @@ Options for scripting or debugging:
 See also the manual on <https://ccache.dev/documentation.html>.
 )";
 
+constexpr const char FEATURE_TEXT[] =
+  "http-storage"
+#ifdef HAVE_REDIS_STORAGE_BACKEND
+  " redis-storage"
+#endif
+  ;
+
 // This is a string that identifies the current "version" of the hash sum
 // computed by ccache. If, for any reason, we want to force the hash sum to be
 // different for the same input in a new ccache version, we can just change
@@ -2456,7 +2464,7 @@ handle_main_options(int argc, const char* const* argv)
     }
 
     case 'V': // --version
-      PRINT(VERSION_TEXT, CCACHE_NAME, CCACHE_VERSION);
+      PRINT(VERSION_TEXT, CCACHE_NAME, CCACHE_VERSION, FEATURE_TEXT);
       exit(EXIT_SUCCESS);
 
     case 'x': // --show-compression
index a66c32c8ed6eea827c81391beb1cc6fb1a8a4195..20ccabfdceb55fd71a010aba9ef08f7b4a0084cc 100644 (file)
@@ -54,9 +54,7 @@ addtest(readonly_direct)
 addtest(sanitize_blacklist)
 addtest(secondary_file)
 addtest(secondary_http)
-if(REDIS_STORAGE_BACKEND)
 addtest(secondary_redis)
-endif()
 addtest(secondary_url)
 addtest(serialize_diagnostics)
 addtest(source_date_epoch)
index 076f43619a7d94006497b6bf7df106af898b9d12..4e5e73c6451ab52f3019f506aa3b380e3625e9eb 100644 (file)
@@ -1,4 +1,8 @@
 SUITE_secondary_redis_PROBE() {
+    if ! $CCACHE --version | fgrep -q -- redis-storage &> /dev/null; then
+        echo "redis-storage not available"
+        return
+    fi
     if ! command -v redis-server &> /dev/null; then
         echo "redis-server not found"
         return