mirror of https://github.com/mono/CppSharp.git
Browse Source
+ Consolidate tests; remove src/CPPTestLib, src/Tests, tests2 directories. + Move MD solution to root dir.pull/1/head
49 changed files with 15 additions and 233905 deletions
@ -1,44 +0,0 @@
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> |
||||
<PropertyGroup> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProductVersion>8.0.50727</ProductVersion> |
||||
<SchemaVersion>2.0</SchemaVersion> |
||||
<ProjectGuid>{B01E6282-144E-481A-8E1F-95F708DFBC2D}</ProjectGuid> |
||||
<Compiler> |
||||
<Compiler ctype="GppCompiler" /> |
||||
</Compiler> |
||||
<Language>CPP</Language> |
||||
<Target>Bin</Target> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<OutputPath>bin\Debug</OutputPath> |
||||
<DefineSymbols>DEBUG MONODEVELOP</DefineSymbols> |
||||
<SourceDirectory>.</SourceDirectory> |
||||
<OutputName>CPPTestLib</OutputName> |
||||
<CompileTarget>SharedLibrary</CompileTarget> |
||||
<CustomCommands> |
||||
<CustomCommands> |
||||
<Command type="AfterBuild" command="bash -c "if [ `uname` = Darwin ]; then mv lib${ProjectName}.so lib${ProjectName}.dylib; fi"" workingdir="${ProjectDir}/bin/Debug" /> |
||||
</CustomCommands> |
||||
</CustomCommands> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
||||
<OutputPath>bin\Release</OutputPath> |
||||
<DefineSymbols>MONODEVELOP</DefineSymbols> |
||||
<SourceDirectory>.</SourceDirectory> |
||||
<OptimizationLevel>3</OptimizationLevel> |
||||
<OutputName>CPPTest</OutputName> |
||||
<CompileTarget>Bin</CompileTarget> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Compile Include="CSimpleClass.cpp" /> |
||||
<Compile Include="VirtualMethodTestClass.cpp" /> |
||||
<Compile Include="NUnit.cpp" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="NUnit.h" /> |
||||
</ItemGroup> |
||||
</Project> |
@ -1,99 +0,0 @@
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* CPPTest.cpp |
||||
* CPPTest |
||||
* |
||||
* Created by Alex Corrado on 3/14/09. |
||||
* Copyright 2009 __MyCompanyName__. All rights reserved. |
||||
* |
||||
*/ |
||||
|
||||
#include <stdio.h> |
||||
#include "NUnit.h" |
||||
|
||||
class EXPORT CSimpleClass { |
||||
public: |
||||
int value; |
||||
CSimpleClass (int value) : value (value) |
||||
{ |
||||
printf ("CSimpleClass(%d)\n", value); |
||||
this->value = value; |
||||
} |
||||
|
||||
~CSimpleClass () |
||||
{ |
||||
printf ("~CSimpleClass\n"); |
||||
} |
||||
|
||||
void M0 (); |
||||
void M1 (int x); |
||||
void M2 (int x, int y); |
||||
|
||||
virtual void V0 (int x, int y) |
||||
{ |
||||
printf ("C++/CSimpleClass::V0(%d, %d)\n", x, y); |
||||
} |
||||
|
||||
virtual void V1(int x) |
||||
{ |
||||
printf("C++/CSimpleClass::V1(%d)\n", x); |
||||
} |
||||
}; |
||||
|
||||
class EXPORT CSimpleSubClass : CSimpleClass { |
||||
public: |
||||
CSimpleSubClass (int value) : CSimpleClass (value) |
||||
{ |
||||
printf("CSimpleSubClass(%d)\n", value); |
||||
} |
||||
|
||||
virtual void V0 (int x, int y) |
||||
{ |
||||
printf ("C++/CSimpleSubClass::V0(%d, %d)\n", x, y); |
||||
} |
||||
|
||||
virtual void V1 (int x) |
||||
{ |
||||
printf("C++/CSimpleSubClass::V1(%d)\n", x); |
||||
} |
||||
|
||||
virtual void V2 () |
||||
{ |
||||
printf("C++/CSimpleSubClass::V2() - value: %d\n", this->value); |
||||
} |
||||
|
||||
void M3 (); |
||||
}; |
||||
|
||||
void CSimpleClass::M0 () |
||||
{ |
||||
printf ("C++/CSimpleClass::M0()\n"); |
||||
V0 (value, value + 1); |
||||
V1 (value); |
||||
} |
||||
|
||||
void CSimpleClass::M1 (int x) |
||||
{ |
||||
printf ("C++/CSimpleClass::M1(%d)\n", x); |
||||
} |
||||
|
||||
void CSimpleClass::M2(int x, int y) |
||||
{ |
||||
printf ("C++/CSimpleClass::M2(%d, %d)\n", x, y); |
||||
} |
||||
|
||||
void CSimpleSubClass::M3 () |
||||
{ |
||||
printf("C++/CSimpleSubClass::M3()\n"); |
||||
this->M0 (); |
||||
} |
||||
|
||||
extern "C" { |
||||
CSimpleSubClass* CreateCSimpleSubClass (int value) |
||||
{ |
||||
return new CSimpleSubClass(value); |
||||
} |
||||
void DestroyCSimpleSubClass (CSimpleSubClass* obj) |
||||
{ |
||||
delete obj; |
||||
} |
||||
} |
@ -1,33 +0,0 @@
@@ -1,33 +0,0 @@
|
||||
//
|
||||
// VirtualMethodTestClass.cpp: A test C++ class used to exercise vtable behavior in CppInterop
|
||||
//
|
||||
// Author:
|
||||
// Alexander Corrado (alexander.corrado@gmail.com)
|
||||
//
|
||||
// Copyright (C) 2010 Alexander Corrado
|
||||
//
|
||||
|
||||
#include "NUnit.h" |
||||
|
||||
class EXPORT VirtualMethodTestClass { |
||||
|
||||
virtual void V0 (int a1, int a2, int a3) |
||||
{ |
||||
NUnit::Assert->AreEqual (1, a1, "V0 #A1"); |
||||
NUnit::Assert->AreEqual (2, a2, "V0 #A2"); |
||||
NUnit::Assert->AreEqual (3, a3, "V0 #A3"); |
||||
} |
||||
|
||||
}; |
||||
|
||||
extern "C" { |
||||
VirtualMethodTestClass* CreateVirtualMethodTestClass () |
||||
{ |
||||
return new VirtualMethodTestClass (); |
||||
} |
||||
|
||||
void DestroyVirtualMethodTestClass (VirtualMethodTestClass* vmtc) |
||||
{ |
||||
delete vmtc; |
||||
} |
||||
} |
@ -1,27 +0,0 @@
@@ -1,27 +0,0 @@
|
||||
using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle("QtTest")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("")] |
||||
[assembly: AssemblyCopyright("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")] |
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
|
@ -1,29 +0,0 @@
@@ -1,29 +0,0 @@
|
||||
using System; |
||||
using Qt.Gui; |
||||
|
||||
using Mono.VisualC.Interop; |
||||
|
||||
namespace QtTest { |
||||
class MainClass { |
||||
public static void Main (string[] args) |
||||
{ |
||||
using (QApplication app = new QApplication ()) { |
||||
using (QPushButton hello = new QPushButton ("Hello world!"), |
||||
hello2 = new QPushButton ("Another button")) { |
||||
|
||||
hello.Resize (100, 30); |
||||
hello2.Resize (200, 30); |
||||
|
||||
//CppLibrary.SaveInteropAssembly ();
|
||||
hello.Visible = true; |
||||
hello2.Visible = true; |
||||
|
||||
app.Exec (); |
||||
|
||||
|
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,104 +0,0 @@
@@ -1,104 +0,0 @@
|
||||
|
||||
EXTRA_DIST = |
||||
|
||||
# Warning: This is an automatically generated file, do not edit!
|
||||
|
||||
if ENABLE_DEBUG |
||||
ASSEMBLY_COMPILER_COMMAND = gmcs |
||||
ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" |
||||
ASSEMBLY = bin/Debug/QtTest.exe |
||||
ASSEMBLY_MDB = $(ASSEMBLY).mdb |
||||
COMPILE_TARGET = exe |
||||
PROJECT_REFERENCES = \
|
||||
../QtBindings/bin/Debug/QtBindings.dll \
|
||||
../Mono.VisualC.Interop/bin/Debug/Mono.VisualC.Interop.dll |
||||
BUILD_DIR = bin/Debug |
||||
|
||||
QTBINDINGS_DLL_SOURCE=../QtBindings/bin/Debug/QtBindings.dll |
||||
QTBINDINGS_DLL_CONFIG_SOURCE=../QtBindings/QtBindings.dll.config |
||||
MONO_VISUALC_INTEROP_DLL_SOURCE=../Mono.VisualC.Interop/bin/Debug/Mono.VisualC.Interop.dll |
||||
MONO_VISUALC_INTEROP_DLL=$(BUILD_DIR)/Mono.VisualC.Interop.dll |
||||
QTTEST_EXE_MDB_SOURCE=bin/Debug/QtTest.exe.mdb |
||||
QTTEST_EXE_MDB=$(BUILD_DIR)/QtTest.exe.mdb |
||||
CPPINTEROP_DLL= |
||||
|
||||
endif |
||||
|
||||
if ENABLE_RELEASE |
||||
ASSEMBLY_COMPILER_COMMAND = gmcs |
||||
ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- |
||||
ASSEMBLY = bin/Release/QtTest.exe |
||||
ASSEMBLY_MDB = |
||||
COMPILE_TARGET = exe |
||||
PROJECT_REFERENCES = \
|
||||
../QtBindings/bin/Release/QtBindings.dll \
|
||||
../Mono.VisualC.Interop/bin/Release/CPPInterop.dll |
||||
BUILD_DIR = bin/Release |
||||
|
||||
QTBINDINGS_DLL_SOURCE=../QtBindings/bin/Release/QtBindings.dll |
||||
QTBINDINGS_DLL_CONFIG_SOURCE=../QtBindings/QtBindings.dll.config |
||||
MONO_VISUALC_INTEROP_DLL= |
||||
QTTEST_EXE_MDB= |
||||
CPPINTEROP_DLL_SOURCE=../Mono.VisualC.Interop/bin/Release/CPPInterop.dll |
||||
CPPINTEROP_DLL=$(BUILD_DIR)/CPPInterop.dll |
||||
|
||||
endif |
||||
|
||||
AL=al2 |
||||
SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll |
||||
|
||||
PROGRAMFILES = \
|
||||
$(QTBINDINGS_DLL) \
|
||||
$(QTBINDINGS_DLL_CONFIG) \
|
||||
$(MONO_VISUALC_INTEROP_DLL) \
|
||||
$(QTTEST_EXE_MDB) \
|
||||
$(CPPINTEROP_DLL) |
||||
|
||||
BINARIES = \
|
||||
$(QTTEST) |
||||
|
||||
|
||||
RESGEN=resgen2 |
||||
|
||||
all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) |
||||
|
||||
FILES = \
|
||||
Main.cs \
|
||||
AssemblyInfo.cs |
||||
|
||||
DATA_FILES = |
||||
|
||||
RESOURCES = |
||||
|
||||
EXTRAS = \
|
||||
qttest.in |
||||
|
||||
REFERENCES = \
|
||||
System |
||||
|
||||
DLL_REFERENCES = |
||||
|
||||
CLEANFILES = $(PROGRAMFILES) $(BINARIES) |
||||
|
||||
include $(top_srcdir)/Makefile.include |
||||
|
||||
QTBINDINGS_DLL = $(BUILD_DIR)/QtBindings.dll |
||||
QTBINDINGS_DLL_CONFIG = $(BUILD_DIR)/QtBindings.dll.config |
||||
QTTEST = $(BUILD_DIR)/qttest |
||||
|
||||
$(eval $(call emit-deploy-target,QTBINDINGS_DLL)) |
||||
$(eval $(call emit-deploy-target,QTBINDINGS_DLL_CONFIG)) |
||||
$(eval $(call emit-deploy-target,MONO_VISUALC_INTEROP_DLL)) |
||||
$(eval $(call emit-deploy-wrapper,QTTEST,qttest,x)) |
||||
$(eval $(call emit-deploy-target,CPPINTEROP_DLL)) |
||||
|
||||
|
||||
$(eval $(call emit_resgen_targets)) |
||||
$(build_xamlg_list): %.xaml.g.cs: %.xaml |
||||
xamlg '$<' |
||||
|
||||
$(ASSEMBLY_MDB): $(ASSEMBLY) |
||||
|
||||
$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) |
||||
mkdir -p $(shell dirname $(ASSEMBLY)) |
||||
$(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) |
@ -1,93 +0,0 @@
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> |
||||
<PropertyGroup> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProductVersion>8.0.50727</ProductVersion> |
||||
<SchemaVersion>2.0</SchemaVersion> |
||||
<ProjectGuid>{3EE6B50E-58FB-4391-AF01-3FCB1A29B0D7}</ProjectGuid> |
||||
<OutputType>Exe</OutputType> |
||||
<RootNamespace>QtTest</RootNamespace> |
||||
<AssemblyName>QtTest</AssemblyName> |
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
||||
<FileUpgradeFlags> |
||||
</FileUpgradeFlags> |
||||
<UpgradeBackupLocation> |
||||
</UpgradeBackupLocation> |
||||
<OldToolsVersion>2.0</OldToolsVersion> |
||||
<PublishUrl>http://localhost/QtTest/</PublishUrl> |
||||
<Install>true</Install> |
||||
<InstallFrom>Web</InstallFrom> |
||||
<UpdateEnabled>true</UpdateEnabled> |
||||
<UpdateMode>Foreground</UpdateMode> |
||||
<UpdateInterval>7</UpdateInterval> |
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits> |
||||
<UpdatePeriodically>false</UpdatePeriodically> |
||||
<UpdateRequired>false</UpdateRequired> |
||||
<MapFileExtensions>true</MapFileExtensions> |
||||
<ApplicationRevision>0</ApplicationRevision> |
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> |
||||
<IsWebBootstrapper>true</IsWebBootstrapper> |
||||
<UseApplicationTrust>false</UseApplicationTrust> |
||||
<BootstrapperEnabled>true</BootstrapperEnabled> |
||||
<TargetFrameworkProfile /> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>full</DebugType> |
||||
<Optimize>false</Optimize> |
||||
<OutputPath>bin\Debug</OutputPath> |
||||
<DefineConstants>DEBUG</DefineConstants> |
||||
<ErrorReport>prompt</ErrorReport> |
||||
<WarningLevel>4</WarningLevel> |
||||
<ConsolePause>false</ConsolePause> |
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
||||
<DebugType>none</DebugType> |
||||
<Optimize>false</Optimize> |
||||
<OutputPath>bin\Release</OutputPath> |
||||
<ErrorReport>prompt</ErrorReport> |
||||
<WarningLevel>4</WarningLevel> |
||||
<Externalconsole>true</Externalconsole> |
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="Main.cs" /> |
||||
<Compile Include="AssemblyInfo.cs" /> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\QtBindings\QtBindings.csproj"> |
||||
<Project>{66212CA6-B8C2-4307-ADDE-DAFEAAB339B9}</Project> |
||||
<Name>QtBindings</Name> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\Mono.VisualC.Interop\Mono.VisualC.Interop.csproj"> |
||||
<Project>{4A864586-93C5-4DC1-8A80-F094A88506D7}</Project> |
||||
<Name>Mono.VisualC.Interop</Name> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5"> |
||||
<Visible>False</Visible> |
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> |
||||
<Install>false</Install> |
||||
</BootstrapperPackage> |
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> |
||||
<Visible>False</Visible> |
||||
<ProductName>.NET Framework 3.5 SP1</ProductName> |
||||
<Install>true</Install> |
||||
</BootstrapperPackage> |
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> |
||||
<Visible>False</Visible> |
||||
<ProductName>Windows Installer 3.1</ProductName> |
||||
<Install>true</Install> |
||||
</BootstrapperPackage> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="app.config" /> |
||||
</ItemGroup> |
||||
</Project> |
@ -1,3 +0,0 @@
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh |
||||
|
||||
exec mono "@expanded_libdir@/@PACKAGE@/QtTest.exe" "$@" |
@ -1,55 +0,0 @@
@@ -1,55 +0,0 @@
|
||||
//
|
||||
// CppLibraryTests.cs: Test cases to exercise CppLibrary
|
||||
//
|
||||
// Author:
|
||||
// Alexander Corrado (alexander.corrado@gmail.com)
|
||||
//
|
||||
// Copyright (C) 2010 Alexander Corrado
|
||||
//
|
||||
|
||||
using System; |
||||
using NUnit.Framework; |
||||
|
||||
using Mono.VisualC.Interop; |
||||
using Mono.VisualC.Interop.ABI; |
||||
|
||||
using Tests.Support; |
||||
|
||||
namespace Tests { |
||||
[TestFixture] |
||||
public class CppLibraryTests { |
||||
|
||||
[Test] |
||||
[ExpectedException (typeof (ArgumentNullException))] |
||||
public void TestCreateNullAbi () |
||||
{ |
||||
CppLibrary cppl = new CppLibrary ("foo", null); |
||||
} |
||||
|
||||
[Test] |
||||
[ExpectedException (typeof (ArgumentNullException))] |
||||
public void TestCreateNullLibName () |
||||
{ |
||||
CppLibrary cppl = new CppLibrary (null, new VirtualOnlyAbi ()); |
||||
} |
||||
|
||||
[Test] |
||||
public void TestProperties () |
||||
{ |
||||
VirtualOnlyAbi abi = new VirtualOnlyAbi (); |
||||
CppLibrary cppl = new CppLibrary ("FooLib", abi); |
||||
Assert.AreEqual ("FooLib", cppl.Name, "#A1"); |
||||
Assert.AreSame (abi, cppl.Abi, "#A2"); |
||||
} |
||||
|
||||
[Test] |
||||
public void TestGetClass () |
||||
{ |
||||
VirtualOnlyAbi abi = new VirtualOnlyAbi (); |
||||
CppLibrary cppl = new CppLibrary ("FooLib", abi); |
||||
EmptyTestInterface klass = cppl.GetClass<EmptyTestInterface,EmptyTestStruct,CppMockObject> ("FooClass"); |
||||
Assert.IsNotNull (klass, "#A1"); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,102 +0,0 @@
@@ -1,102 +0,0 @@
|
||||
|
||||
EXTRA_DIST = |
||||
|
||||
# Warning: This is an automatically generated file, do not edit!
|
||||
|
||||
if ENABLE_DEBUG |
||||
ASSEMBLY_COMPILER_COMMAND = gmcs |
||||
ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" |
||||
ASSEMBLY = bin/Debug/Tests.dll |
||||
ASSEMBLY_MDB = $(ASSEMBLY).mdb |
||||
COMPILE_TARGET = library |
||||
PROJECT_REFERENCES = \
|
||||
../Mono.VisualC.Interop/bin/Debug/Mono.VisualC.Interop.dll |
||||
BUILD_DIR = bin/Debug |
||||
|
||||
MONO_VISUALC_INTEROP_DLL_SOURCE=../Mono.VisualC.Interop/bin/Debug/Mono.VisualC.Interop.dll |
||||
MONO_VISUALC_INTEROP_DLL=$(BUILD_DIR)/Mono.VisualC.Interop.dll |
||||
TESTS_DLL_MDB_SOURCE=bin/Debug/Tests.dll.mdb |
||||
TESTS_DLL_MDB=$(BUILD_DIR)/Tests.dll.mdb |
||||
CPPINTEROP_DLL= |
||||
|
||||
endif |
||||
|
||||
if ENABLE_RELEASE |
||||
ASSEMBLY_COMPILER_COMMAND = gmcs |
||||
ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- |
||||
ASSEMBLY = bin/Release/Tests.dll |
||||
ASSEMBLY_MDB = |
||||
COMPILE_TARGET = library |
||||
PROJECT_REFERENCES = \
|
||||
../Mono.VisualC.Interop/bin/Release/CPPInterop.dll |
||||
BUILD_DIR = bin/Release |
||||
|
||||
MONO_VISUALC_INTEROP_DLL= |
||||
TESTS_DLL_MDB= |
||||
CPPINTEROP_DLL_SOURCE=../Mono.VisualC.Interop/bin/Release/CPPInterop.dll |
||||
CPPINTEROP_DLL=$(BUILD_DIR)/CPPInterop.dll |
||||
|
||||
endif |
||||
|
||||
AL=al2 |
||||
SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll |
||||
|
||||
PROGRAMFILES = \
|
||||
$(MONO_VISUALC_INTEROP_DLL) \
|
||||
$(TESTS_DLL_MDB) \
|
||||
$(CPPINTEROP_DLL) |
||||
|
||||
LINUX_PKGCONFIG = \
|
||||
$(TESTS_PC) |
||||
|
||||
|
||||
RESGEN=resgen2 |
||||
|
||||
all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) |
||||
|
||||
FILES = \
|
||||
CppInstancePtrTests.cs \
|
||||
Support/CSimpleClass.cs \
|
||||
CppLibraryTests.cs \
|
||||
ItaniumAbiTests.cs \
|
||||
MsvcAbiTests.cs \
|
||||
Support/CppMockObject.cs \
|
||||
Support/CppNUnitAsserts.cs \
|
||||
SharedAbiTests.cs \
|
||||
Support/VirtualMethodTestClass.cs |
||||
|
||||
DATA_FILES = |
||||
|
||||
RESOURCES = |
||||
|
||||
EXTRAS = \
|
||||
Support \
|
||||
tests.pc.in |
||||
|
||||
REFERENCES = \
|
||||
System \
|
||||
nunit.core \
|
||||
nunit.framework |
||||
|
||||
DLL_REFERENCES = |
||||
|
||||
CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) |
||||
|
||||
include $(top_srcdir)/Makefile.include |
||||
|
||||
TESTS_PC = $(BUILD_DIR)/tests.pc |
||||
|
||||
$(eval $(call emit-deploy-target,MONO_VISUALC_INTEROP_DLL)) |
||||
$(eval $(call emit-deploy-wrapper,TESTS_PC,tests.pc)) |
||||
$(eval $(call emit-deploy-target,CPPINTEROP_DLL)) |
||||
|
||||
|
||||
$(eval $(call emit_resgen_targets)) |
||||
$(build_xamlg_list): %.xaml.g.cs: %.xaml |
||||
xamlg '$<' |
||||
|
||||
$(ASSEMBLY_MDB): $(ASSEMBLY) |
||||
|
||||
$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) |
||||
mkdir -p $(shell dirname $(ASSEMBLY)) |
||||
$(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) |
@ -1,32 +0,0 @@
@@ -1,32 +0,0 @@
|
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
using Mono.VisualC.Interop; |
||||
|
||||
namespace Tests |
||||
{ |
||||
public interface IVirtualMethodTestClass : ICppClass { |
||||
[Virtual] void V0 (CppInstancePtr @this, int a1, int a2, int a3); |
||||
} |
||||
|
||||
public static class VirtualMethodTestClass { |
||||
|
||||
public static CppInstancePtr Create () |
||||
{ |
||||
return CreateVirtualMethodTestClass (); |
||||
} |
||||
|
||||
public static void Destroy (CppInstancePtr vmtc) |
||||
{ |
||||
DestroyVirtualMethodTestClass ((IntPtr)vmtc); |
||||
} |
||||
|
||||
|
||||
[DllImport("CPPTestLib")] |
||||
private static extern IntPtr CreateVirtualMethodTestClass (); |
||||
|
||||
[DllImport("CPPTestLib")] |
||||
private static extern void DestroyVirtualMethodTestClass (IntPtr vmtc); |
||||
} |
||||
|
||||
} |
||||
|
@ -1,125 +0,0 @@
@@ -1,125 +0,0 @@
|
||||
// Author:
|
||||
// Alexander Corrado (alexander.corrado@gmail.com)
|
||||
// Andreia Gaita (shana@spoiledcat.net)
|
||||
// Zoltan Varga <vargaz@gmail.com>
|
||||
//
|
||||
// Copyright (C) 2011 Novell Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Linq; |
||||
using System.Collections.Generic; |
||||
|
||||
using Mono.VisualC.Interop; |
||||
using Mono.VisualC.Code; |
||||
using Mono.VisualC.Code.Atoms; |
||||
|
||||
namespace Mono.VisualC.Tools.Generator { |
||||
|
||||
public class Entry { |
||||
|
||||
public static Dictionary<string, Dictionary<string, Entry>> typelist; |
||||
public static Dictionary<string, Entry> idlist; |
||||
|
||||
public string id; |
||||
public string type; |
||||
public string name; |
||||
public string computedName; |
||||
public string reftype; |
||||
public Dictionary<string, string> attributes; |
||||
public List<Entry> children; |
||||
public bool isCreated; |
||||
public CodeAtom atom; |
||||
public Class Class { |
||||
get { return (Class)atom; } |
||||
} |
||||
public CppType cppType; |
||||
public bool isTemplate; |
||||
|
||||
List<Entry> members; |
||||
|
||||
|
||||
public List<Entry> Members { |
||||
get { |
||||
if (members == null) { |
||||
members = new List<Entry> (); |
||||
if (HasValue ("members")) { |
||||
var m = this["members"].ToString ().Split (' ').Where (id => !id.Equals (string.Empty)).ToArray (); |
||||
members.AddRange (from o in m |
||||
where idlist.ContainsKey (o) |
||||
select idlist[o]); |
||||
} |
||||
} |
||||
return members; |
||||
} |
||||
} |
||||
|
||||
public bool CheckValue (string key, string name) |
||||
{ |
||||
return attributes.ContainsKey (key) && attributes[key] == name; |
||||
} |
||||
|
||||
public string this[string key] { |
||||
get { return HasValue (key) ? attributes[key] : null; } |
||||
} |
||||
|
||||
public bool HasValue (string key) |
||||
{ |
||||
return attributes.ContainsKey (key) && attributes[key] != ""; |
||||
} |
||||
|
||||
public bool IsTrue (string key) |
||||
{ |
||||
return attributes.ContainsKey (key) && attributes[key] == "1"; |
||||
} |
||||
|
||||
public Entry Base { |
||||
get { |
||||
if (HasValue ("type")) |
||||
return idlist[reftype]; |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public Entry Namespace { |
||||
get { |
||||
if (HasValue ("context")) |
||||
return idlist[this["context"]].Namespace; |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public static Entry Find (string name) |
||||
{ |
||||
if (idlist.ContainsKey (name)) |
||||
return idlist[name]; |
||||
return (from o in idlist |
||||
where o.Value.name == name |
||||
select o.Value).FirstOrDefault (); |
||||
} |
||||
|
||||
public override string ToString () |
||||
{ |
||||
return String.Format ("{0} - {1}", name, computedName); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,81 +0,0 @@
@@ -1,81 +0,0 @@
|
||||
// Author:
|
||||
// Alexander Corrado (alexander.corrado@gmail.com)
|
||||
// Andreia Gaita (shana@spoiledcat.net)
|
||||
// Zoltan Varga <vargaz@gmail.com>
|
||||
//
|
||||
// Copyright (C) 2011 Novell Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
using System; |
||||
using System.Linq; |
||||
using System.Collections.Generic; |
||||
|
||||
using Mono.VisualC.Interop; |
||||
using Mono.VisualC.Interop.Util; |
||||
|
||||
namespace Mono.VisualC.Tools.Generator { |
||||
|
||||
// This is the best I could come up with to prevent duplicate managed
|
||||
// signatures. The problem is, most of the types don't exist yet.
|
||||
public struct MethodSignature { |
||||
public string Name; |
||||
public IEnumerable<CppType> Arguments; |
||||
|
||||
public MethodSignature (string name, IEnumerable<CppType> args) |
||||
{ |
||||
Name = name; |
||||
|
||||
// This is kinda hacky, but it was the best I could come up with at the time.
|
||||
// Remove any modifiers that will affect the managed type signature.
|
||||
// FIXME: Subtract more?
|
||||
Arguments = args.Select (a => a.Subtract (CppModifiers.Const)) |
||||
.Select (a => a.Subtract (CppModifiers.Volatile)) |
||||
.Select (a => a.Subtract (CppModifiers.Pointer)) |
||||
.Select (a => a.Subtract (CppModifiers.Reference)) |
||||
.Select (a => a.Modifiers.Count (m => m == CppModifiers.Long) > 1 ? a.Subtract (CppModifiers.Long) : a) |
||||
.Select (a => a.ElementType == CppTypes.Char? a.Subtract (CppModifiers.Unsigned).Subtract (CppModifiers.Signed) : a); |
||||
} |
||||
|
||||
public override bool Equals (object obj) |
||||
{ |
||||
if (obj == null) |
||||
return false; |
||||
if (obj.GetType () != typeof(MethodSignature)) |
||||
return false; |
||||
MethodSignature other = (MethodSignature)obj; |
||||
return Name == other.Name && |
||||
Arguments != null? Arguments.SequenceEqual (other.Arguments) : |
||||
other.Arguments == null; |
||||
} |
||||
|
||||
|
||||
public override int GetHashCode () |
||||
{ |
||||
unchecked { |
||||
return (Name != null? Name.GetHashCode () : 0) ^ |
||||
(Arguments != null? Arguments.SequenceHashCode () : 0); |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
@ -1,96 +0,0 @@
@@ -1,96 +0,0 @@
|
||||
// Author:
|
||||
// Alexander Corrado (alexander.corrado@gmail.com)
|
||||
// Andreia Gaita (shana@spoiledcat.net)
|
||||
// Zoltan Varga <vargaz@gmail.com>
|
||||
//
|
||||
// Copyright (C) 2011 Novell Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Linq; |
||||
using System.Text.RegularExpressions; |
||||
using System.Collections.Generic; |
||||
|
||||
using Mono.VisualC.Code; |
||||
using Mono.VisualC.Code.Atoms; |
||||
|
||||
namespace Mono.VisualC.Tools.Generator { |
||||
|
||||
public static class Postfixes { |
||||
public static readonly List<IPostfix> List = new List<IPostfix> () { |
||||
new DuplicateMemberFix () |
||||
}; |
||||
} |
||||
|
||||
public interface IPostfix { |
||||
bool TryFix (string errorMessage, Generator gen); |
||||
|
||||
} |
||||
|
||||
public class DuplicateMemberFix : IPostfix { |
||||
private static readonly Regex ID = new Regex("The type `(.+)' already contains a definition for `(.+)'"); |
||||
|
||||
public DuplicateMemberFix () |
||||
{ |
||||
} |
||||
|
||||
public bool TryFix (string errorMessage, Generator gen) |
||||
{ |
||||
Match m = ID.Match (errorMessage); |
||||
if (!m.Success) |
||||
return false; |
||||
|
||||
string typeName = m.Groups [1].Value; |
||||
string oldMember = m.Groups [2].Value; |
||||
string newMember = oldMember + "2"; |
||||
bool memberFound = false; |
||||
|
||||
CodeContainer type = gen.GetPath (typeName.Split ('.').Skip (1).ToArray ()); |
||||
|
||||
foreach (var method in type.Atoms.OfType<Method> ()) { |
||||
if (method.FormattedName == oldMember) { |
||||
method.FormattedName = newMember; |
||||
memberFound = true; |
||||
break; |
||||
} |
||||
} |
||||
|
||||
if (!memberFound) { |
||||
foreach (var prop in type.Atoms.OfType<Property> ()) { |
||||
if (prop.Name == oldMember) { |
||||
prop.Name = newMember; |
||||
memberFound = true; |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (memberFound) { |
||||
//Console.WriteLine ("Renaming \"{0}\" to \"{1}\" to prevent name collision in class \"{2}\" ...", oldMember, newMember, typeName);
|
||||
gen.Save (); |
||||
} |
||||
|
||||
return memberFound; |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,21 +0,0 @@
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<xsl:stylesheet version="1.0" |
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
||||
exclude-result-prefixes="xsl" |
||||
|
||||
> |
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/> |
||||
<xsl:strip-space elements="*" /> |
||||
|
||||
<xsl:template match="/"> |
||||
<root> |
||||
<xsl:apply-templates /> |
||||
</root> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match="*[@mangled]"> |
||||
<pair><xsl:copy-of select="@mangled" /><xsl:copy-of select="@demangled" /></pair> |
||||
<xsl:apply-templates /> |
||||
</xsl:template> |
||||
|
||||
</xsl:stylesheet> |
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
../src/generator/bin/Debug/generator |
File diff suppressed because one or more lines are too long
@ -1,27 +0,0 @@
@@ -1,27 +0,0 @@
|
||||
using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle("qttests")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("")] |
||||
[assembly: AssemblyCopyright("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")] |
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
|
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
using System; |
||||
|
||||
using Mono.VisualC.Interop; |
||||
|
||||
namespace qttests { |
||||
class MainClass { |
||||
public static void Main (string[] args) |
||||
{ |
||||
Console.WriteLine ("Hello World!"); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,99 +0,0 @@
@@ -1,99 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> |
||||
<PropertyGroup> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProductVersion>8.0.50727</ProductVersion> |
||||
<SchemaVersion>2.0</SchemaVersion> |
||||
<ProjectGuid>{8DBA7E4A-7736-499A-85AC-0524535B880A}</ProjectGuid> |
||||
<OutputType>Exe</OutputType> |
||||
<RootNamespace>qttests</RootNamespace> |
||||
<AssemblyName>qttests</AssemblyName> |
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
||||
<FileUpgradeFlags> |
||||
</FileUpgradeFlags> |
||||
<UpgradeBackupLocation> |
||||
</UpgradeBackupLocation> |
||||
<OldToolsVersion>2.0</OldToolsVersion> |
||||
<PublishUrl>http://localhost/qttests/</PublishUrl> |
||||
<Install>true</Install> |
||||
<InstallFrom>Web</InstallFrom> |
||||
<UpdateEnabled>true</UpdateEnabled> |
||||
<UpdateMode>Foreground</UpdateMode> |
||||
<UpdateInterval>7</UpdateInterval> |
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits> |
||||
<UpdatePeriodically>false</UpdatePeriodically> |
||||
<UpdateRequired>false</UpdateRequired> |
||||
<MapFileExtensions>true</MapFileExtensions> |
||||
<ApplicationRevision>0</ApplicationRevision> |
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> |
||||
<IsWebBootstrapper>true</IsWebBootstrapper> |
||||
<UseApplicationTrust>false</UseApplicationTrust> |
||||
<BootstrapperEnabled>true</BootstrapperEnabled> |
||||
<TargetFrameworkProfile /> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>full</DebugType> |
||||
<Optimize>false</Optimize> |
||||
<OutputPath>bin\Debug</OutputPath> |
||||
<DefineConstants>DEBUG</DefineConstants> |
||||
<ErrorReport>prompt</ErrorReport> |
||||
<WarningLevel>4</WarningLevel> |
||||
<Externalconsole>true</Externalconsole> |
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
||||
<DebugType>none</DebugType> |
||||
<Optimize>false</Optimize> |
||||
<OutputPath>bin\Release</OutputPath> |
||||
<ErrorReport>prompt</ErrorReport> |
||||
<WarningLevel>4</WarningLevel> |
||||
<Externalconsole>true</Externalconsole> |
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="Main.cs" /> |
||||
<Compile Include="AssemblyInfo.cs" /> |
||||
<Compile Include="..\output\FlatFile.cs"> |
||||
<Link>QtBindings\FlatFile.cs</Link> |
||||
</Compile> |
||||
<Compile Include="..\output\Lib_Lib.cs"> |
||||
<Link>QtBindings\Lib_Lib.cs</Link> |
||||
</Compile> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5"> |
||||
<Visible>False</Visible> |
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> |
||||
<Install>false</Install> |
||||
</BootstrapperPackage> |
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> |
||||
<Visible>False</Visible> |
||||
<ProductName>.NET Framework 3.5 SP1</ProductName> |
||||
<Install>true</Install> |
||||
</BootstrapperPackage> |
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> |
||||
<Visible>False</Visible> |
||||
<ProductName>Windows Installer 3.1</ProductName> |
||||
<Install>true</Install> |
||||
</BootstrapperPackage> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="app.config" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\..\src\Mono.VisualC.Code\Mono.VisualC.Code.csproj"> |
||||
<Project>{A22BF9D9-BBCB-4462-BE08-0F4D5280B180}</Project> |
||||
<Name>Mono.VisualC.Code</Name> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\src\Mono.VisualC.Interop\Mono.VisualC.Interop.csproj"> |
||||
<Project>{4A864586-93C5-4DC1-8A80-F094A88506D7}</Project> |
||||
<Name>Mono.VisualC.Interop</Name> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
||||
</Project> |
@ -1,125 +0,0 @@
@@ -1,125 +0,0 @@
|
||||
using System; |
||||
using System.Reflection; |
||||
using System.Collections.Generic; |
||||
|
||||
public class CategoryAttribute : Attribute |
||||
{ |
||||
public CategoryAttribute (string category) { |
||||
Category = category; |
||||
} |
||||
|
||||
public string Category { |
||||
get; set; |
||||
} |
||||
} |
||||
|
||||
public class TestDriver { |
||||
|
||||
static public int RunTests (Type type, string[] args) { |
||||
int failed = 0, ran = 0; |
||||
int result, expected; |
||||
int i, j, iterations; |
||||
string name; |
||||
MethodInfo[] methods; |
||||
bool do_timings = false; |
||||
bool verbose = false; |
||||
int tms = 0; |
||||
DateTime start, end = DateTime.Now; |
||||
|
||||
iterations = 1; |
||||
|
||||
var exclude = new Dictionary<string, string> (); |
||||
List<string> run_only = new List<string> (); |
||||
if (args != null && args.Length > 0) { |
||||
for (j = 0; j < args.Length;) { |
||||
if (args [j] == "--time") { |
||||
do_timings = true; |
||||
j ++; |
||||
} else if (args [j] == "--iter") { |
||||
iterations = Int32.Parse (args [j + 1]); |
||||
j += 2; |
||||
} else if ((args [j] == "-v") || (args [j] == "--verbose")) { |
||||
verbose = true; |
||||
} else if (args [j] == "--exclude") { |
||||
exclude [args [j + 1]] = args [j + 1]; |
||||
j += 2; |
||||
} else if (args [j] == "--run-only") { |
||||
run_only.Add (args [j + 1]); |
||||
j += 2; |
||||
} else { |
||||
Console.WriteLine ("Unknown argument: " + args [j]); |
||||
return 1; |
||||
} |
||||
} |
||||
} |
||||
int nskipped = 0; |
||||
methods = type.GetMethods (BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Static); |
||||
for (int iter = 0; iter < iterations; ++iter) { |
||||
for (i = 0; i < methods.Length; ++i) { |
||||
name = methods [i].Name; |
||||
if (!name.StartsWith ("test_", StringComparison.Ordinal)) |
||||
continue; |
||||
if (run_only.Count > 0) { |
||||
bool found = false; |
||||
for (j = 0; j < run_only.Count; j++) { |
||||
if (name.EndsWith (run_only [j])) { |
||||
found = true; |
||||
break; |
||||
} |
||||
} |
||||
if (!found) |
||||
continue; |
||||
} |
||||
if (exclude.Count > 0) { |
||||
var attrs = methods [i].GetCustomAttributes (typeof (CategoryAttribute), false); |
||||
bool skip = false; |
||||
foreach (CategoryAttribute attr in attrs) { |
||||
if (exclude.ContainsKey (attr.Category)) |
||||
skip = true; |
||||
} |
||||
if (skip) { |
||||
if (verbose) |
||||
Console.WriteLine ("Skipping '{0}'.", name); |
||||
nskipped ++; |
||||
continue; |
||||
} |
||||
} |
||||
for (j = 5; j < name.Length; ++j) |
||||
if (!Char.IsDigit (name [j])) |
||||
break; |
||||
if (verbose) |
||||
Console.WriteLine ("Running '{0}' ...", name); |
||||
expected = Int32.Parse (name.Substring (5, j - 5)); |
||||
start = DateTime.Now; |
||||
result = (int)methods [i].Invoke (null, null); |
||||
if (do_timings) { |
||||
end = DateTime.Now; |
||||
long tdiff = end.Ticks - start.Ticks; |
||||
int mdiff = (int)tdiff/10000; |
||||
tms += mdiff; |
||||
Console.WriteLine ("{0} took {1} ms", name, mdiff); |
||||
} |
||||
ran++; |
||||
if (result != expected) { |
||||
failed++; |
||||
Console.WriteLine ("{0} failed: got {1}, expected {2}", name, result, expected); |
||||
} |
||||
} |
||||
|
||||
if (do_timings) { |
||||
Console.WriteLine ("Total ms: {0}", tms); |
||||
} |
||||
if (nskipped > 0) |
||||
Console.WriteLine ("Regression tests: {0} ran, {1} skipped, {2} failed in {3}", ran, nskipped, failed, type); |
||||
else |
||||
Console.WriteLine ("Regression tests: {0} ran, {1} failed in {2}", ran, failed, type); |
||||
} |
||||
|
||||
//Console.WriteLine ("Regression tests: {0} ran, {1} failed in [{2}]{3}", ran, failed, type.Assembly.GetName().Name, type);
|
||||
return failed; |
||||
} |
||||
static public int RunTests (Type type) { |
||||
return RunTests (type, null); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue