Move all self-testing into a subdirectory, like we did with Unity

This commit is contained in:
Mark VanderVoord
2017-04-07 16:27:13 -04:00
parent abd526d585
commit 2af7c7de43
79 changed files with 116 additions and 116 deletions
+1 -1
View File
@@ -16,4 +16,4 @@ install:
- bundle install
script:
- bundle exec rake ci
- bundle exec cd test && rake ci
+7 -7
View File
@@ -2,15 +2,15 @@
# CMock Project - Automatic Mock Generation for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
# ==========================================
# ==========================================
# Setup our load path:
[
'lib',
'vendor/behaviors/lib',
'vendor/hardmock/lib',
'vendor/unity/auto/',
'test/system/'
[
'./lib',
'./vendor/behaviors/lib',
'./vendor/hardmock/lib',
'./vendor/unity/auto/',
'./test/system/'
].each do |dir|
$LOAD_PATH.unshift( File.join( File.expand_path(File.dirname(__FILE__) + "/../"), dir) )
end
+4 -4
View File
@@ -1,9 +1,9 @@
---
:files:
- 'src/cmock.c'
- 'test/c/TestCMockC.c'
- 'test/c/TestCMockC_Runner.c'
- 'vendor/unity/src/unity.c'
- '../src/cmock.c'
- './c/TestCMockC.c'
- './c/TestCMockC_Runner.c'
- '../vendor/unity/src/unity.c'
:options:
- 'TEST'
- 'CMOCK_MEM_STATIC'
+4 -4
View File
@@ -1,9 +1,9 @@
---
:files:
- 'src/cmock.c'
- 'test/c/TestCMockCDynamic.c'
- 'test/c/TestCMockCDynamic_Runner.c'
- 'vendor/unity/src/unity.c'
- '../src/cmock.c'
- './c/TestCMockCDynamic.c'
- './c/TestCMockCDynamic_Runner.c'
- '../vendor/unity/src/unity.c'
:options:
- 'TEST'
- 'CMOCK_MEM_DYNAMIC'
+9 -9
View File
@@ -4,7 +4,7 @@
# [Released under MIT License. Please refer to license.txt for details]
# ==============================================================================
require './config/test_environment'
require '../config/test_environment'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
@@ -13,11 +13,11 @@ require './rakefile_helper'
include RakefileHelpers
DEFAULT_CONFIG_FILE = 'gcc.yml'
CMOCK_ROOT = File.expand_path(File.dirname(__FILE__))
CMOCK_TEST_ROOT = File.expand_path(File.dirname(__FILE__))
SYSTEM_TEST_SUPPORT_DIRS = [
File.join(CMOCK_ROOT, 'test/system/generated'),
File.join(CMOCK_ROOT, 'test/system/build')
File.join(CMOCK_TEST_ROOT, 'system/generated'),
File.join(CMOCK_TEST_ROOT, 'system/build')
]
SYSTEM_TEST_SUPPORT_DIRS.each do |dir|
@@ -48,12 +48,12 @@ task :test => [:clobber, :prep_system_tests, 'test:units', 'test:c', 'test:syste
namespace :test do
desc "Run Unit Tests"
Rake::TestTask.new('units') do |t|
t.pattern = 'test/unit/*_test.rb'
t.pattern = 'unit/*_test.rb'
t.verbose = true
end
#individual unit tests
FileList['test/unit/*_test.rb'].each do |test|
FileList['unit/*_test.rb'].each do |test|
Rake::TestTask.new(File.basename(test,'.*').sub('_test','')) do |t|
t.pattern = test
t.verbose = true
@@ -70,8 +70,8 @@ namespace :test do
desc "Run System Tests"
task :system => [:clobber, :prep_system_tests] do
#get a list of all system tests, removing unsupported tests for this compiler
sys_unsupported = $cfg['unsupported'].map {|a| 'test/system/test_interactions/'+a+'.yml'}
sys_tests_to_run = FileList['test/system/test_interactions/*.yml'] - sys_unsupported
sys_unsupported = $cfg['unsupported'].map {|a| 'system/test_interactions/'+a+'.yml'}
sys_tests_to_run = FileList['system/test_interactions/*.yml'] - sys_unsupported
compile_unsupported = $cfg['unsupported'].map {|a| SYSTEST_COMPILE_MOCKABLES_PATH+a+'.h'}
compile_tests_to_run = FileList[SYSTEST_COMPILE_MOCKABLES_PATH + '*.h'] - compile_unsupported
unless (sys_unsupported.empty? and compile_unsupported.empty?)
@@ -87,7 +87,7 @@ namespace :test do
end
#individual system tests
FileList['test/system/test_interactions/*.yml'].each do |test|
FileList['system/test_interactions/*.yml'].each do |test|
basename = File.basename(test,'.*')
desc "Run system test #{basename}"
task basename do
+11 -11
View File
@@ -6,16 +6,16 @@
require 'yaml'
require 'fileutils'
require './vendor/unity/auto/generate_test_runner'
require './vendor/unity/auto/unity_test_summary'
require './test/system/systest_generator'
require './vendor/unity/auto/colour_reporter.rb'
require '../vendor/unity/auto/generate_test_runner'
require '../vendor/unity/auto/unity_test_summary'
require '../vendor/unity/auto/colour_reporter.rb'
require './system/systest_generator'
module RakefileHelpers
SYSTEST_GENERATED_FILES_PATH = 'test/system/generated/'
SYSTEST_BUILD_FILES_PATH = 'test/system/build/'
SYSTEST_COMPILE_MOCKABLES_PATH = 'test/system/test_compilation/'
SYSTEST_GENERATED_FILES_PATH = './system/generated/'
SYSTEST_BUILD_FILES_PATH = './system/build/'
SYSTEST_COMPILE_MOCKABLES_PATH = './system/test_compilation/'
C_EXTENSION = '.c'
RESULT_EXTENSION = '.result'
@@ -172,7 +172,7 @@ module RakefileHelpers
end
def run_system_test_interactions(test_case_files)
load './lib/cmock.rb'
load '../lib/cmock.rb'
SystemTestGenerator.new.generate_files(test_case_files)
test_files = FileList.new(SYSTEST_GENERATED_FILES_PATH + 'test*.c')
@@ -308,7 +308,7 @@ module RakefileHelpers
end
def run_system_test_compilations(mockables)
load './lib/cmock.rb'
load '../lib/cmock.rb'
load_configuration($cfg_file)
$cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil?
@@ -326,7 +326,7 @@ module RakefileHelpers
end
def run_system_test_profiles(mockables)
load './lib/cmock.rb'
load '../lib/cmock.rb'
load_configuration($cfg_file)
$cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil?
@@ -353,7 +353,7 @@ module RakefileHelpers
report "UNIT TEST C CODE\n"
report "----------------\n"
errors = false
FileList.new("test/c/*.yml").each do |yaml_file|
FileList.new("c/*.yml").each do |yaml_file|
test = YAML.load(File.read(yaml_file))
report "\nTesting #{yaml_file.sub('.yml','')}"
report "(#{test[:options].join(', ')})"
+4 -4
View File
@@ -1,9 +1,9 @@
---
:cmock:
---
:cmock:
:plugins: []
:includes: []
:mock_path: test/system/generated/
:mock_path: ./system/generated/
:mock_prefix: mock_
:treat_as_void:
:treat_as_void:
- OSEK_TASK
- VOID_TYPE_CRAZINESS
@@ -1,16 +1,16 @@
---
compiler:
path: clang
source_path: &systest_generated_path 'test/system/generated/'
unit_tests_path: &unit_tests_path 'examples/test/'
mocks_path: &systest_mocks_path 'test/system/generated/'
build_path: &systest_build_path 'test/system/build/'
source_path: &systest_generated_path './system/generated/'
unit_tests_path: &unit_tests_path '../examples/test/'
mocks_path: &systest_mocks_path './system/generated/'
build_path: &systest_build_path './system/build/'
options:
- '-c'
- '-Wall'
- '-Wextra'
- '-Werror'
- '-Wcast-qual'
#- '-Wcast-qual'
- '-Wconversion'
- '-Wtautological-compare'
#- '-Wtautological-pointer-compare'
@@ -41,7 +41,7 @@ compiler:
- '-Wno-invalid-token-paste'
- '-fms-extensions'
- '-fno-omit-frame-pointer'
- '-ffloat-store'
#- '-ffloat-store'
- '-fno-common'
- '-fstrict-aliasing'
- '-std=gnu99'
@@ -53,11 +53,11 @@ compiler:
- *systest_generated_path
- *unit_tests_path
- *systest_mocks_path
- 'src/'
- 'vendor/unity/src/'
- 'vendor/c_exception/lib/'
- 'test/system/test_compilation/'
- 'test/'
- '../src/'
- '../vendor/unity/src/'
- '../vendor/c_exception/lib/'
- './system/test_compilation/'
- './'
defines:
prefix: '-D'
items:
+9 -9
View File
@@ -1,10 +1,10 @@
---
compiler:
path: gcc
source_path: &systest_generated_path 'test/system/generated/'
unit_tests_path: &unit_tests_path 'examples/test/'
mocks_path: &systest_mocks_path 'test/system/generated/'
build_path: &systest_build_path 'test/system/build/'
source_path: &systest_generated_path './system/generated/'
unit_tests_path: &unit_tests_path '../examples/test/'
mocks_path: &systest_mocks_path './system/generated/'
build_path: &systest_build_path './system/build/'
options:
- '-c'
- '-Wall'
@@ -21,11 +21,11 @@ compiler:
- *systest_generated_path
- *unit_tests_path
- *systest_mocks_path
- 'src/'
- 'vendor/unity/src/'
- 'vendor/c_exception/lib/'
- 'test/system/test_compilation/'
- 'test/'
- '../src/'
- '../vendor/unity/src/'
- '../vendor/c_exception/lib/'
- './system/test_compilation/'
- './'
defines:
prefix: '-D'
items:
@@ -1,10 +1,10 @@
---
compiler:
path: gcc
source_path: &systest_generated_path 'test/system/generated/'
unit_tests_path: &unit_tests_path 'examples/test/'
mocks_path: &systest_mocks_path 'test/system/generated/'
build_path: &systest_build_path 'test/system/build/'
source_path: &systest_generated_path './system/generated/'
unit_tests_path: &unit_tests_path '../examples/test/'
mocks_path: &systest_mocks_path './system/generated/'
build_path: &systest_build_path './system/build/'
options:
- '-c'
- '-m64'
@@ -20,11 +20,11 @@ compiler:
- *systest_generated_path
- *unit_tests_path
- *systest_mocks_path
- 'src/'
- 'vendor/unity/src/'
- 'vendor/c_exception/lib/'
- 'test/system/test_compilation/'
- 'test/'
- '../src/'
- '../vendor/unity/src/'
- '../vendor/c_exception/lib/'
- './system/test_compilation/'
- './'
defines:
prefix: '-D'
items:
@@ -1,10 +1,10 @@
---
compiler:
path: gcc
source_path: &systest_generated_path 'test/system/generated/'
unit_tests_path: &unit_tests_path 'examples/test/'
mocks_path: &systest_mocks_path 'test/system/generated/'
build_path: &systest_build_path 'test/system/build/'
source_path: &systest_generated_path './system/generated/'
unit_tests_path: &unit_tests_path '../examples/test/'
mocks_path: &systest_mocks_path './system/generated/'
build_path: &systest_build_path './system/build/'
options:
- '-c'
- '-Wall'
@@ -21,11 +21,11 @@ compiler:
- *systest_generated_path
- *unit_tests_path
- *systest_mocks_path
- 'src/'
- 'vendor/unity/src/'
- 'vendor/c_exception/lib/'
- 'test/system/test_compilation/'
- 'test/'
- '../src/'
- '../vendor/unity/src/'
- '../vendor/c_exception/lib/'
- './system/test_compilation/'
- './'
defines:
prefix: '-D'
items:
@@ -1,10 +1,10 @@
tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 4.0\'
compiler:
path: [*tools_root, 'arm\bin\iccarm.exe']
source_path: &systest_generated_path 'test/system/generated/'
unit_tests_path: &unit_tests_path 'examples/test/'
mocks_path: &systest_mocks_path 'test/system/generated/'
build_path: &systest_build_path 'test/system/build/'
source_path: &systest_generated_path './system/generated/'
unit_tests_path: &unit_tests_path '../examples/test/'
mocks_path: &systest_mocks_path './system/generated/'
build_path: &systest_build_path './system/build/'
options:
- --dlib_config
- [*tools_root, 'arm\lib\dl4tptinl8n.h']
@@ -38,11 +38,11 @@ compiler:
- *systest_generated_path
- *unit_tests_path
- *systest_mocks_path
- 'src/'
- 'vendor/unity/src/'
- 'vendor/c_exception/lib/'
- 'test/system/test_compilation/'
- 'test\'
- '../src/'
- '../vendor/unity/src/'
- '../vendor/c_exception/lib/'
- './system/test_compilation/'
- './'
defines:
prefix: '-D'
items:
@@ -1,10 +1,10 @@
tools_root: &tools_root 'C:\Program Files\IAR Systems\Embedded Workbench 5.3\'
compiler:
path: [*tools_root, 'arm\bin\iccarm.exe']
source_path: &systest_generated_path 'test/system/generated/'
unit_tests_path: &unit_tests_path 'examples/test/'
mocks_path: &systest_mocks_path 'test/system/generated/'
build_path: &systest_build_path 'test/system/build/'
source_path: &systest_generated_path './system/generated/'
unit_tests_path: &unit_tests_path '../examples/test/'
mocks_path: &systest_mocks_path './system/generated/'
build_path: &systest_build_path './system/build/'
options:
- --dlib_config
- [*tools_root, 'arm\inc\DLib_Config_Normal.h']
@@ -36,12 +36,12 @@ compiler:
- *systest_generated_path
- *unit_tests_path
- *systest_mocks_path
- 'src/'
- 'vendor/unity/src/'
- 'vendor/c_exception/lib/'
- 'iar\iar_v5\incIAR\'
- 'test\system\test_compilation\'
- 'test\'
- '../src/'
- '../vendor/unity/src/'
- '../vendor/c_exception/lib/'
- './system/test_compilation/'
- './'
- '.\iar\iar_v5\incIAR\'
defines:
prefix: '-D'
items:
+1 -1
View File
@@ -6,7 +6,7 @@
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_config'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_config'
describe CMockConfig, "Verify CMockConfig Module" do
+1 -1
View File
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_file_writer'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_file_writer'
describe CMockFileWriter, "Verify CMockFileWriter Module" do
+1 -1
View File
@@ -7,7 +7,7 @@
$ThisIsOnlyATest = true
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_generator'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator'
class MockedPluginHelper
def initialize return_this
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_generator_plugin_array'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_array'
describe CMockGeneratorPluginArray, "Verify CMockPGeneratorluginArray Module" do
before do
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_generator_plugin_callback'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_callback'
describe CMockGeneratorPluginCallback, "Verify CMockGeneratorPluginCallback Module" do
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_generator_plugin_cexception'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_cexception'
describe CMockGeneratorPluginCexception, "Verify CMockGeneratorPluginCexception Module" do
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_generator_plugin_expect'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect'
describe CMockGeneratorPluginExpect, "Verify CMockGeneratorPluginExpect Module Without Global Ordering" do
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_generator_plugin_expect_any_args.rb'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect_any_args.rb'
describe CMockGeneratorPluginExpectAnyArgs, "Verify CMockGeneratorPluginExpectAnyArgs Module" do
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_generator_plugin_expect'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect'
describe CMockGeneratorPluginExpect, "Verify CMockGeneratorPluginExpect Module with Global Ordering" do
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_generator_plugin_ignore_arg'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_ignore_arg'
describe CMockGeneratorPluginIgnoreArg, "Verify CMockGeneratorPluginIgnoreArg Module" do
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_generator_plugin_ignore'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_ignore'
describe CMockGeneratorPluginIgnore, "Verify CMockGeneratorPluginIgnore Module" do
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_generator_plugin_return_thru_ptr'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_return_thru_ptr'
describe CMockGeneratorPluginReturnThruPtr, "Verify CMockGeneratorPluginReturnThruPtr Module" do
+1 -1
View File
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_generator_utils'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_utils'
describe CMockGeneratorUtils, "Verify CMockGeneratorUtils Module" do
+1 -1
View File
@@ -7,7 +7,7 @@
$ThisIsOnlyATest = true
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_header_parser'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_header_parser'
describe CMockHeaderParser, "Verify CMockHeaderParser Module" do
+4 -4
View File
@@ -5,10 +5,10 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_plugin_manager'
require 'cmock_generator_plugin_expect'
require 'cmock_generator_plugin_ignore'
require 'cmock_generator_plugin_cexception'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_plugin_manager'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_expect'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_ignore'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_generator_plugin_cexception'
describe CMockPluginManager, "Verify CMockPluginManager Module" do
+1 -1
View File
@@ -5,7 +5,7 @@
# ==========================================
require File.expand_path(File.dirname(__FILE__)) + "/../test_helper"
require 'cmock_unityhelper_parser'
require File.expand_path(File.dirname(__FILE__)) + '/../../lib/cmock_unityhelper_parser'
describe CMockUnityHelperParser, "Verify CMockUnityHelperParser Module" do