diff --git a/.github/workflows/build-using-docker.yml b/.github/workflows/build-using-docker.yml deleted file mode 100644 index 512115c..0000000 --- a/.github/workflows/build-using-docker.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build and test app in NCS docker container - -on: - pull_request: - push: - -permissions: - contents: read - -jobs: - build-and-test-in-docker: - runs-on: ubuntu-22.04 - container: ghcr.io/nrfconnect/sdk-nrf-toolchain:v3.0.0 - defaults: - run: - # Bash shell is needed to set toolchain related environment variables in docker container - # It is a workaround for GitHub Actions limitation https://github.com/actions/runner/issues/1964 - shell: bash - steps: - - name: Checkout repository with example application - uses: actions/checkout@v4 - with: - path: example-application - - - name: Prepare west project - run: | - west init -l example-application - west update -o=--depth=1 -n - - - name: Build firmware - working-directory: example-application - run: | - west twister -T app -v --inline-logs --integration - - - name: Store hex files - uses: actions/upload-artifact@v4 - with: - name: built-applications - path: example-application/twister-out/**/zephyr/zephyr.hex - - - name: Twister Tests - working-directory: example-application - run: | - west twister -T tests -v --inline-logs --integration diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..697d942 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,75 @@ +name: Build code + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + + # Trigger on pushes to branches and pull requests + push: + branches: + - '**' + + # Trigger on pull requests targeting the specified branch + pull_request: + branches: + - '**' + workflow_call: +jobs: + build: + runs-on: ubuntu-latest + container: ghcr.io/nrfconnect/sdk-nrf-toolchain:v3.0.2 + defaults: + run: + # Bash shell is needed to set toolchain related environment variables in docker container + # It is a workaround for GitHub Actions limitation https://github.com/actions/runner/issues/1964 + shell: bash + strategy: + matrix: + board: [nrf54l15dk/nrf54l15/cpuapp] # Add + + + steps: + - name: Checkout repository pslabel + uses: actions/checkout@v4 + with: + path: pslabel + + - name: Prepare west project + run: | + west init -l pslabel + west update -o=--depth=1 -n + + - name: Build Firmware + working-directory: pslabel + run: | + west build app -b ${{ matrix.board }} + + - name: Extract version and create prefix + run: | + MAJOR=$(grep VERSION_MAJOR pslabel/app/VERSION | awk -F'=' '{print $2}' | tr -d '\r' | xargs) + MINOR=$(grep VERSION_MINOR pslabel/app/VERSION | awk -F'=' '{print $2}' | tr -d '\r' | xargs) + PATCH=$(grep PATCHLEVEL pslabel/app/VERSION | awk -F'=' '{print $2}' | tr -d '\r' | xargs) + VERSION="${MAJOR}.${MINOR}.${PATCH}" + echo "PREFIX=${{ github.event.repository.name }}-v${VERSION}" >> $GITHUB_ENV + + - name: Generate short SHA + uses: benjlevesque/short-sha@v3.0 + + - name: Prepare artifacts + run: | + cd pslabel/build + mkdir -p artifacts + mv merged.hex artifacts/${{ env.PREFIX }}-${{ env.SHA }}.hex + if [ -f dfu_application.zip ]; then + mv dfu_application.zip artifacts/${{ env.PREFIX }}-FOTA-${{ env.SHA }}.zip + fi + + # Run IDs are unique per repo but are reused on re-runs + - name: Save artifact + uses: actions/upload-artifact@v4 + with: + name: build_artifacts_${{ github.run_id }} + path: | + pslabel/build/artifacts/* diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 06e23f8..ed2b26e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,18 @@ name: Documentation -on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: + - main + pull_request: + release: + types: [published] + workflow_dispatch: env: DOXYGEN_VERSION: 1.9.6 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ede29b3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,81 @@ +name: Create Release + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + tags: + - 'v*.*.*' + # workflow_dispatch: + # inputs: + # version: + # description: "Release Version." + # required: true + # default: "v0.0.0" + # type: string + +jobs: + stage-release: + runs-on: ubuntu-latest + permissions: write-all + outputs: + version: ${{ steps.read_version.outputs.VERSION }} + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Read version from VERSION file + id: read_version + run: | + MAJOR=$(grep VERSION_MAJOR app/VERSION | awk -F'=' '{print $2}' | tr -d '\r' | xargs) + MINOR=$(grep VERSION_MINOR app/VERSION | awk -F'=' '{print $2}' | tr -d '\r' | xargs) + PATCH=$(grep PATCHLEVEL app/VERSION | awk -F'=' '{print $2}' | tr -d '\r' | xargs) + VERSION="v${MAJOR}.${MINOR}.${PATCH}" + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + echo "file_version=$VERSION" >> $GITHUB_OUTPUT + + # - name: Create Release manually with GH CLI + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: gh release create --draft ${{ steps.read_version.outputs.VERSION }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Fail if tag and VERSION mismatch + run: | + TAG_VERSION="${GITHUB_REF##*/}" + echo "Tag pushed: $TAG_VERSION" + echo "Internal version: $FILE_VERSION" + if [ "$TAG_VERSION" != "$FILE_VERSION" ]; then + echo "❌ ERROR: Tag ($TAG_VERSION) does not match VERSION file ($FILE_VERSION)" + exit 1 + else + echo "✅ Tag and VERSION file match." + fi + env: + FILE_VERSION: ${{ steps.read_version.outputs.file_version }} + + build-binaries: + needs: stage-release + uses: ./.github/workflows/build.yml + + upload-binaries: + needs: [build-binaries, stage-release] + runs-on: ubuntu-latest + permissions: write-all + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: build_artifacts_${{ github.run_id }} + path: ~/artifacts + + - name: Upload artifacts to release + run: gh release upload --clobber ${{ needs.stage-release.outputs.version }} ~/artifacts/*.* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index fb55069..24d0df6 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -1,4 +1,9 @@ name: SonarCloud + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: @@ -59,12 +64,12 @@ jobs: - name: Build and test working-directory: pslabel-oob run: | - build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} west twister -T . -C --coverage-platform=native_sim -v --inline-logs --integration + build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} west build app -b native_sim -- -DCONFIG_COVERAGE=y - name: Extract coverage into sonarqube xml format working-directory: pslabel-oob run: | - gcovr twister-out -v --merge-mode-functions=separate --exclude='twister-out|drivers' --sonarqube coverage.xml + gcovr build -v --merge-mode-functions=separate --exclude='build' --sonarqube coverage.xml - name: Run sonar-scanner on main working-directory: pslabel-oob @@ -78,8 +83,7 @@ jobs: --define project.settings=sonar-project.properties \ --define sonar.coverageReportPaths=coverage.xml \ --define sonar.inclusions=**/*.c,**/*.h \ - --define sonar.exclusions=tests/,drivers/sensor/*_dummy/ - + --define sonar.exclusions=build/**,modules/**,bootloader/**,doc/**,boards/**,west.yml,*.md,*.txt,*.json,*.yml,*.yaml - name: Run sonar-scanner on PR working-directory: pslabel-oob if: github.event_name == 'pull_request' @@ -96,7 +100,7 @@ jobs: --define project.settings=sonar-project.properties \ --define sonar.coverageReportPaths=coverage.xml \ --define sonar.inclusions=**/*.c,**/*.h \ - --define sonar.exclusions=tests/,drivers/sensor/*_dummy/ \ + --define sonar.exclusions=build/**,modules/**,bootloader/**,doc/**,boards/**,west.yml,*.md,*.txt,*.json,*.yml,*.yaml \ --define sonar.scm.revision=${{ env.HEAD_SHA }} \ --define sonar.pullrequest.key=${{ env.PR_NUMBER }} \ --define sonar.pullrequest.branch=${{ env.PR_BRANCH }} \ diff --git a/CMakeLists.txt b/CMakeLists.txt index a073494..c7d3c5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,3 @@ # This is needed so that custom driver classes using system calls are taken into # account -zephyr_syscall_include_directories(include) - -zephyr_include_directories(include) - -add_subdirectory(drivers) -add_subdirectory(lib) diff --git a/Kconfig b/Kconfig index 3bd03f2..eb60fc6 100644 --- a/Kconfig +++ b/Kconfig @@ -5,5 +5,3 @@ # as the module Kconfig entry point (see zephyr/module.yml). You can browse # module options by going to Zephyr -> Modules in Kconfig. -rsource "drivers/Kconfig" -rsource "lib/Kconfig" diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index a59bf06..6673105 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -7,6 +7,6 @@ cmake_minimum_required(VERSION 3.13.1) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(app LANGUAGES C) +project(pslabel LANGUAGES C) target_sources(app PRIVATE src/main.c) diff --git a/app/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/app/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index fd562c8..ee2fff3 100644 --- a/app/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/app/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -9,9 +9,3 @@ * already provided by Zephyr or NCS. */ -/ { - example_sensor: example-sensor { - compatible = "zephyr,example-sensor"; - input-gpios = <&gpio1 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - }; -}; diff --git a/app/debug.conf b/app/debug.conf deleted file mode 100644 index 12992ce..0000000 --- a/app/debug.conf +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2021 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 -# -# This is a Kconfig fragment which can be used to enable debug-related options -# in the application. See the README for more details. - -# compiler -CONFIG_DEBUG_OPTIMIZATIONS=y - -# logging -CONFIG_LOG=y -CONFIG_APP_LOG_LEVEL_DBG=y diff --git a/app/sample.yaml b/app/sample.yaml deleted file mode 100644 index 9a21f93..0000000 --- a/app/sample.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# This file is provided so that the application can be compiled using Twister, -# the Zephyr testing tool. In this file, multiple combinations can be specified, -# so that you can easily test all of them locally or in CI. -sample: - description: PSLabel application - name: PSLabel -common: - sysbuild: true - build_only: true - integration_platforms: - - nrf54l15dk/nrf54l15/cpuapp -tests: - app.default: {} - app.debug: - extra_overlay_confs: - - debug.conf diff --git a/app/src/main.c b/app/src/main.c index 9a8f494..6404bba 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -4,10 +4,8 @@ */ #include -#include #include -#include #include diff --git a/doc/Doxyfile b/doc/Doxyfile index a73abc5..c10e757 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -184,7 +184,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = ../include +STRIP_FROM_PATH = ../app/src \ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -919,7 +919,7 @@ WARN_LOGFILE = INPUT = _doxygen/main.md \ _doxygen/groups.dox \ - ../include + ../app # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt deleted file mode 100644 index 6050db3..0000000 --- a/drivers/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2021 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Out-of-tree drivers for existing driver classes -add_subdirectory_ifdef(CONFIG_SENSOR sensor) diff --git a/drivers/Kconfig b/drivers/Kconfig deleted file mode 100644 index 550329c..0000000 --- a/drivers/Kconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2021 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -menu "Drivers" -rsource "sensor/Kconfig" -endmenu diff --git a/drivers/sensor/CMakeLists.txt b/drivers/sensor/CMakeLists.txt deleted file mode 100644 index 72ed549..0000000 --- a/drivers/sensor/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2021 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -add_subdirectory_ifdef(CONFIG_EXAMPLE_SENSOR example_sensor) diff --git a/drivers/sensor/Kconfig b/drivers/sensor/Kconfig deleted file mode 100644 index 07b6c17..0000000 --- a/drivers/sensor/Kconfig +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2021 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if SENSOR -rsource "example_sensor/Kconfig" -endif # SENSOR diff --git a/drivers/sensor/example_sensor/CMakeLists.txt b/drivers/sensor/example_sensor/CMakeLists.txt deleted file mode 100644 index fcb0596..0000000 --- a/drivers/sensor/example_sensor/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2021 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -zephyr_library() -zephyr_library_sources(example_sensor.c) diff --git a/drivers/sensor/example_sensor/Kconfig b/drivers/sensor/example_sensor/Kconfig deleted file mode 100644 index fe9a358..0000000 --- a/drivers/sensor/example_sensor/Kconfig +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2021 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config EXAMPLE_SENSOR - bool "Example sensor" - default y - depends on DT_HAS_ZEPHYR_EXAMPLE_SENSOR_ENABLED - select GPIO - help - Enable example sensor diff --git a/drivers/sensor/example_sensor/example_sensor.c b/drivers/sensor/example_sensor/example_sensor.c deleted file mode 100644 index ba33379..0000000 --- a/drivers/sensor/example_sensor/example_sensor.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2021 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT zephyr_example_sensor - -#include -#include -#include - -#include -LOG_MODULE_REGISTER(example_sensor, CONFIG_SENSOR_LOG_LEVEL); - -struct example_sensor_data { - int state; -}; - -struct example_sensor_config { - struct gpio_dt_spec input; -}; - -static int example_sensor_sample_fetch(const struct device *dev, enum sensor_channel chan) -{ - const struct example_sensor_config *config = dev->config; - struct example_sensor_data *data = dev->data; - - data->state = gpio_pin_get_dt(&config->input); - chan = SENSOR_CHAN_PROX; - return 0; -} - -static int example_sensor_channel_get(const struct device *dev, enum sensor_channel chan, - struct sensor_value *val) -{ - struct example_sensor_data *data = dev->data; - - if (chan != SENSOR_CHAN_PROX) { - return -ENOTSUP; - } - - val->val1 = data->state; - - return 0; -} - -static DEVICE_API(sensor, example_sensor_api) = { - .sample_fetch = &example_sensor_sample_fetch, - .channel_get = &example_sensor_channel_get, -}; - -static int example_sensor_init(const struct device *dev) -{ - const struct example_sensor_config *config = dev->config; - - int ret; - - if (!device_is_ready(config->input.port)) { - LOG_ERR("Input GPIO not ready"); - return -ENODEV; - } - - ret = gpio_pin_configure_dt(&config->input, GPIO_INPUT); - if (ret < 0) { - LOG_ERR("Could not configure input GPIO (%d)", ret); - return ret; - } - - return 0; -} - -#define EXAMPLE_SENSOR_INIT(i) \ - static struct example_sensor_data example_sensor_data_##i; \ - \ - static const struct example_sensor_config example_sensor_config_##i = { \ - .input = GPIO_DT_SPEC_INST_GET(i, input_gpios), \ - }; \ - \ - DEVICE_DT_INST_DEFINE(i, example_sensor_init, NULL, &example_sensor_data_##i, \ - &example_sensor_config_##i, POST_KERNEL, \ - CONFIG_SENSOR_INIT_PRIORITY, &example_sensor_api); - -DT_INST_FOREACH_STATUS_OKAY(EXAMPLE_SENSOR_INIT) diff --git a/dts/bindings/sensor/zephyr,example-sensor.yaml b/dts/bindings/sensor/zephyr,example-sensor.yaml deleted file mode 100644 index 879fea9..0000000 --- a/dts/bindings/sensor/zephyr,example-sensor.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2021 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - An example sensor that reads the GPIO level defined in input-gpios. The - purpose of this sensor is to demonstrate how to create out-of-tree drivers. - - Example definition in devicetree: - - example-sensor { - compatible = "zephyr,example-sensor"; - input-gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - }; - -compatible: "zephyr,example-sensor" - -include: base.yaml - -properties: - input-gpios: - type: phandle-array - required: true - description: Input GPIO to be sensed. diff --git a/include/app/drivers/blink.h b/include/app/drivers/blink.h deleted file mode 100644 index 455270e..0000000 --- a/include/app/drivers/blink.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef APP_DRIVERS_BLINK_H_ -#define APP_DRIVERS_BLINK_H_ - -#include -#include - -#endif /* APP_DRIVERS_BLINK_H_ */ diff --git a/include/app/lib/custom.h b/include/app/lib/custom.h deleted file mode 100644 index bdb8d3e..0000000 --- a/include/app/lib/custom.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021, Legrand North America, LLC. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef APP_LIB_CUSTOM_H_ -#define APP_LIB_CUSTOM_H_ - -/** - * @defgroup lib_custom Custom library - * @ingroup lib - * @{ - * - * @brief An example of a custom out-of-tree library. - * - * This library illustrates how create custom out-of-tree libraries. Splitting - * code in libraries enables code reuse and modularity, also easing testing. - */ - -/** - * @brief Return @p val if non-zero, or Kconfig-controlled default. - * - * Function returns the provided value if non-zero, or a Kconfig-controlled - * default value if the parameter is zero. This trivial function is provided in - * order to have a library interface example that is trivial to test. - * - * @param val Value to return if non-zero - * - * @retval val if @p val is non-zero - * @retval CONFIG_CUSTOM_GET_VALUE_DEFAULT if @p val is zero - */ -int custom_get_value(int val); - -/** @} */ - -#endif /* APP_LIB_CUSTOM_H_ */ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt deleted file mode 100644 index 78dfa65..0000000 --- a/lib/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -add_subdirectory_ifdef(CONFIG_CUSTOM custom) diff --git a/lib/Kconfig b/lib/Kconfig deleted file mode 100644 index 055b49d..0000000 --- a/lib/Kconfig +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2021 Legrand North America, LLC. -# SPDX-License-Identifier: Apache-2.0 - -menu "Custom libraries" - -rsource "custom/Kconfig" - -endmenu diff --git a/lib/custom/CMakeLists.txt b/lib/custom/CMakeLists.txt deleted file mode 100644 index 02e5efa..0000000 --- a/lib/custom/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2021, Legrand North America, LLC. -# SPDX-License-Identifier: Apache-2.0 - -zephyr_library() -zephyr_library_sources(custom.c) diff --git a/lib/custom/Kconfig b/lib/custom/Kconfig deleted file mode 100644 index ffa6840..0000000 --- a/lib/custom/Kconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2021, Legrand North America, LLC. -# SPDX-License-Identifier: Apache-2.0 - -config CUSTOM - bool "Support for custom library" - help - This option enables the 'custom' library - -config CUSTOM_GET_VALUE_DEFAULT - int "custom_get_value() default return value" - depends on CUSTOM - default 0 - help - This option primarily exists as an example of a library Kconfig - setting. - - This option specifies the value for custom_get_value() to return - when the input parameter is zero. (Otherwise the function returns the - input parameter value.) diff --git a/lib/custom/custom.c b/lib/custom/custom.c deleted file mode 100644 index 8ab7192..0000000 --- a/lib/custom/custom.c +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2021, Legrand North America, LLC. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -int custom_get_value(int val) -{ - return (val != 0) ? val : CONFIG_CUSTOM_GET_VALUE_DEFAULT; -} diff --git a/scripts/example_runner.py b/scripts/example_runner.py deleted file mode 100644 index 8168e10..0000000 --- a/scripts/example_runner.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2024 Basalte bv -# -# SPDX-License-Identifier: Apache-2.0 - -from runners.core import RunnerCaps, ZephyrBinaryRunner - - -class ExampleRunner(ZephyrBinaryRunner): - """Dummy example runner.""" - - def __init__(self, cfg, param): - super().__init__(cfg) - self.param = param - - @classmethod - def name(cls): - return "example" - - @classmethod - def capabilities(cls): - return RunnerCaps(commands=({"simulate"})) - - @classmethod - def do_add_parser(cls, parser): - parser.add_argument("--param", action="store", help="An example parameter") - - @classmethod - def do_create(cls, cfg, args): - return cls(cfg, param=args.param) - - def do_run(self, command, **kwargs): - self.logger.info(f"Running {command} on {self.param}") diff --git a/scripts/example_west_command.py b/scripts/example_west_command.py deleted file mode 100644 index 7f68d7f..0000000 --- a/scripts/example_west_command.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2019 Foundries.io -# Copyright (c) 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -'''example_west_command.py - -Example of a west extension in the example-application repository.''' - -from west.commands import WestCommand # your extension must subclass this -from west import log # use this for user output - -class ExampleWestCommand(WestCommand): - - def __init__(self): - super().__init__( - 'example-west-command', # gets stored as self.name - 'an example west extension command', # self.help - # self.description: - '''\ -A multi-line description of example-west-command. - -You can split this up into multiple paragraphs and they'll get -reflowed for you. You can also pass -formatter_class=argparse.RawDescriptionHelpFormatter when calling -parser_adder.add_parser() below if you want to keep your line -endings.''') - - def do_add_parser(self, parser_adder): - # This is a bit of boilerplate, which allows you full control over the - # type of argparse handling you want. The "parser_adder" argument is - # the return value of an argparse.ArgumentParser.add_subparsers() call. - parser = parser_adder.add_parser(self.name, - help=self.help, - description=self.description) - - # Add some example options using the standard argparse module API. - parser.add_argument('-o', '--optional', help='an optional argument') - parser.add_argument('required', help='a required argument') - - return parser # gets stored as self.parser - - def do_run(self, args, unknown_args): - # This gets called when the user runs the command, e.g.: - # - # $ west my-command-name -o FOO BAR - # --optional is FOO - # required is BAR - log.inf('--optional is', args.optional) - log.inf('required is', args.required) diff --git a/scripts/west-commands.yml b/scripts/west-commands.yml deleted file mode 100644 index e32692a..0000000 --- a/scripts/west-commands.yml +++ /dev/null @@ -1,6 +0,0 @@ -west-commands: - - file: scripts/example_west_command.py - commands: - - name: example-west-command - class: ExampleWestCommand - help: an example west extension command diff --git a/tests/lib/custom/CMakeLists.txt b/tests/lib/custom/CMakeLists.txt deleted file mode 100644 index 3942740..0000000 --- a/tests/lib/custom/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2021, Legrand North America, LLC. -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(app_lib_custom_test) - -target_sources(app PRIVATE src/main.c) diff --git a/tests/lib/custom/prj.conf b/tests/lib/custom/prj.conf deleted file mode 100644 index 512194b..0000000 --- a/tests/lib/custom/prj.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ZTEST=y -CONFIG_CUSTOM=y diff --git a/tests/lib/custom/src/main.c b/tests/lib/custom/src/main.c deleted file mode 100644 index 3565a56..0000000 --- a/tests/lib/custom/src/main.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 Legrand North America, LLC. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * @file test custom_lib library - * - * This suite verifies that the methods provided with the custom_lib - * library works correctly. - */ - -#include - -#include - -#include - -ZTEST(custom_lib, test_get_value) -{ - /* Verify standard behavior */ - zassert_equal(custom_get_value(INT_MIN), INT_MIN, "get_value failed input of INT_MIN"); - zassert_equal(custom_get_value(INT_MIN + 1), INT_MIN + 1, - "get_value failed input of INT_MIN + 1"); - zassert_equal(custom_get_value(-1), -1, "get_value failed input of -1"); - zassert_equal(custom_get_value(1), 1, "get_value failed input of 1"); - zassert_equal(custom_get_value(INT_MAX - 1), INT_MAX - 1, - "get_value failed input of INT_MAX - 1"); - zassert_equal(custom_get_value(INT_MAX), INT_MAX, "get_value failed input of INT_MAX"); - - /* Verify override behavior */ - zassert_equal(custom_get_value(0), CONFIG_CUSTOM_GET_VALUE_DEFAULT, - "get_value failed input of 0"); -} - -ZTEST_SUITE(custom_lib, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/lib/custom/testcase.yaml b/tests/lib/custom/testcase.yaml deleted file mode 100644 index afea961..0000000 --- a/tests/lib/custom/testcase.yaml +++ /dev/null @@ -1,8 +0,0 @@ -common: - tags: extensibility - integration_platforms: - - qemu_cortex_m0 -tests: - lib.custom: {} - lib.custom.non_default: - extra_args: CONFIG_CUSTOM_GET_VALUE_DEFAULT=6 diff --git a/west.yml b/west.yml index 7ac5abb..8304d31 100644 --- a/west.yml +++ b/west.yml @@ -2,8 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 manifest: - self: - west-commands: scripts/west-commands.yml + remotes: - name: ncs @@ -13,5 +12,5 @@ manifest: - name: nrf remote: ncs repo-path: sdk-nrf - revision: v3.0.0 + revision: v3.0.2 import: true