]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
testfw: Set cache_logfile before running each test case
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 1 Aug 2010 12:06:43 +0000 (14:06 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 1 Aug 2010 15:20:33 +0000 (17:20 +0200)
test/framework.c
test/main.c

index c0d5601b5c11976c77992c085d041a39ede3e312..95b31823e35638a62db4882d2d3d77eb28b48cfa 100644 (file)
@@ -142,6 +142,8 @@ void cct_suite_end()
 
 void cct_test_begin(const char *name)
 {
+       extern char *cache_logfile;
+
        verify_test_suite_name(name);
        if (verbose) {
                printf("--- TEST: %s ---\n", name);
@@ -151,7 +153,9 @@ void cct_test_begin(const char *name)
        cct_chdir(name);
        current_test = name;
        failed_asserts_before_test = failed_asserts;
+
        cc_reset();
+       cache_logfile = getenv("CCACHE_LOGFILE");
 }
 
 void cct_test_end()
index f5eaef4a23f08ee3029cff00582c8904fef913f2..0a05b5869117e6c860727f751c2d5bfdf28f03b7 100644 (file)
@@ -34,8 +34,6 @@ const char USAGE_TEXT[] =
        "    -h, --help      print this help text\n"
        "    -v, --verbose   enable verbose logging of tests\n";
 
-extern char *cache_logfile;
-
 int main(int argc, char **argv)
 {
        static const struct option options[] = {
@@ -74,7 +72,6 @@ int main(int argc, char **argv)
        if (getenv("RUN_FROM_BUILD_FARM")) {
                verbose = 1;
        }
-       cache_logfile = getenv("CCACHE_LOGFILE");
 
        testdir = format("testdir.%d", (int)getpid());
        cct_create_fresh_dir(testdir);