// Next argument is dependency name, so skip it.
i++;
}
- } else {
- // Hash that we don't have a .d file.
- hash_string(hash, output_dep);
}
continue;
}
}
}
+ // Make results with dependency file /dev/null different from those without
+ // it.
+ if (generating_dependencies && str_eq(output_dep, "/dev/null")) {
+ hash_delimiter(hash, "/dev/null dependency file");
+ }
+
if (!found_ccbin && str_eq(actual_language, "cuda")) {
hash_nvcc_host_compiler(hash, NULL, NULL);
}
expect_stat 'cache miss' 1
expect_equal_files different_name.d expected_sunpro_dependencies_target.d
expect_equal_object_files reference_test.o test.o
+
+ # -------------------------------------------------------------------------
+ TEST "DEPENDENCIES_OUTPUT environment variable set to /dev/null"
+
+ DEPENDENCIES_OUTPUT="/dev/null" $CCACHE_COMPILE -c test.c
+ expect_stat 'cache hit (direct)' 0
+ expect_stat 'cache hit (preprocessed)' 0
+ expect_stat 'cache miss' 1
+
+ DEPENDENCIES_OUTPUT="other.d" $CCACHE_COMPILE -c test.c
+ expect_stat 'cache hit (direct)' 0
+ expect_stat 'cache hit (preprocessed)' 0
+ expect_stat 'cache miss' 2
}