mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pete...@apache.org
Subject incubator-mynewt-core git commit: MYNEWT-139: more ci test refactoring
Date Wed, 23 Nov 2016 00:27:47 GMT
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop a69bb02f0 -> e9be34dd4


MYNEWT-139: more ci test refactoring

Support for mutex tests, ready for callouts and events, add routine
to initialize testsuite complete callback.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/e9be34dd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/e9be34dd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/e9be34dd

Branch: refs/heads/develop
Commit: e9be34dd426a96b593e526ce779774c8e80c0eda
Parents: a69bb02
Author: Peter Snyder <peterfs@apache.org>
Authored: Tue Nov 22 16:25:58 2016 -0800
Committer: Peter Snyder <peterfs@apache.org>
Committed: Tue Nov 22 16:25:58 2016 -0800

----------------------------------------------------------------------
 kernel/os/test/src/testcases/event_test_poll_single_sr.c  | 4 ++++
 kernel/os/test/src/testcases/event_test_poll_sr.c         | 4 ++++
 kernel/os/test/src/testcases/event_test_poll_timeout_sr.c | 4 ++++
 kernel/os/test/src/testcases/event_test_src.c             | 4 ++++
 kernel/os/test/src/testcases/os_callout_test.c            | 4 ++++
 kernel/os/test/src/testcases/os_callout_test_speak.c      | 5 +++++
 kernel/os/test/src/testcases/os_callout_test_stop.c       | 5 +++++
 kernel/os/test/src/testcases/os_mutex_test_case_1.c       | 2 ++
 kernel/os/test/src/testcases/os_mutex_test_case_2.c       | 4 ++++
 test/testutil/src/suite.c                                 | 7 +++++++
 10 files changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9be34dd/kernel/os/test/src/testcases/event_test_poll_single_sr.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/event_test_poll_single_sr.c b/kernel/os/test/src/testcases/event_test_poll_single_sr.c
index 8abf755..122980e 100644
--- a/kernel/os/test/src/testcases/event_test_poll_single_sr.c
+++ b/kernel/os/test/src/testcases/event_test_poll_single_sr.c
@@ -24,8 +24,10 @@ TEST_CASE(event_test_poll_single_sr)
 {
     int i;
 
+#if MYNEWT_VAL(SELFTEST)
     /* Initializing the OS */
     sysinit();
+#endif
     /* Initialize the task */
     os_task_init(&eventq_task_poll_single_s, "eventq_task_poll_single_s", 
         eventq_task_poll_single_send, NULL, SEND_TASK_POLL_SINGLE_PRIO,
@@ -42,7 +44,9 @@ TEST_CASE(event_test_poll_single_sr)
         m_event[i].ev_arg = (void *)(intptr_t)(10 * i);
     }
 
+#if MYNEWT_VAL(SELFTEST)
     /* Does not return until OS_restart is called */
     os_start();
+#endif
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9be34dd/kernel/os/test/src/testcases/event_test_poll_sr.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/event_test_poll_sr.c b/kernel/os/test/src/testcases/event_test_poll_sr.c
index 55c031d..1d003d5 100644
--- a/kernel/os/test/src/testcases/event_test_poll_sr.c
+++ b/kernel/os/test/src/testcases/event_test_poll_sr.c
@@ -23,8 +23,10 @@ TEST_CASE(event_test_poll_sr)
 {
     int i;
 
+#if MYNEWT_VAL(SELFTEST)
     /* Initializing the OS */
     sysinit();
+#endif
     /* Initialize the task */
     os_task_init(&eventq_task_poll_s, "eventq_task_poll_s", eventq_task_poll_send,
         NULL, SEND_TASK_POLL_PRIO, OS_WAIT_FOREVER, eventq_task_stack_poll_s, 
@@ -40,7 +42,9 @@ TEST_CASE(event_test_poll_sr)
         os_eventq_init(&multi_eventq[i]);
     }
 
+#if MYNEWT_VAL(SELFTEST)
     /* Does not return until OS_restart is called */
     os_start();
+#endif
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9be34dd/kernel/os/test/src/testcases/event_test_poll_timeout_sr.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/event_test_poll_timeout_sr.c b/kernel/os/test/src/testcases/event_test_poll_timeout_sr.c
index 9ce3481..3972fa4 100644
--- a/kernel/os/test/src/testcases/event_test_poll_timeout_sr.c
+++ b/kernel/os/test/src/testcases/event_test_poll_timeout_sr.c
@@ -23,8 +23,10 @@ TEST_CASE(event_test_poll_timeout_sr)
 {
     int i;
 
+#if MYNEWT_VAL(SELFTEST)
     /* Initializing the OS */
     sysinit();
+#endif
     /* Initialize the task */
     os_task_init(&eventq_task_poll_timeout_s, "eventq_task_poll_timeout_s", 
         eventq_task_poll_timeout_send, NULL, SEND_TASK_POLL_TIMEOUT_PRIO,
@@ -42,7 +44,9 @@ TEST_CASE(event_test_poll_timeout_sr)
         m_event[i].ev_arg = NULL;
     }
 
+#if MYNEWT_VAL(SELFTEST)
     /* Does not return until OS_restart is called */
     os_start();
+#endif
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9be34dd/kernel/os/test/src/testcases/event_test_src.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/event_test_src.c b/kernel/os/test/src/testcases/event_test_src.c
index 067c38e..9d3e35b 100644
--- a/kernel/os/test/src/testcases/event_test_src.c
+++ b/kernel/os/test/src/testcases/event_test_src.c
@@ -22,8 +22,10 @@ TEST_CASE(event_test_sr)
 {
     int i;
 
+#if MYNEWT_VAL(SELFTEST)
     /* Initializing the OS */
     sysinit();
+#endif
     /* Initialize the task */
     os_task_init(&eventq_task_s, "eventq_task_s", eventq_task_send, NULL,
         SEND_TASK_PRIO, OS_WAIT_FOREVER, eventq_task_stack_s, MY_STACK_SIZE);
@@ -39,7 +41,9 @@ TEST_CASE(event_test_sr)
         os_eventq_init(&multi_eventq[i]);
     }
 
+#if MYNEWT_VAL(SELFTEST)
     /* Does not return until OS_restart is called */
     os_start();
+#endif
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9be34dd/kernel/os/test/src/testcases/os_callout_test.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/os_callout_test.c b/kernel/os/test/src/testcases/os_callout_test.c
index 6fc01c7..fdc2926 100644
--- a/kernel/os/test/src/testcases/os_callout_test.c
+++ b/kernel/os/test/src/testcases/os_callout_test.c
@@ -22,8 +22,10 @@
 TEST_CASE(callout_test)
 {
 
+#if MYNEWT_VAL(SELFTEST)
     /* Initializing the OS */
     sysinit();
+#endif
     
     /* Initialize the sending task */
     os_task_init(&callout_task_struct_send, "callout_task_send",
@@ -40,6 +42,8 @@ TEST_CASE(callout_test)
     /* Initialize the callout function */
     os_callout_init(&callout_test_c, &callout_evq, my_callout, NULL);
 
+#if MYNEWT_VAL(SELFTEST)
     /* Does not return until OS_restart is called */
     os_start();
+#endif
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9be34dd/kernel/os/test/src/testcases/os_callout_test_speak.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/os_callout_test_speak.c b/kernel/os/test/src/testcases/os_callout_test_speak.c
index 11dd3d2..2d08085 100644
--- a/kernel/os/test/src/testcases/os_callout_test_speak.c
+++ b/kernel/os/test/src/testcases/os_callout_test_speak.c
@@ -21,8 +21,11 @@
 /* Test case to test case for speak and listen */
 TEST_CASE(callout_test_speak)
 {
+
+#if MYNEWT_VAL(SELFTEST)
     /* Initializing the OS */
     sysinit();
+#endif
     
     /* Initialize the sending task */
     os_task_init(&callout_task_struct_speak, "callout_task_speak",
@@ -40,6 +43,8 @@ TEST_CASE(callout_test_speak)
     os_callout_init(&callout_speak, &callout_evq,
         my_callout_speak_func, NULL);    
 
+#if MYNEWT_VAL(SELFTEST)
     /* Does not return until OS_restart is called */
     os_start();
+#endif
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9be34dd/kernel/os/test/src/testcases/os_callout_test_stop.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/os_callout_test_stop.c b/kernel/os/test/src/testcases/os_callout_test_stop.c
index da7674d..15733c1 100644
--- a/kernel/os/test/src/testcases/os_callout_test_stop.c
+++ b/kernel/os/test/src/testcases/os_callout_test_stop.c
@@ -22,8 +22,11 @@
 TEST_CASE(callout_test_stop)
 {
     int k;
+
+#if MYNEWT_VAL(SELFTEST)
     /* Initializing the OS */
     sysinit();
+#endif
 
     /* Initialize the sending task */
     os_task_init(&callout_task_struct_stop_send, "callout_task_stop_send",
@@ -46,7 +49,9 @@ TEST_CASE(callout_test_stop)
            my_callout_stop_func, NULL);
     }
 
+#if MYNEWT_VAL(SELFTEST)
     /* Does not return until OS_restart is called */
     os_start();
+#endif
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9be34dd/kernel/os/test/src/testcases/os_mutex_test_case_1.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/os_mutex_test_case_1.c b/kernel/os/test/src/testcases/os_mutex_test_case_1.c
index 30a8b6c..505ee34 100644
--- a/kernel/os/test/src/testcases/os_mutex_test_case_1.c
+++ b/kernel/os/test/src/testcases/os_mutex_test_case_1.c
@@ -41,5 +41,7 @@ TEST_CASE(os_mutex_test_case_1)
     os_task_init(&task3, "task3", mutex_task3_handler, NULL, TASK3_PRIO, 
             OS_WAIT_FOREVER, stack3, sizeof(stack3));
 
+#if MYNEWT_VAL(SELFTEST)
     os_start();
+#endif
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9be34dd/kernel/os/test/src/testcases/os_mutex_test_case_2.c
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/testcases/os_mutex_test_case_2.c b/kernel/os/test/src/testcases/os_mutex_test_case_2.c
index eb321bf..b284c8e 100644
--- a/kernel/os/test/src/testcases/os_mutex_test_case_2.c
+++ b/kernel/os/test/src/testcases/os_mutex_test_case_2.c
@@ -20,7 +20,9 @@
 
 TEST_CASE(os_mutex_test_case_2)
 {
+#if MYNEWT_VAL(SELFTEST)
     sysinit();
+#endif
 
     g_mutex_test = 2;
     g_task1_val = 0;
@@ -41,5 +43,7 @@ TEST_CASE(os_mutex_test_case_2)
     os_task_init(&task4, "task4", mutex_task4_handler, NULL, TASK4_PRIO, 
             OS_WAIT_FOREVER, stack4, sizeof(stack4));
  
+#if MYNEWT_VAL(SELFTEST)
     os_start();
+#endif
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9be34dd/test/testutil/src/suite.c
----------------------------------------------------------------------
diff --git a/test/testutil/src/suite.c b/test/testutil/src/suite.c
index d13a6fd..6cca44a 100644
--- a/test/testutil/src/suite.c
+++ b/test/testutil/src/suite.c
@@ -54,6 +54,13 @@ tu_suite_set_init_cb(tu_init_test_fn_t *cb, void *cb_arg)
     ts_config.ts_suite_init_arg = cb_arg;
 }
 
+void
+tu_suite_set_complete_cb(tu_init_test_fn_t *cb, void *cb_arg)
+{
+    ts_config.ts_suite_complete_cb = cb;
+    ts_config.ts_suite_complete_arg = cb_arg;
+}
+
 /**
  * Configures a callback that gets executed at the end of each test
  * case in the current suite.  This is useful when there are some


Mime
View raw message