The attached patch adds the check for cpuset.h in newlib
into the cpuset test.
Jennifer Averett
On-Line Applications Research
From 2bbd8fb24aa8a9393d3b11455400cb823253f80a Mon Sep 17 00:00:00 2001
From: Jennifer Averett <jennifer.aver...@oarcorp.com>
Date: Thu, 6 Feb 2014 12:51:01 -0600
Subject: [PATCH 01/19] sptests: Add check for cpuset.h to spcpuset01 test.
---
testsuites/sptests/spcpuset01/init.c | 16 ++++++++++++++--
testsuites/sptests/spcpuset01/system.h | 14 +++++++++-----
testsuites/sptests/spcpuset01/test.c | 8 ++++++--
3 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/testsuites/sptests/spcpuset01/init.c b/testsuites/sptests/spcpuset01/init.c
index fa0e6a8..7269915 100644
--- a/testsuites/sptests/spcpuset01/init.c
+++ b/testsuites/sptests/spcpuset01/init.c
@@ -11,10 +11,10 @@
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
-
-#include <sys/cpuset.h>
#include "system.h"
+
+#if HAVE_SYS_CPUSET_H
static void test_cpu_zero_case_1(void)
{
size_t i;
@@ -153,3 +153,15 @@ rtems_task Init(
puts( "*** END OF CPUSET01 Test ***" );
exit( 0 );
}
+#else
+#error "Init - No cpuset"
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ puts( "*** CPUSET01 Test ***" );
+ puts( " cpuset not supported\n" );
+ puts( "*** END OF CPUSET01 Test ***" );
+ exit( 0 );
+}
+#endif
diff --git a/testsuites/sptests/spcpuset01/system.h b/testsuites/sptests/spcpuset01/system.h
index cc3359f..57694a4 100644
--- a/testsuites/sptests/spcpuset01/system.h
+++ b/testsuites/sptests/spcpuset01/system.h
@@ -9,18 +9,22 @@
#include "tmacros.h"
#include "test_support.h"
-#include <sys/cpuset.h>
-/* functions */
+#if HAVE_SYS_CPUSET_H
-rtems_task Init(
- rtems_task_argument argument
-);
+#include <sys/cpuset.h>
/* global variables */
extern cpu_set_t set1;
extern cpu_set_t set2;
extern cpu_set_t set3;
+#endif
+
+/* functions */
+
+rtems_task Init(
+ rtems_task_argument argument
+);
void cpuset_logic_test(void);
diff --git a/testsuites/sptests/spcpuset01/test.c b/testsuites/sptests/spcpuset01/test.c
index 3a595e3..653882b 100644
--- a/testsuites/sptests/spcpuset01/test.c
+++ b/testsuites/sptests/spcpuset01/test.c
@@ -1,3 +1,7 @@
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
/*
* Fully exercise CPU_SET() methods
*/
@@ -6,10 +10,10 @@
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
-#include <sys/cpuset.h>
#include "system.h"
+#if HAVE_SYS_CPUSET_H
void test_cpu_and_case_1(size_t cpu1, size_t cpu2);
void test_cpu_nand_case_1(size_t cpu1, size_t cpu2);
void test_cpu_or_case_1(size_t cpu1, size_t cpu2);
@@ -122,4 +126,4 @@ void cpuset_logic_test()
}
}
}
-
+#endif
--
1.8.1.4
_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel