提交 5932565b 编写于 作者: W Warwick Stone

Updated example

 *  Moved existing example to its own directory, with the intention of adding more examples
 *  Existing example uses its own .yml file instead of one of the files in targets/.
上级 843370a7
......@@ -4,7 +4,7 @@
# [Released under MIT License. Please refer to license.txt for details]
# ==========================================
UNITY_ROOT=..
UNITY_ROOT=../..
C_COMPILER=gcc
TARGET_BASE1=test1
TARGET_BASE2=test2
......
HERE = File.expand_path(File.dirname(__FILE__)) + '/'
UNITY_ROOT = File.expand_path(File.dirname(__FILE__)) + '/../..'
require 'rake'
require 'rake/clean'
......@@ -19,7 +20,7 @@ task :prepare_for_tests => TEMP_DIRS
include RakefileHelpers
# Load default configuration, for now
DEFAULT_CONFIG_FILE = 'gcc_32.yml'
DEFAULT_CONFIG_FILE = 'target_gcc_32.yml'
configure_toolchain(DEFAULT_CONFIG_FILE)
task :unit => [:prepare_for_tests] do
......
require 'yaml'
require 'fileutils'
require HERE+'../auto/unity_test_summary'
require HERE+'../auto/generate_test_runner'
require HERE+'../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
C_EXTENSION = '.c'
def load_configuration(config_file)
$cfg_file = "../targets/#{config_file}"
$cfg_file = config_file
$cfg = YAML.load(File.read($cfg_file))
end
......@@ -19,7 +19,7 @@ module RakefileHelpers
def configure_toolchain(config_file=DEFAULT_CONFIG_FILE)
config_file += '.yml' unless config_file =~ /\.yml$/
load_configuration('../targets/'+config_file)
load_configuration(config_file)
configure_clean
end
......
# Copied from ~Unity/targets/gcc_32.yml
unity_root: &unity_root '../..'
compiler:
path: gcc
source_path: 'src/'
unit_tests_path: &unit_tests_path 'test/'
build_path: &build_path 'build/'
options:
- '-c'
- '-m32'
- '-Wall'
- '-Wno-address'
- '-std=c99'
- '-pedantic'
includes:
prefix: '-I'
items:
- 'src/'
- '../../src/'
- *unit_tests_path
defines:
prefix: '-D'
items:
- UNITY_INCLUDE_DOUBLE
- UNITY_SUPPORT_TEST_CASES
object_files:
prefix: '-o'
extension: '.o'
destination: *build_path
linker:
path: gcc
options:
- -lm
- '-m32'
includes:
prefix: '-I'
object_files:
path: *build_path
extension: '.o'
bin_files:
prefix: '-o'
extension: '.exe'
destination: *build_path
colour: true
:unity:
:plugins: []
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册