Skip to content

Commit

Permalink
Updated Makefiles using Monodevelop, added custom commmand to copy Te…
Browse files Browse the repository at this point in the history
…sts/App.config to get unit tests working inside Monodevelop.
  • Loading branch information
gokr committed Sep 22, 2009
1 parent 3fa0680 commit 1914094
Show file tree
Hide file tree
Showing 13 changed files with 326 additions and 91 deletions.
91 changes: 55 additions & 36 deletions Divan.sln
@@ -1,36 +1,55 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divan", "src\Divan.csproj", "{37AC0B66-5340-4B81-BC62-3EE80233A011}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trivial", "samples\Trivial\Trivial.csproj", "{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divan.Test", "Tests\Divan.Test.csproj", "{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{37AC0B66-5340-4B81-BC62-3EE80233A011}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37AC0B66-5340-4B81-BC62-3EE80233A011}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37AC0B66-5340-4B81-BC62-3EE80233A011}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37AC0B66-5340-4B81-BC62-3EE80233A011}.Release|Any CPU.Build.0 = Release|Any CPU
{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Release|Any CPU.Build.0 = Release|Any CPU
{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
version = 0.1
StartupItem = src\Divan.csproj
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divan", "src\Divan.csproj", "{37AC0B66-5340-4B81-BC62-3EE80233A011}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trivial", "samples\Trivial\Trivial.csproj", "{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divan.Test", "Tests\Divan.Test.csproj", "{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Release|Any CPU.Build.0 = Release|Any CPU
{37AC0B66-5340-4B81-BC62-3EE80233A011}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37AC0B66-5340-4B81-BC62-3EE80233A011}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37AC0B66-5340-4B81-BC62-3EE80233A011}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37AC0B66-5340-4B81-BC62-3EE80233A011}.Release|Any CPU.Build.0 = Release|Any CPU
{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
version = 0.1
StartupItem = src\Divan.csproj
Policies = $0
$0.DotNetNamingPolicy = $1
$1.DirectoryNamespaceAssociation = None
$1.ResourceNamePolicy = FileFormatDefault
$0.StandardHeader = $2
$2.Text =
$2.inheritsSet = MITX11License
$0.TextStylePolicy = $3
$3.FileWidth = 120
$3.TabWidth = 4
$3.TabsToSpaces = False
$3.NoTabsAfterNonTabs = False
$3.RemoveTrailingWhitespace = False
$3.EolMarker = Native
$0.ChangeLogPolicy = $4
$4.UpdateMode = None
$4.MessageStyle = $5
$5.LineAlign = 0
$4.inheritsSet = Mono
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 3 additions & 3 deletions Makefile
@@ -1,5 +1,5 @@

EXTRA_DIST = rules.make configure Makefile.include ../../../Divan/bin/Debug/Newtonsoft.Json.dll
EXTRA_DIST = rules.make configure Makefile.include lib/Newtonsoft.Json.dll lib/nunit.framework.dll

all: all-recursive

Expand All @@ -12,10 +12,10 @@ include $(top_srcdir)/rules.make

#Warning: This is an automatically generated file, do not edit!
ifeq ($(CONFIG),DEBUG)
SUBDIRS = src samples/Trivial
SUBDIRS = src samples/Trivial Tests
endif
ifeq ($(CONFIG),RELEASE)
SUBDIRS = src samples/Trivial
SUBDIRS = src samples/Trivial Tests
endif


Expand Down
2 changes: 1 addition & 1 deletion Makefile.include
@@ -1,4 +1,4 @@
VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT
VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT

s2q=$(subst \ ,?,$1)
q2s=$(subst ?,\ ,$1)
Expand Down
5 changes: 4 additions & 1 deletion Tests/CouchTest.cs
Expand Up @@ -11,8 +11,11 @@ namespace Divan.Test
{
/// <summary>
/// Unit tests for Divan. Operates in a separate CouchDB database called divan_unit_tests.
/// If you are not running a CouchDB on localhost:5984 you will need to edit
/// the Tests/App.config file.
///
/// Run from command line using something like:
/// nunit-console2 --labels -run=Divan.CouchTest src/bin/Debug/Divan.dll
/// nunit-console2 --labels -run=Divan.CouchTest Tests/bin/Debug/Tests.dll
/// </summary>
[TestFixture]
public class CouchTest
Expand Down
32 changes: 26 additions & 6 deletions Tests/Divan.Test.csproj
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -20,7 +20,12 @@
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<WarningLevel>3</WarningLevel>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp App.config ${TargetDir}/${ProjectName}.dll.config" workingdir="${ProjectDir}" />
</CustomCommands>
</CustomCommands>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -31,16 +36,16 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<Reference Include="Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
Expand Down Expand Up @@ -75,4 +80,19 @@
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions>
<MonoDevelop>
<Properties>
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="true" RelativeMakefileName="Makefile" SyncReferences="true">
<BuildFilesVar Sync="true" Name="FILES" />
<DeployFilesVar />
<ResourcesVar Sync="true" Name="RESOURCES" />
<OthersVar />
<GacRefVar Sync="true" Name="REFERENCES" />
<AsmRefVar Sync="true" Name="REFERENCES" />
<ProjectRefVar Sync="true" Name="REFERENCES" />
</MonoDevelop.Autotools.MakefileInfo>
</Properties>
</MonoDevelop>
</ProjectExtensions>
</Project>
161 changes: 161 additions & 0 deletions Tests/Makefile
@@ -0,0 +1,161 @@

EXTRA_DIST = Makefile

# Warning: This is an automatically generated file, do not edit!

srcdir=.
top_srcdir=..

include $(top_srcdir)/config.make

ifeq ($(CONFIG),DEBUG)
ASSEMBLY_COMPILER_COMMAND = gmcs
ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE"
ASSEMBLY = bin/Debug/Divan.Test.dll
ASSEMBLY_MDB = $(ASSEMBLY).mdb
COMPILE_TARGET = library
PROJECT_REFERENCES = \
../src/bin/Debug/Divan.dll
BUILD_DIR = bin/Debug/

NEWTONSOFT_JSON_DLL_SOURCE=../lib/Newtonsoft.Json.dll
NUNIT_FRAMEWORK_DLL_SOURCE=../lib/nunit.framework.dll
DIVAN_DLL_SOURCE=../src/bin/Debug/Divan.dll
DIVAN_DLL_MDB_SOURCE=../src/bin/Debug/Divan.dll.mdb
DIVAN_DLL_MDB=$(BUILD_DIR)/Divan.dll.mdb
DIVAN_TEST_DLL_MDB_SOURCE=bin/Debug/Divan.Test.dll.mdb
DIVAN_TEST_DLL_MDB=$(BUILD_DIR)/Divan.Test.dll.mdb

endif

ifeq ($(CONFIG),RELEASE)
ASSEMBLY_COMPILER_COMMAND = gmcs
ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:TRACE"
ASSEMBLY = bin/Release/Divan.Test.dll
ASSEMBLY_MDB =
COMPILE_TARGET = library
PROJECT_REFERENCES = \
../src/bin/Release/Divan.dll
BUILD_DIR = bin/Release/

NEWTONSOFT_JSON_DLL_SOURCE=../lib/Newtonsoft.Json.dll
NUNIT_FRAMEWORK_DLL_SOURCE=../lib/nunit.framework.dll
DIVAN_DLL_SOURCE=../src/bin/Release/Divan.dll
DIVAN_DLL_MDB=
DIVAN_TEST_DLL_MDB=

endif

AL=al2
SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll

PROGRAMFILES = \
$(NEWTONSOFT_JSON_DLL) \
$(NUNIT_FRAMEWORK_DLL) \
$(DIVAN_DLL) \
$(DIVAN_DLL_MDB) \
$(DIVAN_TEST_DLL_MDB)

LINUX_PKGCONFIG = \
$(DIVAN_TEST_PC)


RESGEN=resgen2

NEWTONSOFT_JSON_DLL = $(BUILD_DIR)/Newtonsoft.Json.dll
NUNIT_FRAMEWORK_DLL = $(BUILD_DIR)/nunit.framework.dll
DIVAN_DLL = $(BUILD_DIR)/Divan.dll
DIVAN_TEST_PC = $(BUILD_DIR)/divan.test.pc

FILES = \
CouchTest.cs \
Lucene/CouchLuceneTest.cs \
Properties/AssemblyInfo.cs

DATA_FILES =

RESOURCES =

EXTRAS = \
App.config \
divan.test.pc.in

REFERENCES = \
../lib/Newtonsoft.Json.dll \
../lib/nunit.framework.dll \
../src/bin/Debug/Divan.dll \
System \
System.Configuration \
System.Core \
System.Data \
System.Data.DataSetExtensions \
System.Xml \
System.Xml.Linq

DLL_REFERENCES = \
../lib/Newtonsoft.Json.dll \
../lib/nunit.framework.dll

CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG)

#Targets
all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(top_srcdir)/config.make

include $(top_srcdir)/Makefile.include
#include $(srcdir)/custom-hooks.make



$(eval $(call emit-deploy-target,NEWTONSOFT_JSON_DLL))
$(eval $(call emit-deploy-target,NUNIT_FRAMEWORK_DLL))
$(eval $(call emit-deploy-target,DIVAN_DLL))
$(eval $(call emit-deploy-target,DIVAN_DLL_MDB))
$(eval $(call emit-deploy-wrapper,DIVAN_TEST_PC,divan.test.pc))


$(eval $(call emit_resgen_targets))
$(build_xamlg_list): %.xaml.g.cs: %.xaml
xamlg '$<'


$(ASSEMBLY) $(ASSEMBLY_MDB): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list)
make pre-all-local-hook prefix=$(prefix)
mkdir -p $(shell dirname $(ASSEMBLY))
make $(CONFIG)_BeforeBuild
$(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref)
make $(CONFIG)_AfterBuild
make post-all-local-hook prefix=$(prefix)

install-local: $(ASSEMBLY) $(ASSEMBLY_MDB)
make pre-install-local-hook prefix=$(prefix)
make install-satellite-assemblies prefix=$(prefix)
mkdir -p '$(DESTDIR)$(libdir)/$(PACKAGE)'
$(call cp,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call cp,$(ASSEMBLY_MDB),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call cp,$(NEWTONSOFT_JSON_DLL),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call cp,$(NUNIT_FRAMEWORK_DLL),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call cp,$(DIVAN_DLL),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call cp,$(DIVAN_DLL_MDB),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call cp,$(DIVAN_TEST_DLL_MDB),$(DESTDIR)$(libdir)/$(PACKAGE))
mkdir -p '$(DESTDIR)$(libdir)/pkgconfig'
$(call cp,$(DIVAN_TEST_PC),$(DESTDIR)$(libdir)/pkgconfig)
make post-install-local-hook prefix=$(prefix)

uninstall-local: $(ASSEMBLY) $(ASSEMBLY_MDB)
make pre-uninstall-local-hook prefix=$(prefix)
make uninstall-satellite-assemblies prefix=$(prefix)
$(call rm,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call rm,$(ASSEMBLY_MDB),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call rm,$(NEWTONSOFT_JSON_DLL),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call rm,$(NUNIT_FRAMEWORK_DLL),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call rm,$(DIVAN_DLL),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call rm,$(DIVAN_DLL_MDB),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call rm,$(DIVAN_TEST_DLL_MDB),$(DESTDIR)$(libdir)/$(PACKAGE))
$(call rm,$(DIVAN_TEST_PC),$(DESTDIR)$(libdir)/pkgconfig)
make post-uninstall-local-hook prefix=$(prefix)

install: install-local
uninstall: uninstall-local
clean: clean-local

include $(top_srcdir)/rules.make
6 changes: 6 additions & 0 deletions Tests/divan.test.pc
@@ -0,0 +1,6 @@
Name: Divan.Test
Description: Divan.Test
Version: 0.1

Requires:
Libs: -r:/usr/local/lib/divan/Divan.Test.dll
6 changes: 6 additions & 0 deletions Tests/divan.test.pc.in
@@ -0,0 +1,6 @@
Name: Divan.Test
Description: Divan.Test
Version: 0.1

Requires:
Libs: -r:@expanded_libdir@/@PACKAGE@/Divan.Test.dll
4 changes: 2 additions & 2 deletions configure
Expand Up @@ -3,8 +3,8 @@ VERSION=0.1
PACKAGE=divan
prefix=/usr/local
config=DEBUG
configurations=" RELEASE DEBUG"
common_packages=" nunit;2.4"
configurations=" DEBUG RELEASE"
common_packages=""


usage ()
Expand Down

0 comments on commit 1914094

Please sign in to comment.