From de217bee8d77a4287efe81731311d0cf3c89c2c8 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 27 Jul 2005 15:46:21 -0400 Subject: BUG: Generate RUN_TEST target if any tests are there --- Source/cmGlobalGenerator.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index dea33eb..97e0564 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1058,9 +1058,17 @@ void cmGlobalGenerator::SetupTests() { fname += "DartTestfile.txt"; } - + + // Add run_test only if any tests are foun + long total_tests = 0; + unsigned int i; + for (i = 0; i < m_LocalGenerators.size(); ++i) + { + total_tests += m_LocalGenerators[i]->GetMakefile()->GetTests()->size(); + } + // If the file doesn't exist, then ENABLE_TESTING hasn't been run - if (cmSystemTools::FileExists(fname.c_str())) + if (total_tests > 0) { const char* no_output = 0; std::vector no_depends; -- cgit v0.12