[CMake] A patch for CDash to display labels from test-subprojects

Kay-Uwe 'Kiwi' Lorenz kay at moduleworks.com
Tue Aug 21 03:30:31 EDT 2012


Hi David,

attached you find a patch, which avoids duplicates using an associative 
array.

Kind regards, Kiwi

On 20.08.2012 17:14, David Cole wrote:
> But with the attached patch, *duplicate* labels are possible, and that's
> not desirable either. Could you make a patch that avoids duplicating
> labels that are already represented by the previous block of code?
>
>
> On Mon, Aug 20, 2012 at 9:19 AM, Kay-Uwe 'Kiwi' Lorenz
> <kay at moduleworks.com <mailto:kay at moduleworks.com>> wrote:
>
>     Hi all,
>
>     If you are using subprojects and you have test-only subprojects,
>     cdash will
>     show the labels of them as "(none)".
>
>     Attached you find a patch of index.php against CDash 2.0.2, which add
>     labels for tests.
>
>     Kind regards, Kiwi
>     --
>
>     Kay-Uwe (Kiwi) Lorenz
>     IT Department
>     ModuleWorks GmbH
>     Ritterstr. 12a
>     52072 Aachen
>     Germany
>
>     HRB 11871
>     Amtsgericht Aachen
>     Geschäftsführer Yavuz Murtezaoglu
>
>     --
>
>     Powered by www.kitware.com <http://www.kitware.com>
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>
>     Please keep messages on-topic and check the CMake FAQ at:
>     http://www.cmake.org/Wiki/CMake_FAQ
>
>     Follow this link to subscribe/unsubscribe:
>     http://www.cmake.org/mailman/listinfo/cmake
>
>

-- 

Kay-Uwe (Kiwi) Lorenz
IT Department
ModuleWorks GmbH
Ritterstr. 12a
52072 Aachen
Germany

HRB 11871
Amtsgericht Aachen
Geschäftsführer Yavuz Murtezaoglu
-------------- next part --------------
--- a/index.php	Mon Jul 16 15:05:05 2012 +0200
+++ b/index.php	Tue Aug 21 09:26:27 2012 +0200
@@ -859,9 +859,19 @@
       "AND label2build.labelid=label.id");
     foreach($label_rows as $label_row)
       {
-      $build_row['labels'][] = $label_row['text'];
+      $build_row['labels'][$label_row['text']] = 1;
       }
 
+    $label_rows = pdo_all_rows_query(
+      "SELECT text FROM label, label2test ".
+      "WHERE label2test.buildid='$buildid' ".
+      "AND label2test.labelid=label.id GROUP BY labelid");
+    foreach($label_rows as $label_row)
+      {
+        $build_row['labels'][$label_row['text']] = 1;
+      }
+    $build_row['labels'] = array_keys($build_row['labels']);
+
     // Updates
     if(!empty($build_row['updatestarttime']))
       {


More information about the CMake mailing list