diff --git a/tests/lpc175x_6x/project.yml b/tests/lpc175x_6x/project.yml new file mode 100644 index 00000000..2426f39f --- /dev/null +++ b/tests/lpc175x_6x/project.yml @@ -0,0 +1,91 @@ +--- + +# Notes: +# Sample project C code is not presently written to produce a release artifact. +# As such, release build options are disabled. +# This sample, therefore, only demonstrates running a collection of unit tests. + +:project: + :use_exceptions: TRUE + :use_test_preprocessor: TRUE + :use_auxiliary_dependencies: TRUE + :use_deep_dependencies: TRUE + :build_root: build +# :release_build: TRUE + :test_file_prefix: test_ + +:release_build: + :output: test_tinyusb_lpc175x_6x.exe + :use_assembly: FALSE + +:environment: + +:extension: + :executable: .exe + +:paths: + :test: + - +:test/** + :source: + - ../../tinyusb/** + - +:../../demos/bsp/lpc175x_6x/** + - +:../../demos/device/keyboard/* + - -:../../demos/ +# - ../vendor/freertos/freertos/Source/* +# - ../vendor/freertos/freertos/Source/portable/MSVC-MingW/* + + :support: + - ../support + +:defines: + # in order to add common defines: + # 1) remove the trailing [] from the :common: section + # 2) add entries to the :common: section (e.g. :test: has TEST defined) + :commmon: &common_defines + - MCU=MCU_LPC175X_6X -std=gnu99 +# - -mx32 + - CORE_M4 + - __CODE_RED + - _TINY_USB_SOURCE_FILE_ + - _TEST_ + :test: + - *common_defines + :test_preprocess: + - *common_defines +# :release: +# :release_preprocess: + +#:flags: +# :test: +# :compile: +# :dcd_lpc175x_6x.c: +# - -DMCU=MCU_LPC175X_6X + +# Ceedling defaults to using gcc for compiling, linking, etc. +# As [:tools] is blank, gcc will be used (so long as it's in your system path) +# See documentation to configure a given toolchain for use + +:cmock: + :mock_prefix: mock_ + :when_no_prototypes: :warn + :enforce_strict_ordering: TRUE + :plugins: + - :ignore + - :callback + - :array + #:ignore: :args_only + :treat_as: + uint8: HEX8 + uint16: HEX16 + uint32: UINT32 + int8: INT8 + bool: UINT8 + +:plugins: + :load_paths: + - ../vendor/ceedling/plugins + :enabled: + #- stdout_pretty_tests_report + - stdout_ide_tests_report + - module_generator +... diff --git a/tests/lpc175x_6x/rakefile.rb b/tests/lpc175x_6x/rakefile.rb new file mode 100644 index 00000000..6b217f93 --- /dev/null +++ b/tests/lpc175x_6x/rakefile.rb @@ -0,0 +1,4 @@ +PROJECT_CEEDLING_ROOT = "../vendor/ceedling" +load "#{PROJECT_CEEDLING_ROOT}/lib/rakefile.rb" + +task :default => %w[ test:all release ] diff --git a/tests/lpc175x_6x/test/test_dcd_lpc175x_6x.c b/tests/lpc175x_6x/test/test_dcd_lpc175x_6x.c new file mode 100644 index 00000000..a21f518b --- /dev/null +++ b/tests/lpc175x_6x/test/test_dcd_lpc175x_6x.c @@ -0,0 +1,60 @@ +/**************************************************************************/ +/*! + @file test_dcd.c + @author hathach (tinyusb.org) + + @section LICENSE + + Software License Agreement (BSD License) + + Copyright (c) 2013, hathach (tinyusb.org) + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holders nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + This file is part of the tinyusb stack. +*/ +/**************************************************************************/ + +#include +#include "unity.h" +#include "errors.h" +#include "type_helper.h" + +#include "dcd_lpc175x_6x.h" + +extern dcd_dma_descriptor_t* dcd_udca[32]; + +void setUp(void) +{ + +} + +void tearDown(void) +{ +} + +void test_dd_structure(void) +{ + TEST_ASSERT_BITS_LOW(128-1, (uint32_t) dcd_udca); +}