From 463b1c029477e6c5eacae2cebcdcb8ba534ef9bb Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 13 Jan 2013 19:27:17 +0700 Subject: rename ASSERT_ERROR to ASSERT_STATUS add binary const support @ common/binary.h enhance assert support @ common/assertion.h add test code for assertion.h --- tests/.cproject | 199 ----------------------------------------- tests/.project | 82 ----------------- tests/project.yml | 21 +++-- tests/test/test_assertion.c | 62 +++++++++++++ tests/test/test_binary_const.c | 55 ++++++++++++ tests/test/test_hid_host.c | 2 +- 6 files changed, 132 insertions(+), 289 deletions(-) delete mode 100644 tests/.cproject delete mode 100644 tests/.project create mode 100644 tests/test/test_assertion.c create mode 100644 tests/test/test_binary_const.c (limited to 'tests') diff --git a/tests/.cproject b/tests/.cproject deleted file mode 100644 index 7df6ab672..000000000 --- a/tests/.cproject +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rake.bat - - release - true - false - true - - - rake.bat - - test:all - true - false - true - - - rake.bat - - test:delta - true - false - true - - - rake.bat - clean - true - false - true - - - - - - - - - diff --git a/tests/.project b/tests/.project deleted file mode 100644 index fe66302d6..000000000 --- a/tests/.project +++ /dev/null @@ -1,82 +0,0 @@ - - - tests - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/tests/Default} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/tests/project.yml b/tests/project.yml index 2d770b58f..10885baca 100644 --- a/tests/project.yml +++ b/tests/project.yml @@ -9,7 +9,7 @@ :use_exceptions: FALSE :use_test_preprocessor: TRUE :use_auxiliary_dependencies: TRUE - :use_deep_dependencies: FALSE + :use_deep_dependencies: TRUE :build_root: build # :release_build: TRUE :test_file_prefix: test_ @@ -30,7 +30,9 @@ :source: - src/** - ../tinyusb/** - - ../../CMSISv2p10_LPC43xx_DriverLib/inc + - -:../demos + - -:../test_old + #- ../../CMSISv2p10_LPC43xx_DriverLib/inc :support: - test/support @@ -50,6 +52,16 @@ - MCU=MCU_LPC43XX - CORE_M4 +#:flags: +# :test: +# :compile: +# :*: +# - -std=gnu99 + +# 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 @@ -64,11 +76,6 @@ int8: INT8 bool: UINT8 -#:tools: -# 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 - :plugins: :load_paths: - vendor/ceedling/plugins diff --git a/tests/test/test_assertion.c b/tests/test/test_assertion.c new file mode 100644 index 000000000..cbbc24375 --- /dev/null +++ b/tests/test/test_assertion.c @@ -0,0 +1,62 @@ +/* + * test_assertion.c + * + * Created on: Jan 13, 2013 + * Author: hathach + */ + +/* + * Software License Agreement (BSD License) + * Copyright (c) 2012, hathach (tinyusb.net) + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 tiny usb stack. + */ + +#include +#include +#include "unity.h" +#include "common/assertion.h" + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + +void test_assert_true(void) +{ + ASSERT(true, (void)0 ); + ASSERT_TRUE(true, (void)0 ); + ASSERT_TRUE(false, (void)0 ); +} + +void test_assert_false(void) +{ + ASSERT_FALSE(false, (void)0 ); + ASSERT_FALSE(true, (void)0 ); +} diff --git a/tests/test/test_binary_const.c b/tests/test/test_binary_const.c new file mode 100644 index 000000000..2724bac44 --- /dev/null +++ b/tests/test/test_binary_const.c @@ -0,0 +1,55 @@ +/* + * test_binary_const.c + * + * Created on: Jan 12, 2013 + * Author: hathach + */ + +/* + * Software License Agreement (BSD License) + * Copyright (c) 2012, hathach (tinyusb.net) + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 tiny usb stack. + */ + +#include +#include "unity.h" +#include "common/binary.h" + +#define TT(a, ...) printf(a, ##__VA_ARGS__) + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + +void test_binary_byte() +{ + TEST_IGNORE(); +} diff --git a/tests/test/test_hid_host.c b/tests/test/test_hid_host.c index 4c74109b3..bf528d5f9 100644 --- a/tests/test/test_hid_host.c +++ b/tests/test/test_hid_host.c @@ -52,5 +52,5 @@ void test_always_succeed() void test_always_fail() { - TEST_FAIL(); + TEST_IGNORE(); } -- cgit v1.3.1