提交 bff1fc68 编写于 作者: M Mark VanderVoord

rearranged project to centralize all self-test stuff under test directory....

rearranged project to centralize all self-test stuff under test directory. only pull in includes when required.
上级 f8f5c39e
......@@ -3,4 +3,4 @@ rvm:
- "1.9.3"
- "2.0.0"
script:
- rake ci
- cd test && rake ci
......@@ -3,7 +3,6 @@ UNITY_ROOT = File.expand_path(File.dirname(__FILE__)) + '/../..'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require HERE+'rakefile_helper'
TEMP_DIRS = [
......
# ==========================================
# Unity Project - A Test Framework for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
# ==========================================
C_COMPILER=gcc
TARGET_BASE = testunity
ifeq ($(OS),Windows_NT)
TARGET_EXTENSION=.exe
else
TARGET_EXTENSION=.out
endif
TARGET = $(TARGET_BASE)$(TARGET_EXTENSION)
OUT_FILE=-o $(TARGET)
SRC_FILES=src/unity.c test/testunity.c build/testunity_Runner.c
INC_DIRS=-Isrc
SYMBOLS=-DTEST -DUNITY_SUPPORT_64 -DUNITY_INCLUDE_DOUBLE
ifeq ($(OSTYPE),cygwin)
CLEANUP = rm -f build/*.o ; rm -f $(TARGET) ; mkdir -p build
else ifeq ($(OS),Windows_NT)
CLEANUP = del /F /Q build\* && del /F /Q $(TARGET)
else
CLEANUP = rm -f build/*.o ; rm -f $(TARGET) ; mkdir -p build
endif
all: clean default
default:
ruby auto/generate_test_runner.rb test/testunity.c build/testunity_Runner.c
$(C_COMPILER) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES) $(OUT_FILE)
./$(TARGET)
clean:
$(CLEANUP)
......@@ -5,8 +5,6 @@
============================================================================ */
#include "unity.h"
#include <stdio.h>
#include <string.h>
#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; longjmp(Unity.AbortFrame, 1); }
#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; longjmp(Unity.AbortFrame, 1); }
......@@ -231,6 +229,7 @@ void UnityPrintMask(const _U_UINT mask, const _U_UINT number)
//-----------------------------------------------
#ifdef UNITY_FLOAT_VERBOSE
#include <string.h>
void UnityPrintFloat(_UF number)
{
char TempBuffer[32];
......
......@@ -6,7 +6,6 @@
#ifndef UNITY_FRAMEWORK_H
#define UNITY_FRAMEWORK_H
#define UNITY
#include "unity_internals.h"
......@@ -268,4 +267,6 @@
#define TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, __LINE__, message)
#define TEST_ASSERT_DOUBLE_IS_NOT_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, __LINE__, message)
#define TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, __LINE__, message)
//end of UNITY_FRAMEWORK_H
#endif
......@@ -11,7 +11,6 @@
#include "unity_config.h"
#endif
#include <stdio.h>
#include <setjmp.h>
// Unity Attempts to Auto-Detect Integer Types
......@@ -241,7 +240,7 @@ typedef UNITY_FLOAT_TYPE _UF;
#else
//Floating Point Support
//Double Floating Point Support
#ifndef UNITY_DOUBLE_PRECISION
#define UNITY_DOUBLE_PRECISION (1e-12f)
#endif
......@@ -252,16 +251,27 @@ typedef UNITY_DOUBLE_TYPE _UD;
#endif
#ifdef UNITY_DOUBLE_VERBOSE
#ifndef UNITY_FLOAT_VERBOSE
#define UNITY_FLOAT_VERBOSE
#endif
#endif
//-------------------------------------------------------
// Output Method
//-------------------------------------------------------
#ifndef UNITY_OUTPUT_CHAR
//Default to using putchar, which is defined in stdio.h above
//Default to using putchar, which is defined in stdio.h
#include <stdio.h>
#define UNITY_OUTPUT_CHAR(a) putchar(a)
#else
//If defined as something else, make sure we declare it here so it's ready for use
extern int UNITY_OUTPUT_CHAR(int);
#endif
//-------------------------------------------------------
......@@ -674,4 +684,5 @@ extern const char* UnityStrErr64;
#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_FLOAT_IS_NOT_DET)
#endif
//End of UNITY_INTERNALS_H
#endif
......@@ -8,7 +8,6 @@ UNITY_ROOT = File.expand_path(File.dirname(__FILE__)) + '/'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require UNITY_ROOT + 'rakefile_helper'
TEMP_DIRS = [
......@@ -25,12 +24,7 @@ task :prepare_for_tests => TEMP_DIRS
include RakefileHelpers
# Load proper GCC as defult configuration
if 1.size == 8 # 8 bytes => 64-bits
DEFAULT_CONFIG_FILE = 'gcc_64.yml'
else # Assume 32-bit otherwise
DEFAULT_CONFIG_FILE = 'gcc_32.yml'
end
DEFAULT_CONFIG_FILE = 'gcc_auto_stdint.yml'
configure_toolchain(DEFAULT_CONFIG_FILE)
desc "Test unity with its own unit tests"
......
......@@ -6,9 +6,9 @@
require 'yaml'
require 'fileutils'
require UNITY_ROOT + 'auto/unity_test_summary'
require UNITY_ROOT + 'auto/generate_test_runner'
require UNITY_ROOT + 'auto/colour_reporter'
require UNITY_ROOT + '../auto/unity_test_summary'
require UNITY_ROOT + '../auto/generate_test_runner'
require UNITY_ROOT + '../auto/colour_reporter'
module RakefileHelpers
......
---
compiler:
path: clang
source_path: 'src/'
unit_tests_path: &unit_tests_path 'test/'
source_path: '../src/'
unit_tests_path: &unit_tests_path 'tests/'
build_path: &build_path 'build/'
options:
- '-c'
......
compiler:
path: gcc
source_path: 'src/'
unit_tests_path: &unit_tests_path 'test/'
source_path: '../src/'
unit_tests_path: &unit_tests_path 'tests/'
build_path: &build_path 'build/'
options:
- '-c'
......
compiler:
path: gcc
source_path: 'src/'
unit_tests_path: &unit_tests_path 'test/'
source_path: '../src/'
unit_tests_path: &unit_tests_path 'tests/'
build_path: &build_path 'build/'
options:
- '-c'
......
compiler:
path: gcc
source_path: 'src/'
unit_tests_path: &unit_tests_path 'test/'
source_path: '../src/'
unit_tests_path: &unit_tests_path 'tests/'
build_path: &build_path 'build/'
options:
- '-c'
......
compiler:
path: gcc
source_path: 'src/'
unit_tests_path: &unit_tests_path 'test/'
source_path: '../src/'
unit_tests_path: &unit_tests_path 'tests/'
build_path: &build_path 'build/'
options:
- '-c'
......
compiler:
path: gcc
source_path: 'src/'
unit_tests_path: &unit_tests_path 'test/'
source_path: '../src/'
unit_tests_path: &unit_tests_path 'tests/'
build_path: &build_path 'build/'
options:
- '-c'
......
# rumor has it that this yaml file works for the standard edition of the
# rumor has it that this yaml file works for the standard edition of the
# hitech PICC18 compiler, but not the pro version.
#
compiler:
path: cd build && picc18
source_path: 'c:\Projects\NexGen\Prototypes\CMockTest\src\'
unit_tests_path: &unit_tests_path 'c:\Projects\NexGen\Prototypes\CMockTest\test\'
build_path: &build_path 'c:\Projects\NexGen\Prototypes\CMockTest\build\'
source_path: '..\src\'
unit_tests_path: &unit_tests_path 'tests\'
build_path: &build_path 'build\'
options:
- --chip=18F87J10
- --ide=hitide
......@@ -19,7 +19,7 @@ compiler:
- -Bl # Large memory model
- -G # generate symbol file
- --cp=16 # 16-bit pointers
- --double=24
- --double=24
- -N255 # 255-char symbol names
- --opt=none # Do not use any compiler optimziations
- -c # compile only
......@@ -35,62 +35,62 @@ compiler:
- 'c:/CMock/vendor/unity/examples/helper/'
- *unit_tests_path
defines:
prefix: '-D'
items:
- UNITY_INT_WIDTH=16
prefix: '-D'
items:
- UNITY_INT_WIDTH=16
- UNITY_POINTER_WIDTH=16
- CMOCK_MEM_STATIC
- CMOCK_MEM_STATIC
- CMOCK_MEM_SIZE=3000
- UNITY_SUPPORT_TEST_CASES
- UNITY_SUPPORT_TEST_CASES
- _PICC18
object_files:
# prefix: '-O' # Hi-Tech doesn't want a prefix. They key off of filename .extensions, instead
extension: '.obj'
destination: *build_path
object_files:
# prefix: '-O' # Hi-Tech doesn't want a prefix. They key off of filename .extensions, instead
extension: '.obj'
destination: *build_path
linker:
path: cd build && picc18
options:
- --chip=18F87J10
- --ide=hitide
- --cp=24 # 24-bit pointers. Is this needed for linker??
- --double=24 # Is this needed for linker??
linker:
path: cd build && picc18
options:
- --chip=18F87J10
- --ide=hitide
- --cp=24 # 24-bit pointers. Is this needed for linker??
- --double=24 # Is this needed for linker??
- -Lw # Scan the pic87*w.lib in the lib/ of the compiler installation directory
- --summary=mem,file # info listing
- --summary=+psect
- --summary=+hex
- --output=+intel
- --output=+mcof
- --runtime=+init # Directs startup code to copy idata, ibigdata and ifardata psects from ROM to RAM.
- --runtime=+clear # Directs startup code to clear bss, bigbss, rbss and farbss psects
- --runtime=+clib # link in the c-runtime
- --runtime=+keep # Keep the generated startup src after its obj is linked
- -G # Generate src-level symbol file
- -MIWasTheLastToBuild.map
- --warn=0 # allow all normal warning messages
- -Bl # Large memory model (probably not needed for linking)
includes:
prefix: '-I'
object_files:
path: *build_path
extension: '.obj'
bin_files:
prefix: '-O'
extension: '.hex'
destination: *build_path
- --summary=mem,file # info listing
- --summary=+psect
- --summary=+hex
- --output=+intel
- --output=+mcof
- --runtime=+init # Directs startup code to copy idata, ibigdata and ifardata psects from ROM to RAM.
- --runtime=+clear # Directs startup code to clear bss, bigbss, rbss and farbss psects
- --runtime=+clib # link in the c-runtime
- --runtime=+keep # Keep the generated startup src after its obj is linked
- -G # Generate src-level symbol file
- -MIWasTheLastToBuild.map
- --warn=0 # allow all normal warning messages
- -Bl # Large memory model (probably not needed for linking)
includes:
prefix: '-I'
object_files:
path: *build_path
extension: '.obj'
bin_files:
prefix: '-O'
extension: '.hex'
destination: *build_path
simulator:
path:
pre_support:
- 'java -client -jar ' # note space
- ['C:\Program Files\HI-TECH Software\HI-TIDE\3.15\lib\', 'simpic18.jar']
- 18F87J10
post_support:
simulator:
path:
pre_support:
- 'java -client -jar ' # note space
- ['C:\Program Files\HI-TECH Software\HI-TIDE\3.15\lib\', 'simpic18.jar']
- 18F87J10
post_support:
:cmock:
:plugins: []
:includes:
- Types.h
:cmock:
:plugins: []
:includes:
- Types.h
:suite_teardown: |
if (num_failures)
_FAILED_TEST();
......@@ -98,4 +98,4 @@ simulator:
_PASSED_TESTS();
return 0;
colour: true
\ No newline at end of file
colour: true
tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 4.0 Kickstart\'
compiler:
path: [*tools_root, 'arm\bin\iccarm.exe']
source_path: 'src\'
unit_tests_path: &unit_tests_path 'test\'
source_path: '..\src\'
unit_tests_path: &unit_tests_path 'tests\'
build_path: &build_path 'build\'
options:
- --dlib_config
......@@ -14,7 +14,7 @@ compiler:
- --no_code_motion
- --no_tbaa
- --no_clustering
- --no_scheduling
- --no_scheduling
- --debug
- --cpu_mode thumb
- --endian little
......@@ -86,4 +86,4 @@ simulator:
- sim
colour: true
:unity:
:plugins: []
\ No newline at end of file
:plugins: []
tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 5.3\'
compiler:
path: [*tools_root, 'arm\bin\iccarm.exe']
source_path: 'src\'
unit_tests_path: &unit_tests_path 'test\'
source_path: '..\src\'
unit_tests_path: &unit_tests_path 'tests\'
build_path: &build_path 'build\'
options:
- --dlib_config
......@@ -13,7 +13,7 @@ compiler:
- --no_code_motion
- --no_tbaa
- --no_clustering
- --no_scheduling
- --no_scheduling
- --debug
- --cpu_mode thumb
- --endian=little
......@@ -76,4 +76,4 @@ simulator:
- sim
colour: true
:unity:
:plugins: []
\ No newline at end of file
:plugins: []
tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 5.3\'
compiler:
path: [*tools_root, 'arm\bin\iccarm.exe']
source_path: 'src\'
unit_tests_path: &unit_tests_path 'test\'
source_path: '..\src\'
unit_tests_path: &unit_tests_path 'tests\'
build_path: &build_path 'build\'
options:
- --dlib_config
......@@ -13,7 +13,7 @@ compiler:
- --no_code_motion
- --no_tbaa
- --no_clustering
- --no_scheduling
- --no_scheduling
- --debug
- --cpu_mode thumb
- --endian=little
......@@ -76,4 +76,4 @@ simulator:
- sim
colour: true
:unity:
:plugins: []
\ No newline at end of file
:plugins: []
......@@ -2,10 +2,10 @@
tools_root: &tools_root 'C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\'
compiler:
path: [*tools_root, 'arm\bin\iccarm.exe']
source_path: 'src\'
unit_tests_path: &unit_tests_path 'test\'
source_path: '..\src\'
unit_tests_path: &unit_tests_path 'tests\'
build_path: &build_path 'build\'
options:
options:
- --diag_suppress=Pa050
#- --diag_suppress=Pe111
- --debug
......@@ -27,7 +27,7 @@ compiler:
# - --no_code_motion
# - --no_tbaa
# - --no_clustering
# - --no_scheduling
# - --no_scheduling
includes:
prefix: '-I'
......@@ -59,7 +59,7 @@ linker:
- --semihosting
- --entry __iar_program_start
- --config
- [*tools_root, 'arm\config\generic.icf']
- [*tools_root, 'arm\config\generic.icf']
# - ['C:\Temp\lm3s9b92.icf']
object_files:
path: *build_path
......@@ -90,4 +90,4 @@ simulator:
#- sim
colour: true
:unity:
:plugins: []
\ No newline at end of file
:plugins: []
......@@ -3,8 +3,8 @@
tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 5.4\'
compiler:
path: [*tools_root, 'arm\bin\iccarm.exe']
source_path: 'src\'
unit_tests_path: &unit_tests_path 'test\'
source_path: '..\src\'
unit_tests_path: &unit_tests_path 'tests\'
build_path: &build_path 'build\'
options:
- --dlib_config
......@@ -80,4 +80,4 @@ simulator:
- sim
colour: true
:unity:
:plugins: []
\ No newline at end of file
:plugins: []
......@@ -8,8 +8,8 @@ core_config: &core_config [*core_root, 'config\']
compiler:
path: [*core_bin, 'icc430.exe']
source_path: 'src\'
unit_tests_path: &unit_tests_path 'test\'
source_path: '..\src\'
unit_tests_path: &unit_tests_path 'tests\'
build_path: &build_path 'build\'
options:
- --dlib_config
......@@ -91,4 +91,4 @@ simulator:
- -d sim
colour: true
:unity:
:plugins: []
\ No newline at end of file
:plugins: []
tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 6.0\'
compiler:
path: [*tools_root, 'sh\bin\iccsh.exe']
source_path: 'src\'
unit_tests_path: &unit_tests_path 'test\'
source_path: '..\src\'
unit_tests_path: &unit_tests_path 'tests\'
build_path: &build_path 'build\'
options:
- -e
......@@ -82,4 +82,4 @@ simulator:
- sim
colour: true
:unity:
:plugins: []
\ No newline at end of file
:plugins: []
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册