Permalink
Browse files

Fix: Link issue when Fixture defined in header (#363)

  • Loading branch information...
(no author)
(no author) committed Feb 7, 2010
1 parent 46f0313 commit 9093700e0ae66df4d5c742329e84d63091a7a4f6
@@ -145,6 +145,18 @@
RelativePath=".\tests\testwu\Bugfixes.cpp"
>
</File>
<File
RelativePath=".\tests\testwu\BugfixesPartialFixture.h"
>
</File>
<File
RelativePath=".\tests\testwu\BugfixesPartialFixture1.cpp"
>
</File>
<File
RelativePath=".\tests\testwu\BugfixesPartialFixture2.cpp"
>
</File>
<File
RelativePath=".\tests\testwu\Fixture.cpp"
>
@@ -222,18 +222,23 @@ namespace cfixwu
Macro Description:
Created an accumulator along with an appropriate cfix export that
serves as the basis for a fixture definition.
N.B. Usage of __declspec(noinline) inline is required to allow
fixtures to be spread over multiple objects with the FIXTURE
begin defined in a shared header file.
--*/
#define FIXTURE( FixtureName ) \
static cfixwu::DynamicFixture& __GetDefinition##FixtureName() \
__declspec(noinline) inline \
cfixwu::DynamicFixture& __GetDefinition##FixtureName() \
{ \
static cfixwu::DynamicFixture Fixture; \
return Fixture; \
} \
EXTERN_C __declspec(dllexport) \
EXTERN_C __declspec(dllexport) __declspec(noinline) inline \
PCFIX_TEST_PE_DEFINITION CFIXCALLTYPE __CfixFixturePe##FixtureName()\
{ \
CFIX_CALL_CRT_INIT_EMBEDDING_REGISTRATION(); \
return __GetDefinition##FixtureName##().GetDefinition(); \
return __GetDefinition##FixtureName##().GetDefinition(); \
}
/*++
@@ -0,0 +1,25 @@
/*----------------------------------------------------------------------
* Copyright:
* 2008, Johannes Passing (passing at users.sourceforge.net)
*
* N.B. This file does not include any source code from WinUnit.
*
* This file is part of cfix.
*
* cfix is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* cfix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with cfix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <WinUnit.h>
FIXTURE( TestIssue_363_PartialFixture );
@@ -0,0 +1,29 @@
/*----------------------------------------------------------------------
* Copyright:
* 2008, Johannes Passing (passing at users.sourceforge.net)
*
* N.B. This file does not include any source code from WinUnit.
*
* This file is part of cfix.
*
* cfix is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* cfix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with cfix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <BugfixesPartialFixture.h>
BEGIN_TESTF( Test01, TestIssue_363_PartialFixture )
{
CFIX_LOG( L"PartialFixture #1" );
}
END_TESTF
@@ -0,0 +1,29 @@
/*----------------------------------------------------------------------
* Copyright:
* 2008, Johannes Passing (passing at users.sourceforge.net)
*
* N.B. This file does not include any source code from WinUnit.
*
* This file is part of cfix.
*
* cfix is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* cfix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with cfix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <BugfixesPartialFixture.h>
BEGIN_TESTF( Test02, TestIssue_363_PartialFixture )
{
CFIX_LOG( L"PartialFixture #2" );
}
END_TESTF
@@ -32,6 +32,8 @@ SOURCES=\
Simple.cpp \
Fixture.cpp \
Bugfixes.cpp \
BugfixesPartialFixture1.cpp \
BugfixesPartialFixture2.cpp \
Assertions.cpp \
Messages.cpp \
NameConflicts.cpp \

0 comments on commit 9093700

Please sign in to comment.