summaryrefslogtreecommitdiff
path: root/zephyr/test/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/test/tasks')
-rw-r--r--zephyr/test/tasks/BUILD.py7
-rw-r--r--zephyr/test/tasks/CMakeLists.txt6
-rw-r--r--zephyr/test/tasks/boards/native_posix.overlay8
-rw-r--r--zephyr/test/tasks/main.c9
-rw-r--r--zephyr/test/tasks/prj.conf2
-rw-r--r--zephyr/test/tasks/shimmed_test_tasks.h4
-rw-r--r--zephyr/test/tasks/testcase.yaml8
7 files changed, 24 insertions, 20 deletions
diff --git a/zephyr/test/tasks/BUILD.py b/zephyr/test/tasks/BUILD.py
deleted file mode 100644
index 9280101836..0000000000
--- a/zephyr/test/tasks/BUILD.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright 2021 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Register zmake project for tasks test."""
-
-register_host_test("tasks")
diff --git a/zephyr/test/tasks/CMakeLists.txt b/zephyr/test/tasks/CMakeLists.txt
index f5ea76e67e..b0b59e7c99 100644
--- a/zephyr/test/tasks/CMakeLists.txt
+++ b/zephyr/test/tasks/CMakeLists.txt
@@ -1,9 +1,9 @@
-# Copyright 2020 The Chromium OS Authors. All rights reserved.
+# Copyright 2020 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
cmake_minimum_required(VERSION 3.13.1)
-find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
+find_package(Zephyr REQUIRED HINTS "${ZEPHYR_BASE}")
project(tasks)
# Include the local test directory for shimmed_test_tasks.h
@@ -11,4 +11,4 @@ zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
target_sources(app PRIVATE
main.c
- "${CMAKE_CURRENT_SOURCE_DIR}/../../shim/src/tasks.c") \ No newline at end of file
+ "${CMAKE_CURRENT_SOURCE_DIR}/../../shim/src/tasks.c")
diff --git a/zephyr/test/tasks/boards/native_posix.overlay b/zephyr/test/tasks/boards/native_posix.overlay
new file mode 100644
index 0000000000..2e36118442
--- /dev/null
+++ b/zephyr/test/tasks/boards/native_posix.overlay
@@ -0,0 +1,8 @@
+/* Copyright 2022 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <board-overlays/native_posix.dts>
+
+/* No additional nodes to the native_posix overlay */
diff --git a/zephyr/test/tasks/main.c b/zephyr/test/tasks/main.c
index ebf271d9b7..8bfe9eb602 100644
--- a/zephyr/test/tasks/main.c
+++ b/zephyr/test/tasks/main.c
@@ -1,11 +1,11 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <zephyr/kernel.h>
#include <stdbool.h>
-#include <ztest.h>
+#include <zephyr/ztest.h>
#include "ec_tasks.h"
#include "task.h"
@@ -107,7 +107,6 @@ static void test_task_get_current(void)
run_test(&task_get_current1, &task_get_current2);
}
-
static void timeout1(void)
{
const uint32_t start_ms = k_uptime_get();
@@ -201,7 +200,6 @@ static void test_event_delivered(void)
run_test(&event_delivered1, &event_delivered2);
}
-
static void event_mask_not_delivered1(void)
{
task_set_event(TASK_ID_TASK_2, 0x007F);
@@ -226,7 +224,6 @@ static void test_event_mask_not_delivered(void)
run_test(&event_mask_not_delivered1, &event_mask_not_delivered2);
}
-
static void event_mask_extra1(void)
{
k_sleep(K_SECONDS(1));
@@ -253,7 +250,6 @@ static void test_event_mask_extra(void)
run_test(&event_mask_extra1, &event_mask_extra2);
}
-
static void empty_set_mask1(void)
{
k_sleep(K_SECONDS(1));
@@ -281,7 +277,6 @@ static void test_empty_set_mask(void)
run_test(&empty_set_mask1, &empty_set_mask2);
}
-
void test_main(void)
{
/* Note that test_set_event_before_task_start calls start_ec_tasks */
diff --git a/zephyr/test/tasks/prj.conf b/zephyr/test/tasks/prj.conf
index 15af430451..6c8e2fbc90 100644
--- a/zephyr/test/tasks/prj.conf
+++ b/zephyr/test/tasks/prj.conf
@@ -1,4 +1,4 @@
-# Copyright 2020 The Chromium OS Authors. All rights reserved.
+# Copyright 2020 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
diff --git a/zephyr/test/tasks/shimmed_test_tasks.h b/zephyr/test/tasks/shimmed_test_tasks.h
index c040ed1bad..ebd1215446 100644
--- a/zephyr/test/tasks/shimmed_test_tasks.h
+++ b/zephyr/test/tasks/shimmed_test_tasks.h
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -14,7 +14,7 @@
#define HAS_TASK_TASK_3 1
/* Highest priority on bottom same as in platform/ec */
-#define CROS_EC_TASK_LIST \
+#define CROS_EC_TASK_LIST \
CROS_EC_TASK(TASK_1, task1_entry, 0, 512, 2) \
CROS_EC_TASK(TASK_2, task2_entry, 0, 512, 1) \
CROS_EC_TASK(TASK_3, task3_entry, 0, 512, 0)
diff --git a/zephyr/test/tasks/testcase.yaml b/zephyr/test/tasks/testcase.yaml
new file mode 100644
index 0000000000..a72199a14a
--- /dev/null
+++ b/zephyr/test/tasks/testcase.yaml
@@ -0,0 +1,8 @@
+# Copyright 2022 The ChromiumOS Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+common:
+ platform_allow: native_posix
+tests:
+ tasks.default: {}