Browse Source

Clean up and reorganize source tree.

+ Consolidate tests; remove src/CPPTestLib, src/Tests, tests2 directories.
+ Move MD solution to root dir.
pull/1/head
Alex Corrado 14 years ago
parent
commit
19e8cb3d2b
  1. 30
      CPPInterop.sln
  2. 44
      src/CPPTestLib/CPPTestLib.cproj
  3. 99
      src/CPPTestLib/CSimpleClass.cpp
  4. 33
      src/CPPTestLib/VirtualMethodTestClass.cpp
  5. 27
      src/QtTest/AssemblyInfo.cs
  6. 29
      src/QtTest/Main.cs
  7. 104
      src/QtTest/Makefile.am
  8. 93
      src/QtTest/QtTest.csproj
  9. 3
      src/QtTest/qttest.in
  10. 55
      src/Tests/CppLibraryTests.cs
  11. 102
      src/Tests/Makefile.am
  12. 103
      src/Tests/Support/CSimpleClass.cs
  13. 32
      src/Tests/Support/VirtualMethodTestClass.cs
  14. 125
      src/generator/Entry.cs
  15. 81
      src/generator/MethodSignature.cs
  16. 96
      src/generator/Postfixes.cs
  17. 12
      src/generator/generator.csproj
  18. 0
      tests/CppInstancePtrTests.cs
  19. 0
      tests/ItaniumAbiTests.cs
  20. 0
      tests/Makefile.am
  21. 0
      tests/MsvcAbiTests.cs
  22. 0
      tests/Native/NUnit.cpp
  23. 0
      tests/Native/NUnit.h
  24. 0
      tests/Native/test.cpp
  25. 0
      tests/Native/test.h
  26. 19142
      tests/QApplication.xml
  27. 26034
      tests/QGraphicsEffect.xml
  28. 4050
      tests/QMetaObject.xml
  29. 17597
      tests/QObject.xml
  30. 28170
      tests/QPushButton.xml
  31. 3716
      tests/Qt.xml
  32. 18531
      tests/QtCore.xml
  33. 92788
      tests/QtGui.xml
  34. 0
      tests/README
  35. 0
      tests/SharedAbiTests.cs
  36. 0
      tests/Support/CppMockObject.cs
  37. 0
      tests/Support/CppNUnitAsserts.cs
  38. 0
      tests/Tests.csproj
  39. 21
      tests/cpp.xslt
  40. 2
      tests/gccxml-options
  41. 1
      tests/generator
  42. 22535
      tests/qpainterpath.xml
  43. 1
      tests/qt4
  44. 27
      tests/qttests/AssemblyInfo.cs
  45. 13
      tests/qttests/Main.cs
  46. 99
      tests/qttests/qttests.csproj
  47. 0
      tests/test.cs
  48. 0
      tests/tests.pc.in
  49. 125
      tests2/TestDriver.cs

30
src/CPPInterop.sln → CPPInterop.sln

@ -1,21 +1,15 @@ @@ -1,21 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.VisualC.Interop", "Mono.VisualC.Interop\Mono.VisualC.Interop.csproj", "{4A864586-93C5-4DC1-8A80-F094A88506D7}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.VisualC.Interop", "src\Mono.VisualC.Interop\Mono.VisualC.Interop.csproj", "{4A864586-93C5-4DC1-8A80-F094A88506D7}"
EndProject
Project("{2857B73E-F847-4B02-9238-064979017E93}") = "CPPTestLib", "CPPTestLib\CPPTestLib.cproj", "{B01E6282-144E-481A-8E1F-95F708DFBC2D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "tests\Tests.csproj", "{3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QtBindings", "src\QtBindings\QtBindings.csproj", "{66212CA6-B8C2-4307-ADDE-DAFEAAB339B9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QtTest", "QtTest\QtTest.csproj", "{3EE6B50E-58FB-4391-AF01-3FCB1A29B0D7}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.VisualC.Code", "src\Mono.VisualC.Code\Mono.VisualC.Code.csproj", "{A22BF9D9-BBCB-4462-BE08-0F4D5280B180}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QtBindings", "QtBindings\QtBindings.csproj", "{66212CA6-B8C2-4307-ADDE-DAFEAAB339B9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.VisualC.Code", "Mono.VisualC.Code\Mono.VisualC.Code.csproj", "{A22BF9D9-BBCB-4462-BE08-0F4D5280B180}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "generator", "generator\generator.csproj", "{AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "qttests", "..\tests\qttests\qttests.csproj", "{8DBA7E4A-7736-499A-85AC-0524535B880A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "generator", "src\generator\generator.csproj", "{AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -24,21 +18,17 @@ Global @@ -24,21 +18,17 @@ Global
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Release|Any CPU.Build.0 = Release|Any CPU
{3EE6B50E-58FB-4391-AF01-3FCB1A29B0D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3EE6B50E-58FB-4391-AF01-3FCB1A29B0D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3EE6B50E-58FB-4391-AF01-3FCB1A29B0D7}.Release|Any CPU.Build.0 = Release|Any CPU
{4A864586-93C5-4DC1-8A80-F094A88506D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A864586-93C5-4DC1-8A80-F094A88506D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|Any CPU.Build.0 = Release|Any CPU
{66212CA6-B8C2-4307-ADDE-DAFEAAB339B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66212CA6-B8C2-4307-ADDE-DAFEAAB339B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66212CA6-B8C2-4307-ADDE-DAFEAAB339B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66212CA6-B8C2-4307-ADDE-DAFEAAB339B9}.Release|Any CPU.Build.0 = Release|Any CPU
{8DBA7E4A-7736-499A-85AC-0524535B880A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8DBA7E4A-7736-499A-85AC-0524535B880A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8DBA7E4A-7736-499A-85AC-0524535B880A}.Release|Any CPU.Build.0 = Release|Any CPU
{A22BF9D9-BBCB-4462-BE08-0F4D5280B180}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A22BF9D9-BBCB-4462-BE08-0F4D5280B180}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A22BF9D9-BBCB-4462-BE08-0F4D5280B180}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -47,10 +37,6 @@ Global @@ -47,10 +37,6 @@ Global
{AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Release|Any CPU.Build.0 = Release|Any CPU
{B01E6282-144E-481A-8E1F-95F708DFBC2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B01E6282-144E-481A-8E1F-95F708DFBC2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B01E6282-144E-481A-8E1F-95F708DFBC2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B01E6282-144E-481A-8E1F-95F708DFBC2D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = generator\generator.csproj

44
src/CPPTestLib/CPPTestLib.cproj

@ -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 &quot;if [ `uname` = Darwin ]; then mv lib${ProjectName}.so lib${ProjectName}.dylib; fi&quot;" 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>

99
src/CPPTestLib/CSimpleClass.cpp

@ -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;
}
}

33
src/CPPTestLib/VirtualMethodTestClass.cpp

@ -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;
}
}

27
src/QtTest/AssemblyInfo.cs

@ -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("")]

29
src/QtTest/Main.cs

@ -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 ();
}
}
}
}
}

104
src/QtTest/Makefile.am

@ -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)

93
src/QtTest/QtTest.csproj

@ -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>

3
src/QtTest/qttest.in

@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
#!/bin/sh
exec mono "@expanded_libdir@/@PACKAGE@/QtTest.exe" "$@"

55
src/Tests/CppLibraryTests.cs

@ -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");
}
}
}

102
src/Tests/Makefile.am

@ -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)

103
src/Tests/Support/CSimpleClass.cs

@ -1,103 +0,0 @@ @@ -1,103 +0,0 @@
// CSimpleClass.cs created with MonoDevelop
// User: alex at 17:41 03/14/2009
//
using System;
using System.Runtime.InteropServices;
using Mono.VisualC.Interop;
namespace Tests.Support {
public class CSimpleClass : ICppObject {
#region C++ Header
// This interface is analogous to the C++ class public header -- it defines the
// C++ class's interface. The order of methods must be the same as in the C++ header.
public interface ICSimpleClass : ICppClassOverridable<CSimpleClass> {
// constructor
void CSimpleClass(CppInstancePtr ths, int value);
void M0(CppInstancePtr ths);
[Virtual] void V0(CppInstancePtr ths, int x, int y);
void M1(CppInstancePtr ths, int x);
[Virtual] void V1(CppInstancePtr ths, int x);
void M2(CppInstancePtr ths, int x, int y);
// a C++ field directly accessible to managed code
CppField<int> value {get;}
}
// This struct defines the C++ class's memory footprint.
// Basically, it includes both the class's public and private fields.
// Again, the order must be the same as in the C++ header.
public struct _CSimpleClass {
public int value;
}
#endregion
private CppInstancePtr native;
private ICSimpleClass impl;
public CSimpleClass(ICSimpleClass impl, int value) {
this.impl = impl;
this.native = impl.Alloc(this);
impl.CSimpleClass(native, value);
}
public CSimpleClass(ICSimpleClass impl, IntPtr native) {
this.impl = impl;
this.native = native;
}
public IntPtr Native {
get { return (IntPtr)native; }
}
public int NativeSize {
get { return impl.NativeSize; }
}
public ICSimpleClass Implementation {
get { return impl; }
}
public virtual int value {
get {
return impl.value[native];
}
set {
impl.value[native] = value;
}
}
public void M0() {
impl.M0(native);
}
public void M1(int x) {
impl.M1(native, x);
}
public void M2(int x, int y) {
impl.M2(native, x, y);
}
[OverrideNative]
public virtual void V0(int x, int y) {
Console.WriteLine("Managed V0({0}, {1})", x, y);
impl.V0(native, x, y);
}
[OverrideNative]
public virtual void V1(int x) {
Console.WriteLine("Managed V1({0})", x);
impl.V1(native, x);
}
public void Dispose() {
impl.Destruct(native);
native.Dispose();
}
}
}

32
src/Tests/Support/VirtualMethodTestClass.cs

@ -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);
}
}

125
src/generator/Entry.cs

@ -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);
}
}
}

81
src/generator/MethodSignature.cs

@ -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);
}
}
}
}

96
src/generator/Postfixes.cs

@ -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;
}
}
}

12
src/generator/generator.csproj

@ -30,7 +30,6 @@ @@ -30,7 +30,6 @@
<IsWebBootstrapper>true</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -52,11 +51,14 @@ @@ -52,11 +51,14 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="Options.cs" />
<Compile Include="MethodSignature.cs" />
<Compile Include="Postfixes.cs" />
<Compile Include="Entry.cs" />
<Compile Include="Class.cs" />
<Compile Include="Field.cs" />
<Compile Include="Generator.cs" />
<Compile Include="Method.cs" />
<Compile Include="Node.cs" />
<Compile Include="Parameter.cs" />
<Compile Include="Property.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System">

0
src/Tests/CppInstancePtrTests.cs → tests/CppInstancePtrTests.cs

0
src/Tests/ItaniumAbiTests.cs → tests/ItaniumAbiTests.cs

0
tests2/Makefile.am → tests/Makefile.am

0
src/Tests/MsvcAbiTests.cs → tests/MsvcAbiTests.cs

0
src/CPPTestLib/NUnit.cpp → tests/Native/NUnit.cpp

0
src/CPPTestLib/NUnit.h → tests/Native/NUnit.h

0
tests2/test.cpp → tests/Native/test.cpp

0
tests2/test.h → tests/Native/test.h

19142
tests/QApplication.xml

File diff suppressed because one or more lines are too long

26034
tests/QGraphicsEffect.xml

File diff suppressed because one or more lines are too long

4050
tests/QMetaObject.xml

File diff suppressed because it is too large Load Diff

17597
tests/QObject.xml

File diff suppressed because one or more lines are too long

28170
tests/QPushButton.xml

File diff suppressed because one or more lines are too long

3716
tests/Qt.xml

File diff suppressed because it is too large Load Diff

18531
tests/QtCore.xml

File diff suppressed because one or more lines are too long

92788
tests/QtGui.xml

File diff suppressed because one or more lines are too long

0
tests2/README → tests/README

0
src/Tests/SharedAbiTests.cs → tests/SharedAbiTests.cs

0
src/Tests/Support/CppMockObject.cs → tests/Support/CppMockObject.cs

0
src/Tests/Support/CppNUnitAsserts.cs → tests/Support/CppNUnitAsserts.cs

0
src/Tests/Tests.csproj → tests/Tests.csproj

21
tests/cpp.xslt

@ -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>

2
tests/gccxml-options

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
-Iqt4

1
tests/generator

@ -1 +0,0 @@ @@ -1 +0,0 @@
../src/generator/bin/Debug/generator

22535
tests/qpainterpath.xml

File diff suppressed because one or more lines are too long

1
tests/qt4

@ -1 +0,0 @@ @@ -1 +0,0 @@
/usr/include/qt4

27
tests/qttests/AssemblyInfo.cs

@ -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("")]

13
tests/qttests/Main.cs

@ -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!");
}
}
}

99
tests/qttests/qttests.csproj

@ -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>

0
tests2/test.cs → tests/test.cs

0
src/Tests/tests.pc.in → tests/tests.pc.in

125
tests2/TestDriver.cs

@ -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…
Cancel
Save