summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spcpuset01
diff options
context:
space:
mode:
authorJennifer Averett <jennifer.averett@oarcorp.com>2014-02-06 12:51:01 -0600
committerJennifer Averett <jennifer.averett@oarcorp.com>2014-03-07 09:07:17 -0600
commit13ab94be6ce3130c55ebb57fa96406d6b6e8c2b8 (patch)
tree387a67898a057c29f68dd65629c248a56521d243 /testsuites/sptests/spcpuset01
parentsmptests: Delete config.h.in (diff)
downloadrtems-13ab94be6ce3130c55ebb57fa96406d6b6e8c2b8.tar.bz2
spcpuset01: Add check for sys/cpuset.h.
If <sys/cpuset.h> is not provided by the toolset, the test cannot be compiled.
Diffstat (limited to 'testsuites/sptests/spcpuset01')
-rw-r--r--testsuites/sptests/spcpuset01/init.c16
-rw-r--r--testsuites/sptests/spcpuset01/system.h14
-rw-r--r--testsuites/sptests/spcpuset01/test.c9
3 files changed, 29 insertions, 10 deletions
diff --git a/testsuites/sptests/spcpuset01/init.c b/testsuites/sptests/spcpuset01/init.c
index fa0e6a8d7c..138438fd68 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 defined(__RTEMS_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 cc3359fb15..0019abd95a 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 defined(__RTEMS_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 3a595e3b4a..2691afff32 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,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
-#include <sys/cpuset.h>
#include "system.h"
-
+#if defined(__RTEMS_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 +125,4 @@ void cpuset_logic_test()
}
}
}
-
+#endif