aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-04-25 14:56:16 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-04-25 14:56:16 +0000
commit756658a69a1abca61281b4dbd84a6dada9fc91b5 (patch)
tree2d39a47723556859d28761fd7d9336c811839d75
parenta2a88226488db68ca8435a72ed608bf5ec9df464 (diff)
downloadChibiOS-756658a69a1abca61281b4dbd84a6dada9fc91b5.tar.gz
ChibiOS-756658a69a1abca61281b4dbd84a6dada9fc91b5.tar.bz2
ChibiOS-756658a69a1abca61281b4dbd84a6dada9fc91b5.zip
Improved test code, architecture names added to the port code.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@918 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--demos/Win32-MinGW/chcore.h5
-rw-r--r--ports/ARM7/chcore.h5
-rw-r--r--ports/ARMCM3/chcore.h5
-rw-r--r--ports/AVR/chcore.h5
-rw-r--r--ports/MSP430/chcore.h5
-rw-r--r--readme.txt1
-rw-r--r--src/templates/chcore.h5
-rw-r--r--test/coverage/chcore.h5
-rw-r--r--test/test.c22
9 files changed, 53 insertions, 5 deletions
diff --git a/demos/Win32-MinGW/chcore.h b/demos/Win32-MinGW/chcore.h
index 276b935da..fdeb245fb 100644
--- a/demos/Win32-MinGW/chcore.h
+++ b/demos/Win32-MinGW/chcore.h
@@ -31,6 +31,11 @@
#define CH_ARCHITECTURE_WIN32SIM
/**
+ * Name of the implemented architecture.
+ */
+#define CH_ARCHITECTURE_NAME "WIN32 Simulator"
+
+/**
* 32 bit stack alignment.
*/
typedef uint32_t stkalign_t;
diff --git a/ports/ARM7/chcore.h b/ports/ARM7/chcore.h
index 3dfef7d80..541207eef 100644
--- a/ports/ARM7/chcore.h
+++ b/ports/ARM7/chcore.h
@@ -41,6 +41,11 @@
#define CH_ARCHITECTURE_ARM7
/**
+ * Name of the implemented architecture.
+ */
+#define CH_ARCHITECTURE_NAME "ARM7TDMI"
+
+/**
* 32 bit stack alignment.
*/
typedef uint32_t stkalign_t;
diff --git a/ports/ARMCM3/chcore.h b/ports/ARMCM3/chcore.h
index 5ef44a09f..e54f3ca64 100644
--- a/ports/ARMCM3/chcore.h
+++ b/ports/ARMCM3/chcore.h
@@ -89,6 +89,11 @@
#define CH_ARCHITECTURE_ARMCM3
/**
+ * Name of the implemented architecture.
+ */
+#define CH_ARCHITECTURE_NAME "ARM Cortex-M3"
+
+/**
* 32 bit stack alignment.
*/
typedef uint32_t stkalign_t;
diff --git a/ports/AVR/chcore.h b/ports/AVR/chcore.h
index 30eb905fc..c70c5307e 100644
--- a/ports/AVR/chcore.h
+++ b/ports/AVR/chcore.h
@@ -43,6 +43,11 @@
#define CH_ARCHITECTURE_AVR
/**
+ * Name of the implemented architecture.
+ */
+#define CH_ARCHITECTURE_NAME "AVR"
+
+/**
* 8 bit stack alignment.
*/
typedef uint8_t stkalign_t;
diff --git a/ports/MSP430/chcore.h b/ports/MSP430/chcore.h
index b7998371d..313108cde 100644
--- a/ports/MSP430/chcore.h
+++ b/ports/MSP430/chcore.h
@@ -43,6 +43,11 @@
#define CH_ARCHITECTURE_MSP430
/**
+ * Name of the implemented architecture.
+ */
+#define CH_ARCHITECTURE_NAME "MSP430"
+
+/**
* 16 bit stack alignment.
*/
typedef uint16_t stkalign_t;
diff --git a/readme.txt b/readme.txt
index 3213f5122..dff88063a 100644
--- a/readme.txt
+++ b/readme.txt
@@ -93,6 +93,7 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
- NEW: Added a new "naked" context switch benchmark that better defines the
real context switch time, previous benchmarks introduced too much overhead
to the measurement. The STM32 performs the context switch in under 1.48uS.
+- NEW: Added architecture name strings to the port code.
- CHANGE: Removed the chMsgSendWithEvent() function. It is rarely used and
the functionality can be re-created with a compound atomic operation. Also
removed the CH_USE_MESSAGES_EVENT configuration option.
diff --git a/src/templates/chcore.h b/src/templates/chcore.h
index c5d750cfb..c8a0d8222 100644
--- a/src/templates/chcore.h
+++ b/src/templates/chcore.h
@@ -33,6 +33,11 @@
#define CH_ARCHITECTURE_XXX
/**
+ * Name of the implemented architecture.
+ */
+#define CH_ARCHITECTURE_NAME ""
+
+/**
* Base type for stack alignment.
* This type is used only for stack alignment reasons thus can be anything from
* a char to a double.
diff --git a/test/coverage/chcore.h b/test/coverage/chcore.h
index 321bd816e..9347a7d5e 100644
--- a/test/coverage/chcore.h
+++ b/test/coverage/chcore.h
@@ -31,6 +31,11 @@
#define CH_ARCHITECTURE_WIN32SIM
/**
+ * Name of the implemented architecture.
+ */
+#define CH_ARCHITECTURE_NAME "WIN32 Simulator"
+
+/**
* 32 bit stack alignment.
*/
typedef uint32_t stkalign_t;
diff --git a/test/test.c b/test/test.c
index 531928bbe..d64ec06bd 100644
--- a/test/test.c
+++ b/test/test.c
@@ -228,14 +228,26 @@ static void execute_test(const struct testcase *tcp) {
test_wait_threads();
}
+static void print_line(void) {
+ unsigned i;
+
+ for (i = 0; i < 76; i++)
+ chFDDPut(comp, '-');
+ chFDDPut(comp, '\r');
+ chFDDPut(comp, '\n');
+}
+
msg_t TestThread(void *p) {
int i, j;
comp = p;
test_println("");
- test_println("*****************************");
- test_println("*** ChibiOS/RT test suite ***");
- test_println("*****************************");
+ test_println("*** ChibiOS/RT test suite");
+ test_println("***");
+ test_print("*** Kernel: ");
+ test_println(CH_KERNEL_VERSION);
+ test_print("*** Architecture: ");
+ test_println(CH_ARCHITECTURE_NAME);
test_println("");
global_fail = FALSE;
@@ -246,7 +258,7 @@ msg_t TestThread(void *p) {
#if DELAY_BETWEEN_TESTS > 0
chThdSleepMilliseconds(DELAY_BETWEEN_TESTS);
#endif
- test_println("---------------------------------------------------------------------------");
+ print_line();
test_print("--- Test Case ");
test_printn(i + 1);
test_print(".");
@@ -268,7 +280,7 @@ msg_t TestThread(void *p) {
}
i++;
}
- test_println("---------------------------------------------------------------------------");
+ print_line();
test_println("");
test_print("Final result: ");
if (global_fail)