Skip to content

Commit 0c83c54

Browse files
author
Arnd R. Strube
committed
Merge remote-tracking branch 'arstrube/master' into lgln
2 parents 116c02b + 8397791 commit 0c83c54

File tree

15 files changed

+97
-154
lines changed

15 files changed

+97
-154
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ gcov*.html
2525
ErrorLogs
2626
testResults
2727
.metadata
28+
/ipch
2829
Debug
2930
Release
3031
*/Debug/*

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project(CppUTest)
22

33
set(CppUTest_version_major 3)
4-
set(CppUTest_version_minor 7dev)
4+
set(CppUTest_version_minor 8dev)
55

66
# 2.6.3 is needed for ctest support
77
cmake_minimum_required(VERSION 2.6.3)

CppUTest.vcproj

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="Windows-1252"?>
22
<VisualStudioProject
33
ProjectType="Visual C++"
4-
Version="8,00"
4+
Version="8.00"
55
Name="CppUTest"
66
ProjectGUID="{EC28C821-4AB8-458F-A821-C6E65607B781}"
77
>
@@ -15,8 +15,8 @@
1515
<Configurations>
1616
<Configuration
1717
Name="Debug|Win32"
18-
OutputDirectory=".\Debug"
19-
IntermediateDirectory=".\Debug"
18+
OutputDirectory="lib"
19+
IntermediateDirectory="cpputest_build\Debug\$(ProjectName)"
2020
ConfigurationType="4"
2121
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
2222
UseOfMFC="0"
@@ -46,10 +46,6 @@
4646
BasicRuntimeChecks="3"
4747
RuntimeLibrary="3"
4848
PrecompiledHeaderFile=".\Debug/CppUTest.pch"
49-
AssemblerListingLocation=".\Debug/"
50-
ObjectFile=".\Debug/"
51-
ProgramDataBaseFileName=".\Debug/"
52-
BrowseInformation="1"
5349
WarningLevel="3"
5450
SuppressStartupBanner="true"
5551
DebugInformationFormat="4"
@@ -67,7 +63,7 @@
6763
/>
6864
<Tool
6965
Name="VCLibrarianTool"
70-
OutputFile="lib\CppUTest.lib"
66+
OutputFile="$(OutDir)\$(ProjectName)d.lib"
7167
SuppressStartupBanner="true"
7268
/>
7369
<Tool
@@ -79,7 +75,6 @@
7975
<Tool
8076
Name="VCBscMakeTool"
8177
SuppressStartupBanner="true"
82-
OutputFile=".\Debug/CppUTest.bsc"
8378
/>
8479
<Tool
8580
Name="VCFxCopTool"
@@ -90,8 +85,8 @@
9085
</Configuration>
9186
<Configuration
9287
Name="Release|Win32"
93-
OutputDirectory=".\Release"
94-
IntermediateDirectory=".\Release"
88+
OutputDirectory="lib"
89+
IntermediateDirectory="cpputest_build\Release\$(ProjectName)"
9590
ConfigurationType="4"
9691
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
9792
UseOfMFC="0"
@@ -122,10 +117,6 @@
122117
StringPooling="true"
123118
RuntimeLibrary="0"
124119
EnableFunctionLevelLinking="true"
125-
PrecompiledHeaderFile=".\Release/CppUTest.pch"
126-
AssemblerListingLocation=".\Release/"
127-
ObjectFile=".\Release/"
128-
ProgramDataBaseFileName=".\Release/"
129120
WarningLevel="3"
130121
SuppressStartupBanner="true"
131122
/>
@@ -142,7 +133,6 @@
142133
/>
143134
<Tool
144135
Name="VCLibrarianTool"
145-
OutputFile=".\Release\CppUTest.lib"
146136
SuppressStartupBanner="true"
147137
/>
148138
<Tool
@@ -154,7 +144,6 @@
154144
<Tool
155145
Name="VCBscMakeTool"
156146
SuppressStartupBanner="true"
157-
OutputFile=".\Release/CppUTest.bsc"
158147
/>
159148
<Tool
160149
Name="VCFxCopTool"

CppUTest.vcxproj

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
<PropertyGroup Label="UserMacros" />
3939
<PropertyGroup>
4040
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
41-
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
42-
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
43-
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
44-
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
41+
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">lib\</OutDir>
42+
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">cpputest_build\Debug\</IntDir>
43+
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">lib\</OutDir>
44+
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">cpputest_build\Release\</IntDir>
4545
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)d</TargetName>
4646
</PropertyGroup>
4747
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -51,10 +51,6 @@
5151
<PreprocessorDefinitions>_LIB;WIN32;_DEBUG;STDC_WANT_SECURE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
5252
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
5353
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
54-
<PrecompiledHeaderOutputFile>.\Debug/CppUTestd.pch</PrecompiledHeaderOutputFile>
55-
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
56-
<ObjectFileName>.\Debug/</ObjectFileName>
57-
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
5854
<WarningLevel>Level3</WarningLevel>
5955
<SuppressStartupBanner>true</SuppressStartupBanner>
6056
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
@@ -65,7 +61,6 @@
6561
<Culture>0x0409</Culture>
6662
</ResourceCompile>
6763
<Lib>
68-
<OutputFile>$(OutDir)CppUTestd.lib</OutputFile>
6964
<SuppressStartupBanner>true</SuppressStartupBanner>
7065
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
7166
</Lib>
@@ -77,12 +72,7 @@
7772
<Command>
7873
</Command>
7974
</PreBuildEvent>
80-
<PostBuildEvent>
81-
<Command>copy $(OutDir)CppUTestd.lib lib\vs2010
82-
copy $(OutDir)CppUTestd.lib lib\CppUTestd.lib
83-
copy $(OutDir)vc100.pdb lib\vs2010
84-
</Command>
85-
</PostBuildEvent>
75+
<PostBuildEvent />
8676
<ProjectReference>
8777
<LinkLibraryDependencies>true</LinkLibraryDependencies>
8878
</ProjectReference>
@@ -96,20 +86,16 @@ copy $(OutDir)vc100.pdb lib\vs2010
9686
<StringPooling>true</StringPooling>
9787
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
9888
<FunctionLevelLinking>true</FunctionLevelLinking>
99-
<PrecompiledHeaderOutputFile>.\Release/CppUTest.pch</PrecompiledHeaderOutputFile>
100-
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
101-
<ObjectFileName>.\Release/</ObjectFileName>
102-
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
10389
<WarningLevel>Level3</WarningLevel>
10490
<SuppressStartupBanner>true</SuppressStartupBanner>
10591
<ForcedIncludeFiles>..\include\Platforms\VisualCpp\Platform.h;..\include\CppUTest\MemoryLeakDetectorMallocMacros.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
92+
<DebugInformationFormat>OldStyle</DebugInformationFormat>
10693
</ClCompile>
10794
<ResourceCompile>
10895
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
10996
<Culture>0x0409</Culture>
11097
</ResourceCompile>
11198
<Lib>
112-
<OutputFile>$(OutDir)CppUTest.lib</OutputFile>
11399
<SuppressStartupBanner>true</SuppressStartupBanner>
114100
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
115101
</Lib>
@@ -121,11 +107,7 @@ copy $(OutDir)vc100.pdb lib\vs2010
121107
<Command>
122108
</Command>
123109
</PreBuildEvent>
124-
<PostBuildEvent>
125-
<Command>copy $(OutDir)CppUTest.lib lib\vs2010
126-
copy $(OutDir)CppUTest.lib lib\CppUTest.lib
127-
</Command>
128-
</PostBuildEvent>
110+
<PostBuildEvent />
129111
<ProjectReference>
130112
<LinkLibraryDependencies>true</LinkLibraryDependencies>
131113
</ProjectReference>

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ CppUTest unit testing and mocking framework for C/C++
55

66
[More information on the project page](http://cpputest.github.com)
77

8+
Travis Linux build status:
89
[![Build Status](https://travis-ci.org/cpputest/cpputest.png?branch=master)](https://travis-ci.org/cpputest/cpputest)
910

11+
AppVeyer Windows build status:
12+
[![Build status](https://ci.appveyor.com/api/projects/status/irh38i4wblsb5tew?svg=true)](https://ci.appveyor.com/project/basvodde/cpputest)
13+
1014

1115
## Getting Started
1216

@@ -28,9 +32,9 @@ You can also use CMake, which also works for Windows Visual Studio.
2832
* make
2933

3034
Then to get started, you'll need to do the following:
31-
* Add the include path to the Makefile. Something like:
35+
* Add the include path to the Makefile. Something like:
3236
* CPPFLAGS += -I(CPPUTEST_HOME)/include
33-
* Add the memory leak macros to you Makefile (needed for additional debug info!). Something like:
37+
* Add the memory leak macros to you Makefile (needed for additional debug info!). Something like:
3438
* CXXFLAGS += -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorNewMacros.h
3539
* CFLAGS += -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorMallocMacros.h
3640
* Add the library linking to your Makefile. Something like:
@@ -52,15 +56,15 @@ TEST(FirstTestGroup, FirstTest)
5256
## Command line switches
5357
5458
* -v verbose, print each test name as it runs
55-
* -r# repeat the tests some number of times, default is one, default is # is not specified is 2. This is handy if you are experiencing memory leaks. A second run that has no leaks indicates that someone
59+
* -r# repeat the tests some number of times, default is one, default is # is not specified is 2. This is handy if you are experiencing memory leaks related to statics and caches.
5660
* -g group only run test whose group contains the substring group
5761
* -n name only run test whose name contains the substring name
5862
5963
## Test Macros
6064
6165
* TEST(group, name) - define a test
6266
* IGNORE_TEST(group, name) - turn off the execution of a test
63-
* TEST_GROUP(group) - Declare a test group to which certain tests belong. This will also create thelink needed from another library.
67+
* TEST_GROUP(group) - Declare a test group to which certain tests belong. This will also create the link needed from another library.
6468
* TEST_GROUP_BASE(group, base) - Same as TEST_GROUP, just use a different base class than Utest
6569
* TEST_SETUP() - Declare a void setup method in a TEST_GROUP - this is the same as declaring void setup()
6670
* TEST_TEARDOWN() - Declare a void setup method in a TEST_GROUP
@@ -82,7 +86,7 @@ The failure of one of these macros causes the current test to immediately exit
8286
* STRCMP_EQUAL(expected, actual) - check const char* strings for equality using strcmp
8387
* LONGS_EQUAL(expected, actual) - Compares two numbers
8488
* BYTES_EQUAL(expected, actual) - Compares two numbers, eight bits wide
85-
* POINTERS_EQUAL(expected, actual) - Compares two const void *
89+
* POINTERS_EQUAL(expected, actual) - Compares two const void *
8690
* DOUBLES_EQUAL(expected, actual, tolerance) - Compares two doubles within some tolerance
8791
* FAIL(text) - always fails
8892
@@ -91,7 +95,7 @@ Customize CHECK_EQUAL to work with your types that support operator==()
9195
9296
* Create the function:
9397
** SimpleString StringFrom (const yourType&)
94-
98+
9599
The Extensions directory has a few of these.
96100
97101
## Building default checks with TestPlugin
@@ -118,9 +122,9 @@ int main(int ac, char** av)
118122
Memory leak detection
119123

120124
* A platform specific memory leak detection mechanism is provided.
121-
* If a test fails and has allocated memory prior to the fail and that memory is not cleaned up by TearDown, a memory leak is reported.
125+
* If a test fails and has allocated memory prior to the fail and that memory is not cleaned up by TearDown, a memory leak is reported.
122126
It is best to only chase memory leaks when other errors have been eliminated.
123-
* Some code uses lazy initialization and appears to leak when it really does not (for example: gcc stringstream used to in an earlier release). One cause is that some standard library calls allocate something and do not free it until after main (or never).
127+
* Some code uses lazy initialization and appears to leak when it really does not (for example: gcc stringstream used to in an earlier release). One cause is that some standard library calls allocate something and do not free it until after main (or never).
124128
To find out if a memory leak is due to lazy initialization set the -r switch to run tests twice. The signature of this situation is that the first run shows leaks and the second run shows no leaks. When both runs show leaks, you have a leak to find.
125129

126130
## How is memory leak detection implemented?
@@ -185,7 +189,7 @@ TEST(ClassName, Create)
185189
}
186190
```
187191
188-
There are some scripts that are helpful in creating your initial h, cpp, and
192+
There are some scripts that are helpful in creating your initial h, cpp, and
189193
Test files. See scripts/README.TXT
190194
191195

appveyor.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ build_script:
1414
test_script:
1515
- ps: scripts\appveyor_ci_test.ps1
1616

17+
artifacts:
18+
- path: lib\CppUTest.lib
19+
name: CppUTest
20+
1721
# Other configuration options
1822
platform: Win32
19-
configuration: Debug
23+
configuration: Release

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
AC_PREREQ([2.68])
3-
AC_INIT([CppUTest], [3.7dev], [https://github.com/cpputest/cpputest])
3+
AC_INIT([CppUTest], [3.8dev], [https://github.com/cpputest/cpputest])
44
AM_INIT_AUTOMAKE
55
AC_CONFIG_SRCDIR([src/CppUTest/Utest.cpp])
66
AC_CONFIG_HEADERS([config.h])

platforms_examples/armcc/LPC1768/tests/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818

1919
#include "CppUTest/CommandLineTestRunner.h"
2020
#include <iostream>
21+
#include <cstdint>
2122

2223
extern "C" void _clock_init(void);
23-
extern uint32_t SystemCoreClock;
24-
extern const uint32_t SystemCoreClock12;
24+
extern std::uint32_t SystemCoreClock;
25+
extern const std::uint32_t SystemCoreClock12;
2526

2627
int main(int ac, char** av)
2728
{
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "CppUTest/TestHarness.h"
2+
3+
TEST_GROUP(start)
4+
{
5+
};
6+
7+
TEST(start, first)
8+
{
9+
FAIL("Start here!");
10+
}

platforms_startup/armcc/LPC1833/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
SHELL = cmd.exe
2+
13
CPU := Cortex-M3
24
CPU_MODE := thumb
35
TARGET_PLATFORM :=armcc_$(CPU)_$(CPU_MODE)

0 commit comments

Comments
 (0)