summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorsagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8>2009-06-06 15:16:25 (GMT)
committersagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8>2009-06-06 15:16:25 (GMT)
commit75930c8588ebf9f5eb77d5e49b7b7e6e33c2c15a (patch)
tree79d0064b694da77fbc9a44a256ba1333513e1466 /test
parent5f8ec64d826f844ccc5e5f5b8767545e305a6e81 (diff)
downloadcv2pdb-75930c8588ebf9f5eb77d5e49b7b7e6e33c2c15a.zip
cv2pdb-75930c8588ebf9f5eb77d5e49b7b7e6e33c2c15a.tar.gz
cv2pdb-75930c8588ebf9f5eb77d5e49b7b7e6e33c2c15a.tar.bz2
v0.5:
* fixed error in __viewhelper field of string type, that could screw up type info * added support for wstring and dstring * fixed problems with debug info inside library by combining debug info of different modules into a single pseudo-module * now also replaces '.' by '@' in enumerator types for more consistent debug info
Diffstat (limited to 'test')
-rw-r--r--test/Makefile40
-rw-r--r--test/cvtest.d50
-rw-r--r--test/cvtest.vcproj74
3 files changed, 152 insertions, 12 deletions
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..6bed715
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,40 @@
+
+PROJECT = cvtest
+
+SRC = cvtest.d
+
+DBGDIR = ..\bin\Debug
+RELDIR = ..\bin\Release
+
+DMD = c:\l\dmd-2.030\windows\bin\dmd.exe
+# DMD = c:\l\dmd-1.045\windows\bin\dmd.exe
+
+CV2PDB_DBG = $(DBGDIR)\cv2pdb.exe
+CV2PDB_REL = $(RELDIR)\cv2pdb.exe
+
+DFLAGS = -L/DELEXECUTABLE
+LIBS = phobos.lib
+
+default: dbg_exe
+release: rel_exe
+
+dbg_exe: $(DBGDIR)\$(PROJECT).exe
+rel_exe: $(RELDIR)\$(PROJECT).exe
+
+######################
+$(DBGDIR)\$(PROJECT).exe : $(DBGDIR)\$(PROJECT)_cv.exe $(CV2PDB_DBG)
+ $(CV2PDB_DBG) $(DBGDIR)\$(PROJECT)_cv.exe $@
+
+$(DBGDIR)\$(PROJECT)_cv.exe : $(SRC) Makefile
+ $(DMD) -of$@ -g -unittest $(DFLAGS) @<<
+ $(SRC) $(LIBS)
+<<NOKEEP
+
+
+$(RELDIR)\$(PROJECT).exe : $(RELDIR)\$(PROJECT)_cv.exe $(CV2PDB_REL)
+ $(CV2PDB_REL) $(RELDIR)\$(PROJECT)_cv.exe $@
+
+$(RELDIR)\$(PROJECT)_cv.exe : $(SRC) Makefile
+ $(DMD) -of$@ -g -release -unittest $(DFLAGS) @<<
+ $(SRC) $(LIBS)
+<<NOKEEP
diff --git a/test/cvtest.d b/test/cvtest.d
index c978f03..c5b80a1 100644
--- a/test/cvtest.d
+++ b/test/cvtest.d
@@ -1,12 +1,14 @@
module cvtest;
+import std.string;
+import std.stdio;
///////////////// field types ////////////////////////
// field type LF_ENUMERATE_V1
enum enum_name
{
- kEnum1,
+ kEnum1 = 1,
kEnum2,
kEnum3,
kEnum500 = 500,
@@ -125,13 +127,16 @@ class Templ(T)
}
}
-enum stringMixin = "int a = 0;
-return x + a;
-";
-
-int mixinTest(int x)
+version(D2)
{
- mixin(stringMixin);
+ string stringMixin = "int a = 0;
+ return x + a;
+ ";
+
+ int mixinTest(int x)
+ {
+ mixin(stringMixin);
+ }
}
int main2(char[][]argv)
@@ -180,6 +185,8 @@ int main(char[][]argv)
main2(argv);
+ writefln("Hello world");
+
int[int] int_arr;
int_arr[1] = 100;
int_arr[98] = 101;
@@ -200,18 +207,22 @@ int main(char[][]argv)
struc_arr[ab2] = 6;
struc_arr[ab3] = 7;
- Templ!(int) templ = new Templ!(int);
- int y = templ.foo(3);
- int z = mixinTest(7);
+ Templ!(int) templ = new Templ!(int);
+ int y = templ.foo(3);
+ version(D2)
+ int z = mixinTest(7);
- (new Test).test();
+ (new Test).test();
+
+ dmd_quirks();
+ strings();
int[] dynint_arr;
dynint_arr ~= 12;
return dynint_arr.length;
}
-alias invariant(char)[] string;
+// alias invariant(char)[] string;
class Test
{
@@ -231,3 +242,18 @@ class Test
return dyn_arr.length + assoc_arr.length + clss.c;
}
}
+
+int strings()
+{
+ string cs = "char string";
+ wstring ws = "wchar string"w;
+ dstring ds = "dchar string"d;
+
+ return 0;
+}
+
+void dmd_quirks()
+{
+ long quirk_long; // written as delegate<void*,int>
+ ulong quirk_ulong; // written as int[]
+}
diff --git a/test/cvtest.vcproj b/test/cvtest.vcproj
new file mode 100644
index 0000000..f769bce
--- /dev/null
+++ b/test/cvtest.vcproj
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="cvtest"
+ ProjectGUID="{CCC0643D-7D3F-4D5E-AE0E-C871776E86AF}"
+ RootNamespace="cvtest"
+ Keyword="MakeFileProj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="..\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(OutDir)"
+ ConfigurationType="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="nmake -f Makefile"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output="..\bin\Debug\cvtest.exe"
+ PreprocessorDefinitions="WIN32;_DEBUG"
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="..\bin\$(ConfigurationName)"
+ IntermediateDirectory="$(OutDir)"
+ ConfigurationType="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="nmake -f Makefile release"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output="..\bin\Release\cvtest.exe"
+ PreprocessorDefinitions="WIN32;NDEBUG"
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\cvtest.d"
+ >
+ </File>
+ <File
+ RelativePath=".\Makefile"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>