diff --git a/.gitignore b/.gitignore index 9cf7443..681a1b1 100755 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ Makefile.in /install-sh /missing /config.status +/.vs diff --git a/Applications/LuaRunner/LuaRunner.csproj b/Applications/LuaRunner/LuaRunner.csproj index b73bb62..34f5fba 100644 --- a/Applications/LuaRunner/LuaRunner.csproj +++ b/Applications/LuaRunner/LuaRunner.csproj @@ -1,74 +1,20 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5} Exe - Properties - LuaRunner + netcoreapp2.0 LuaRunner - 2.x - - - true - full - false - ..\..\Run\Debug - DEBUG - prompt - 4 - AllRules.ruleset + LuaRunner + LuaRunner.LuaNetRunner - - none - true - ..\..\Run\Release - RELEASE - prompt - 4 - AllRules.ruleset + + + DEBUG;NETCOREAPP2_0 + ..\..\Run\Debug\netcoreapp2.0\ + - - - - - - - - - - - {F55CABBB-4108-4A39-94E1-581FD46DC021} - LuaInterface - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - + - - + diff --git a/Applications/LuaRunner/Properties/AssemblyInfo.cs b/Applications/LuaRunner/Properties/AssemblyInfo.cs deleted file mode 100644 index fde026c..0000000 --- a/Applications/LuaRunner/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of LuaInterface. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * 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.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using LuaInterface.Config; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("LuaRunner")] -[assembly: AssemblyDescription(Consts.LuaInterfaceDescription)] -[assembly: AssemblyConfiguration(Consts.LuaInterfaceConfiguration)] -[assembly: AssemblyCompany(Consts.LuaInterfaceCompany)] -[assembly: AssemblyProduct(Consts.LuaInterfaceProduct)] -[assembly: AssemblyCopyright(Consts.LuaInterfaceCopyright)] -[assembly: AssemblyTrademark(Consts.LuaInterfaceTrademark)] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.2")] -[assembly: AssemblyFileVersion("1.5.2")] \ No newline at end of file diff --git a/Core/KopiLua/KopiLua.IOS.csproj b/Core/KopiLua/KopiLua.IOS.csproj deleted file mode 100644 index 1c41b49..0000000 --- a/Core/KopiLua/KopiLua.IOS.csproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - Debug - AnyCPU - 10.0.0 - 2.0 - {23997AB1-C4A3-49BA-A7B5-4C14F97C236B} - {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - KopiLua - Resources - KopiLua - - - True - full - False - bin\Debug - TRACE;DEBUG;LUA_CORE;_WIN32;LUA_COMPAT_VARARG;LUA_COMPAT_MOD;LUA_COMPAT_GFIND;CATCH_EXCEPTIONS - prompt - 4 - False - - - none - True - bin\Release - prompt - 4 - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Core/KopiLua/KopiLua.csproj b/Core/KopiLua/KopiLua.csproj index 1b739d8..5daa313 100644 --- a/Core/KopiLua/KopiLua.csproj +++ b/Core/KopiLua/KopiLua.csproj @@ -1,103 +1,13 @@ - - + + - Debug - AnyCPU - 9.0.30729 - 2.0 - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8} - Library - Properties + netstandard2.0 Lua - KopiLua - 2.x - - true - full - false - ..\..\Run\Debug - TRACE;DEBUG;LUA_CORE;_WIN32;LUA_COMPAT_VARARG;LUA_COMPAT_MOD;LUA_COMPAT_GFIND;CATCH_EXCEPTIONS - prompt - 4 - AllRules.ruleset + + + TRACE;DEBUG;NETSTANDARD2_0;LUA_CORE;_WIN32;LUA_COMPAT_VARARG;LUA_COMPAT_MOD;LUA_COMPAT_GFIND;CATCH_EXCEPTIONS + ..\..\Run\Debug\netstandard2.0\ - - none - true - ..\..\Run\Release - TRACE;RELEASE;LUA_CORE;_WIN32;LUA_COMPAT_VARARG;LUA_COMPAT_MOD;LUA_COMPAT_GFIND;CATCH_EXCEPTIONS - prompt - 4 - AllRules.ruleset - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - Клиентский профиль .NET Framework 3.5 SP1 - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Установщик Windows 3.1 - true - - - - + diff --git a/Core/KopiLua/Properties/AssemblyInfo.cs b/Core/KopiLua/Properties/AssemblyInfo.cs deleted file mode 100644 index 08fdbe9..0000000 --- a/Core/KopiLua/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("KopiLua")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("KopiLua")] -[assembly: AssemblyCopyright("Copyright © 2009 Mark Feldman")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -[assembly: CLSCompliantAttribute(true)] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1a9cd761-692f-40db-8566-c0217e5d3e0a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Core/KopiLua/Properties/AssemblyInfo_KopiLua_wp7.cs b/Core/KopiLua/Properties/AssemblyInfo_KopiLua_wp7.cs deleted file mode 100644 index 955140e..0000000 --- a/Core/KopiLua/Properties/AssemblyInfo_KopiLua_wp7.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Resources; - -// Управление общими сведениями о сборке осуществляется с помощью следующего -// набора атрибутов. Измените значения этих атрибутов для изменения -// сведений о сборке. -[assembly: AssemblyTitle("KopiLua_wp7")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("MICROSOFT")] -[assembly: AssemblyProduct("KopiLua_wp7")] -[assembly: AssemblyCopyright("Copyright © 2012 Gerasimov Sergey")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Если для ComVisible установить значение false, типы в этой сборке не будут поддерживаться -// COM-компонентами. При необходимости доступа к какому-либо типу в этой сборке -// из модели COM задайте для атрибута ComVisible этого типа значение true. -[assembly: ComVisible(false)] - -// Следующий GUID служит для идентификации библиотеки типов, если данный проект видим для COM -[assembly: Guid("63906a16-e4d0-4ad7-ba8f-cb4d6c29d2d5")] - -// Сведения о версии сборки состоят из следующих четырех значений: -// -// Основной номер версии -// Дополнительный номер версии -// Номер построения -// Редакция -// -// Можно указать все значения или задать для номеров редакции и построения значения по умолчанию -// с помощью символа '*', как показано ниже: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: NeutralResourcesLanguageAttribute("ru-RU")] diff --git a/Core/KopiLua/Properties/AssemblyInfo_Lua.cs b/Core/KopiLua/Properties/AssemblyInfo_Lua.cs deleted file mode 100644 index d0c0c03..0000000 --- a/Core/KopiLua/Properties/AssemblyInfo_Lua.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Lua")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Lua")] -[assembly: AssemblyCopyright("Copyright © Mark Feldman 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("42f29687-47be-4860-a332-c7c4c75b7119")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Core/KopiLua/Properties/AssemblyInfo_Luac.cs b/Core/KopiLua/Properties/AssemblyInfo_Luac.cs deleted file mode 100644 index cfe1427..0000000 --- a/Core/KopiLua/Properties/AssemblyInfo_Luac.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Luac")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Luac")] -[assembly: AssemblyCopyright("Copyright © Mark Feldman 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("403d5192-280f-4171-98e6-c818dd6b9981")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Core/LuaInterface/GenerateEventAssembly/CodeGeneration.cs b/Core/LuaInterface/GenerateEventAssembly/CodeGeneration.cs index d90fac6..a950770 100644 --- a/Core/LuaInterface/GenerateEventAssembly/CodeGeneration.cs +++ b/Core/LuaInterface/GenerateEventAssembly/CodeGeneration.cs @@ -65,8 +65,8 @@ private CodeGeneration() assemblyName = new AssemblyName(); assemblyName.Name = "LuaInterface_generatedcode"; // Create a new assembly with one module. - newAssembly = Thread.GetDomain().DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); - newModule = newAssembly.DefineDynamicModule("LuaInterface_generatedcode"); + newAssembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); + newModule = newAssembly.DefineDynamicModule("LuaInterface_generatedcode"); } /* @@ -110,7 +110,7 @@ private Type GenerateEvent(Type eventHandlerType) // returns generator.Emit(OpCodes.Ret); // creates the new type - return myType.CreateType(); + return myType.CreateTypeInfo().AsType(); } /* @@ -287,7 +287,7 @@ private Type GenerateDelegate(Type delegateType) generator.Emit(OpCodes.Ldloc_3); generator.Emit(OpCodes.Ret); - return myType.CreateType(); // creates the new type + return myType.CreateTypeInfo().AsType(); // creates the new type } /* @@ -363,7 +363,7 @@ public void GenerateClass(Type klass, out Type newType, out Type[][] returnTypes generator = returnTableMethod.GetILGenerator(); generator.Emit(OpCodes.Ldfld, luaTableField); generator.Emit(OpCodes.Ret); - newType = myType.CreateType(); // Creates the type + newType = myType.CreateTypeInfo().AsType(); // Creates the type } /* diff --git a/Core/LuaInterface/LuaInterface.IOS.csproj b/Core/LuaInterface/LuaInterface.IOS.csproj deleted file mode 100644 index c162530..0000000 --- a/Core/LuaInterface/LuaInterface.IOS.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - Debug - AnyCPU - 10.0.0 - 2.0 - {7064B157-DD57-4828-94C5-CA149B25CB40} - {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - LuaInterface.IOS - Resources - LuaInterface.IOS - - - True - full - False - bin\Debug - DEBUG; - prompt - 4 - False - - - none - True - bin\Release - prompt - 4 - False - - - - - - - - - - - {23997AB1-C4A3-49BA-A7B5-4C14F97C236B} - KopiLua.IOS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Core/LuaInterface/LuaInterface.csproj b/Core/LuaInterface/LuaInterface.csproj index a4f170a..9d14f89 100644 --- a/Core/LuaInterface/LuaInterface.csproj +++ b/Core/LuaInterface/LuaInterface.csproj @@ -1,102 +1,21 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {F55CABBB-4108-4A39-94E1-581FD46DC021} - Library - Properties + netstandard2.0 LuaInterface - LuaInterface - 2.x - - true - full - false - ..\..\Run\Debug - DEBUG - prompt - 4 + + + DEBUG;NETSTANDARD2_0 + ..\..\Run\Debug\netstandard2.0\ - - none - true - ..\..\Run\Release - RELEASE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8} - KopiLua - + + - - - - - - + + diff --git a/Core/LuaInterface/Properties/AssemblyInfo.cs b/Core/LuaInterface/Properties/AssemblyInfo.cs deleted file mode 100644 index c5b6693..0000000 --- a/Core/LuaInterface/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is part of LuaInterface. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * 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.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using LuaInterface.Config; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("LuaInterface")] -[assembly: AssemblyDescription(Consts.LuaInterfaceDescription)] -[assembly: AssemblyConfiguration(Consts.LuaInterfaceConfiguration)] -[assembly: AssemblyCompany(Consts.LuaInterfaceCompany)] -[assembly: AssemblyProduct(Consts.LuaInterfaceProduct)] -[assembly: AssemblyCopyright(Consts.LuaInterfaceCopyright)] -[assembly: AssemblyTrademark(Consts.LuaInterfaceTrademark)] - -[assembly: CLSCompliant(true)] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(Consts.LuaInterfaceVersion)] -[assembly: AssemblyFileVersion(Consts.LuaInterfaceFileVersion)] \ No newline at end of file diff --git a/LuaInterface.IOS.sln b/LuaInterface.IOS.sln deleted file mode 100644 index b4806a3..0000000 --- a/LuaInterface.IOS.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LuaInterface.IOS", "Core\LuaInterface\LuaInterface.IOS.csproj", "{7064B157-DD57-4828-94C5-CA149B25CB40}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KopiLua.IOS", "Core\KopiLua\KopiLua.IOS.csproj", "{23997AB1-C4A3-49BA-A7B5-4C14F97C236B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {23997AB1-C4A3-49BA-A7B5-4C14F97C236B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23997AB1-C4A3-49BA-A7B5-4C14F97C236B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23997AB1-C4A3-49BA-A7B5-4C14F97C236B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23997AB1-C4A3-49BA-A7B5-4C14F97C236B}.Release|Any CPU.Build.0 = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7064B157-DD57-4828-94C5-CA149B25CB40}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = Core\LuaInterface\LuaInterface.IOS.csproj - EndGlobalSection -EndGlobal diff --git a/LuaInterface.sln b/LuaInterface.sln index 8105a81..3db78a7 100644 --- a/LuaInterface.sln +++ b/LuaInterface.sln @@ -1,19 +1,17 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{0E28CF40-4DFA-46FE-95BB-E90648DFE6F5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestLuaInterface", "Test\TestLuaInterface\TestLuaInterface.csproj", "{AEAB974E-4F69-4840-A2C4-7BC55F7C7C3E}" -EndProject +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.3 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{B13128D8-A4F3-4C53-A4C6-F2EA34F527BD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LuaRunner", "Applications\LuaRunner\LuaRunner.csproj", "{3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{B8664957-CB71-4F11-A4DB-59E7514BC5F3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KopiLua", "Core\KopiLua\KopiLua.csproj", "{E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KopiLua", "Core\KopiLua\KopiLua.csproj", "{4685AD89-1DC1-49CD-9026-A447C97D7D1C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LuaInterface", "Core\LuaInterface\LuaInterface.csproj", "{F55CABBB-4108-4A39-94E1-581FD46DC021}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LuaInterface", "Core\LuaInterface\LuaInterface.csproj", "{8546E2B4-2394-4435-AADC-5FF7ED7AE47E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LuaRunner", "Applications\LuaRunner\LuaRunner.csproj", "{088416A8-EFFF-413A-8579-088D054EBC1C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,28 +19,29 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5}.Release|Any CPU.Build.0 = Release|Any CPU - {AEAB974E-4F69-4840-A2C4-7BC55F7C7C3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AEAB974E-4F69-4840-A2C4-7BC55F7C7C3E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AEAB974E-4F69-4840-A2C4-7BC55F7C7C3E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AEAB974E-4F69-4840-A2C4-7BC55F7C7C3E}.Release|Any CPU.Build.0 = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8}.Release|Any CPU.Build.0 = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F55CABBB-4108-4A39-94E1-581FD46DC021}.Release|Any CPU.Build.0 = Release|Any CPU + {4685AD89-1DC1-49CD-9026-A447C97D7D1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4685AD89-1DC1-49CD-9026-A447C97D7D1C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4685AD89-1DC1-49CD-9026-A447C97D7D1C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4685AD89-1DC1-49CD-9026-A447C97D7D1C}.Release|Any CPU.Build.0 = Release|Any CPU + {8546E2B4-2394-4435-AADC-5FF7ED7AE47E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8546E2B4-2394-4435-AADC-5FF7ED7AE47E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8546E2B4-2394-4435-AADC-5FF7ED7AE47E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8546E2B4-2394-4435-AADC-5FF7ED7AE47E}.Release|Any CPU.Build.0 = Release|Any CPU + {088416A8-EFFF-413A-8579-088D054EBC1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {088416A8-EFFF-413A-8579-088D054EBC1C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {088416A8-EFFF-413A-8579-088D054EBC1C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {088416A8-EFFF-413A-8579-088D054EBC1C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {AEAB974E-4F69-4840-A2C4-7BC55F7C7C3E} = {0E28CF40-4DFA-46FE-95BB-E90648DFE6F5} - {3CE4CCB6-3465-43E3-B5ED-5FB9B70D20E5} = {B13128D8-A4F3-4C53-A4C6-F2EA34F527BD} - {E8DDBC21-EF74-4ABA-9C49-BFC702BE25D8} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} - {F55CABBB-4108-4A39-94E1-581FD46DC021} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} + {4685AD89-1DC1-49CD-9026-A447C97D7D1C} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} + {8546E2B4-2394-4435-AADC-5FF7ED7AE47E} = {B8664957-CB71-4F11-A4DB-59E7514BC5F3} + {088416A8-EFFF-413A-8579-088D054EBC1C} = {B13128D8-A4F3-4C53-A4C6-F2EA34F527BD} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6CF0E425-DA66-4ABF-8682-2EB10C5A49AF} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution StartupItem = Core\LuaInterface\LuaInterface.csproj diff --git a/Test/TestLuaInterface/Entity.cs b/Test/TestLuaInterface/Entity.cs deleted file mode 100644 index 5e68030..0000000 --- a/Test/TestLuaInterface/Entity.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This file is part of LuaInterface. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * 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.Text; -using System.Collections.Generic; - -namespace LuaInterface.Tests -{ - public class Entity - { - public event EventHandler Clicked; - - protected virtual void OnEntityClicked(EventArgs e) - { - var handler = Clicked; - - if(handler != null) - handler(this, e); // Use the () operator to raise the event. - } - - public Entity() - { - } - - public void Click() - { - OnEntityClicked(new EventArgs()); - } - } -} \ No newline at end of file diff --git a/Test/TestLuaInterface/Makefile.am b/Test/TestLuaInterface/Makefile.am deleted file mode 100644 index e05ed8a..0000000 --- a/Test/TestLuaInterface/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ - -EXTRA_DIST = - -#Warning: This is an automatically generated file, do not edit! -if ENABLE_DEBUG - SUBDIRS = . -endif -if ENABLE_RELEASE - SUBDIRS = . -endif - -# Projekt-specifikus makefile beszúrása -include TestLuaInterface.make \ No newline at end of file diff --git a/Test/TestLuaInterface/Properties/AssemblyInfo.cs b/Test/TestLuaInterface/Properties/AssemblyInfo.cs deleted file mode 100644 index 002045b..0000000 --- a/Test/TestLuaInterface/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of LuaInterface. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * 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.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using LuaInterface.Config; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("TestLuaInterface")] -[assembly: AssemblyDescription(Consts.LuaInterfaceDescription)] -[assembly: AssemblyConfiguration(Consts.LuaInterfaceConfiguration)] -[assembly: AssemblyCompany(Consts.LuaInterfaceCompany)] -[assembly: AssemblyProduct(Consts.LuaInterfaceProduct)] -[assembly: AssemblyCopyright(Consts.LuaInterfaceCopyright)] -[assembly: AssemblyTrademark(Consts.LuaInterfaceTrademark)] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(Consts.LuaInterfaceVersion)] -[assembly: AssemblyFileVersion(Consts.LuaInterfaceFileVersion)] \ No newline at end of file diff --git a/Test/TestLuaInterface/Readme.txt b/Test/TestLuaInterface/Readme.txt deleted file mode 100644 index 94c6e14..0000000 --- a/Test/TestLuaInterface/Readme.txt +++ /dev/null @@ -1 +0,0 @@ -Note that this project should be considered deprecated. While I'm leaving it here for the moment, it will likely be removed from the repository in future. \ No newline at end of file diff --git a/Test/TestLuaInterface/TestLua.cs b/Test/TestLuaInterface/TestLua.cs deleted file mode 100644 index 99a15e2..0000000 --- a/Test/TestLuaInterface/TestLua.cs +++ /dev/null @@ -1,427 +0,0 @@ -/* - * This file is part of LuaInterface. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * 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.Threading; -using System.Reflection; -using System.Diagnostics; -using LuaInterface; - -namespace LuaInterface.Tests -{ - /* - * Delegates used for testing Lua function -> delegate translation - */ - public delegate int TestDelegate1(int a, int b); - public delegate int TestDelegate2(int a, out int b); - public delegate void TestDelegate3(int a, ref int b); - public delegate TestClass TestDelegate4(int a, int b); - public delegate int TestDelegate5(TestClass a, TestClass b); - public delegate int TestDelegate6(int a, out TestClass b); - public delegate void TestDelegate7(int a, ref TestClass b); - - /* - * Interface used for testing Lua table -> interface translation - */ - public interface ITest - { - int intProp - { - get; - set; - } - TestClass refProp - { - get; - set; - } - int test1(int a,int b); - int test2(int a, out int b); - void test3(int a, ref int b); - TestClass test4(int a, int b); - int test5(TestClass a, TestClass b); - int test6(int a, out TestClass b); - void test7(int a, ref TestClass b); - } - - public interface IFoo1 - { - int foo(); - } - - public interface IFoo2 - { - int foo(); - } - - class MyClass - { - public int Func1() { return 1;} - } - - /// - /// Use to test threading - /// - class DoWorkClass - { - //private object _Lock = new object(); - - public void DoWork() - { - //lock (_Lock) - //{ - //simulate work by sleeping - //Console.WriteLine("Started to do work on thread: " + Thread.CurrentThread.ManagedThreadId); - Thread.Sleep(new Random().Next(0, 1000)); - //Console.WriteLine("Finished work on thread: " + Thread.CurrentThread.ManagedThreadId); - //} - } - } - - /// - /// test structure passing - /// - public struct TestStruct - { - public TestStruct(float val) - { - v = val; - } - - public float v; - - public float val - { - get { return v; } - set { v = value; } - } - } - - /// - /// Generic class with generic and non-generic methods - /// - /// - public class TestClassGeneric - { - private object _PassedValue; - - private bool _RegularMethodSuccess; - - public bool RegularMethodSuccess - { - get { return _RegularMethodSuccess; } - } - - private bool _GenericMethodSuccess; - - public bool GenericMethodSuccess - { - get { return _GenericMethodSuccess; } - } - - public void GenericMethod(T value) - { - _PassedValue = value; - _GenericMethodSuccess = true; - } - - public void RegularMethod() - { - _RegularMethodSuccess = true; - } - - /// - /// Returns true if the generic method was successfully passed a matching value - /// - /// - /// - public bool Validate(T value) - { - return value.Equals(_PassedValue); - } - } - - /// - /// Normal class containing a generic method - /// - public class TestClassWithGenericMethod - { - private object _PassedValue; - - public object PassedValue - { - get { return _PassedValue; } - } - - private bool _GenericMethodSuccess; - - public bool GenericMethodSuccess - { - get { return _GenericMethodSuccess; } - } - - public void GenericMethod(T value) - { - _PassedValue = value; - _GenericMethodSuccess = true; - } - - internal bool Validate(T value) - { - return value.Equals(_PassedValue); - } - } - - /* - * Sample class used in several test cases to check if - * Lua scripts are accessing objects correctly - */ - public class TestClass : IFoo1, IFoo2 - { - public int val; - private string strVal; - public TestClass() - { - val = 0; - } - public TestClass(int val) - { - this.val = val; - } - public TestClass(string val) - { - this.strVal = val; - } - public static TestClass makeFromString(String str) - { - return new TestClass(str); - } - - bool? nb2 = null; - - public bool? NullableBool - { - get { return nb2; } - set { nb2 = value; } - } - - - TestStruct s = new TestStruct(); - - public TestStruct Struct - { - get { return s; } - set { s = (TestStruct)value; } - } - - public int testval - { - get - { - return this.val; - } - set - { - this.val = value; - } - } - public int this[int index] - { - get { return 1; } - set { } - } - public int this[string index] - { - get { return 1; } - set { } - } - public int sum(int x, int y) - { - return x + y; - } - public void setVal(int newVal) - { - val = newVal; - } - public void setVal(string newVal) - { - strVal = newVal; - } - public int getVal() - { - return val; - } - public string getStrVal() - { - return strVal; - } - public int outVal(out int val) - { - val = 5; - return 3; - } - public int outVal(out int val, int val2) - { - val = 5; - return val2; - } - public int outVal(int val, ref int val2) - { - val2 = val + val2; - return val; - } - public int callDelegate1(TestDelegate1 del) - { - return del(2, 3); - } - public int callDelegate2(TestDelegate2 del) - { - int a = 3; - int b = del(2, out a); - return a + b; - } - public int callDelegate3(TestDelegate3 del) - { - int a = 3; - del(2, ref a); - //Console.WriteLine(a); - return a; - } - public int callDelegate4(TestDelegate4 del) - { - return del(2, 3).testval; - } - public int callDelegate5(TestDelegate5 del) - { - return del(new TestClass(2), new TestClass(3)); - } - public int callDelegate6(TestDelegate6 del) - { - TestClass test = new TestClass(); - int a = del(2, out test); - return a + test.testval; - } - public int callDelegate7(TestDelegate7 del) - { - TestClass test = new TestClass(3); - del(2, ref test); - return test.testval; - } - public int callInterface1(ITest itest) - { - return itest.test1(2, 3); - } - public int callInterface2(ITest itest) - { - int a = 3; - int b = itest.test2(2, out a); - return a + b; - } - public int callInterface3(ITest itest) - { - int a = 3; - itest.test3(2, ref a); - //Console.WriteLine(a); - return a; - } - public int callInterface4(ITest itest) - { - return itest.test4(2, 3).testval; - } - public int callInterface5(ITest itest) - { - return itest.test5(new TestClass(2), new TestClass(3)); - } - public int callInterface6(ITest itest) - { - TestClass test = new TestClass(); - int a = itest.test6(2, out test); - return a + test.testval; - } - public int callInterface7(ITest itest) - { - TestClass test = new TestClass(3); - itest.test7(2, ref test); - return test.testval; - } - public int callInterface8(ITest itest) - { - itest.intProp = 3; - return itest.intProp; - } - public int callInterface9(ITest itest) - { - itest.refProp = new TestClass(3); - return itest.refProp.testval; - } - public void exceptionMethod() - { - throw new Exception("exception test"); - } - public virtual int overridableMethod(int x, int y) - { - return x + y; - } - public static int callOverridable(TestClass test, int x, int y) - { - return test.overridableMethod(x, y); - } - int IFoo1.foo() - { - return 3; - } - public int foo() - { - return 5; - } - - private void _PrivateMethod() - { - Console.WriteLine("Private method called"); - } - - public void MethodOverload() - { - Console.WriteLine("Method with no params"); - } - - - public void MethodOverload(TestClass testClass) - { - Console.WriteLine("Method with testclass param"); - } - - public void MethodOverload(int i, int j, int k) - { - Console.WriteLine("Overload without out param: " + i + ", " + j + ", " + k); - } - - public void MethodOverload(int i, int j, out int k) - { - k = 5; - Console.WriteLine("Overload with out param" + i + ", " + j); - } - } -} \ No newline at end of file diff --git a/Test/TestLuaInterface/TestLuaInterface.cs b/Test/TestLuaInterface/TestLuaInterface.cs deleted file mode 100644 index d35679c..0000000 --- a/Test/TestLuaInterface/TestLuaInterface.cs +++ /dev/null @@ -1,1534 +0,0 @@ -/* - * This file is part of LuaInterface. - * - * Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz. - * Copyright (C) 2012 Megax - * - * 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.Text; -using System.Threading; -using System.Reflection; -using System.Collections.Generic; -using LuaInterface.Exceptions; - -namespace LuaInterface.Tests -{ - /* - * Automated test cases for LuaInterface - * - * Author: Fabio Mascarenhas - * Version: 1.0 - */ - public class TestLuaInterface - { - private Lua _Lua; - - /* - * Executed before each test case - */ - public void Init() - { - _Lua = new Lua(); - GC.Collect(); // runs GC to expose unprotected delegates - } - - /* - * Executed after each test case - */ - public void Destroy() - { - _Lua = null; - } - -#if false - // I've commented out the nunit based tests until they can run standalone - so that users don't need nunit to run TestLua - - /* - * Tests if DoString is correctly returning values - */ - [Test] - public void DoString() - { - object[] res=lua.DoString("a=2\nreturn a,3"); - //Console.WriteLine("a="+res[0]+", b="+res[1]); - Assertion.AssertEquals(res[0],2); - Assertion.AssertEquals(res[1],3); - } - /* - * Tests getting of global numeric variables - */ - [Test] - public void GetGlobalNumber() - { - lua.DoString("a=2"); - double num=lua.GetNumber("a"); - //Console.WriteLine("a="+num); - Assertion.AssertEquals(num,2); - } - /* - * Tests setting of global numeric variables - */ - [Test] - public void SetGlobalNumber() - { - lua.DoString("a=2"); - lua["a"]=3; - double num=lua.GetNumber("a"); - //Console.WriteLine("a="+num); - Assertion.AssertEquals(num,3); - } - /* - * Tests getting of numeric variables from tables - * by specifying variable path - */ - [Test] - public void GetNumberInTable() - { - lua.DoString("a={b={c=2}}"); - double num=lua.GetNumber("a.b.c"); - //Console.WriteLine("a.b.c="+num); - Assertion.AssertEquals(num,2); - } - /* - * Tests setting of numeric variables from tables - * by specifying variable path - */ - [Test] - public void SetNumberInTable() - { - lua.DoString("a={b={c=2}}"); - lua["a.b.c"]=3; - double num=lua.GetNumber("a.b.c"); - //Console.WriteLine("a.b.c="+num); - Assertion.AssertEquals(num,3); - } - /* - * Tests getting of global string variables - */ - [Test] - public void GetGlobalString() - { - lua.DoString("a=\"test\""); - string str=lua.GetString("a"); - //Console.WriteLine("a="+str); - Assertion.AssertEquals(str,"test"); - } - /* - * Tests setting of global string variables - */ - [Test] - public void SetGlobalString() - { - lua.DoString("a=\"test\""); - lua["a"]="new test"; - string str=lua.GetString("a"); - //Console.WriteLine("a="+str); - Assertion.AssertEquals(str,"new test"); - } - /* - * Tests getting of string variables from tables - * by specifying variable path - */ - [Test] - public void GetStringInTable() - { - lua.DoString("a={b={c=\"test\"}}"); - string str=lua.GetString("a.b.c"); - //Console.WriteLine("a.b.c="+str); - Assertion.AssertEquals(str,"test"); - } - /* - * Tests setting of string variables from tables - * by specifying variable path - */ - [Test] - public void SetStringInTable() - { - lua.DoString("a={b={c=\"test\"}}"); - lua["a.b.c"]="new test"; - string str=lua.GetString("a.b.c"); - //Console.WriteLine("a.b.c="+str); - Assertion.AssertEquals(str,"new test"); - } - /* - * Tests getting and setting of global table variables - */ - [Test] - public void GetAndSetTable() - { - lua.DoString("a={b={c=2}}\nb={c=3}"); - LuaTable tab=lua.GetTable("b"); - lua["a.b"]=tab; - double num=lua.GetNumber("a.b.c"); - //Console.WriteLine("a.b.c="+num); - Assertion.AssertEquals(num,3); - } - /* - * Tests getting of numeric field of a table - */ - [Test] - public void GetTableNumericField1() - { - lua.DoString("a={b={c=2}}"); - LuaTable tab=lua.GetTable("a.b"); - double num=(double)tab["c"]; - //Console.WriteLine("a.b.c="+num); - Assertion.AssertEquals(num,2); - } - /* - * Tests getting of numeric field of a table - * (the field is inside a subtable) - */ - [Test] - public void GetTableNumericField2() - { - lua.DoString("a={b={c=2}}"); - LuaTable tab=lua.GetTable("a"); - double num=(double)tab["b.c"]; - //Console.WriteLine("a.b.c="+num); - Assertion.AssertEquals(num,2); - } - /* - * Tests setting of numeric field of a table - */ - [Test] - public void SetTableNumericField1() - { - lua.DoString("a={b={c=2}}"); - LuaTable tab=lua.GetTable("a.b"); - tab["c"]=3; - double num=lua.GetNumber("a.b.c"); - //Console.WriteLine("a.b.c="+num); - Assertion.AssertEquals(num,3); - } - /* - * Tests setting of numeric field of a table - * (the field is inside a subtable) - */ - [Test] - public void SetTableNumericField2() - { - lua.DoString("a={b={c=2}}"); - LuaTable tab=lua.GetTable("a"); - tab["b.c"]=3; - double num=lua.GetNumber("a.b.c"); - //Console.WriteLine("a.b.c="+num); - Assertion.AssertEquals(num,3); - } - /* - * Tests getting of string field of a table - */ - [Test] - public void GetTableStringField1() - { - lua.DoString("a={b={c=\"test\"}}"); - LuaTable tab=lua.GetTable("a.b"); - string str=(string)tab["c"]; - //Console.WriteLine("a.b.c="+str); - Assertion.AssertEquals(str,"test"); - } - /* - * Tests getting of string field of a table - * (the field is inside a subtable) - */ - [Test] - public void GetTableStringField2() - { - lua.DoString("a={b={c=\"test\"}}"); - LuaTable tab=lua.GetTable("a"); - string str=(string)tab["b.c"]; - //Console.WriteLine("a.b.c="+str); - Assertion.AssertEquals(str,"test"); - } - /* - * Tests setting of string field of a table - */ - [Test] - public void SetTableStringField1() - { - lua.DoString("a={b={c=\"test\"}}"); - LuaTable tab=lua.GetTable("a.b"); - tab["c"]="new test"; - string str=lua.GetString("a.b.c"); - //Console.WriteLine("a.b.c="+str); - Assertion.AssertEquals(str,"new test"); - } - /* - * Tests setting of string field of a table - * (the field is inside a subtable) - */ - [Test] - public void SetTableStringField2() - { - lua.DoString("a={b={c=\"test\"}}"); - LuaTable tab=lua.GetTable("a"); - tab["b.c"]="new test"; - string str=lua.GetString("a.b.c"); - //Console.WriteLine("a.b.c="+str); - Assertion.AssertEquals(str,"new test"); - } - /* - * Tests calling of a global function with zero arguments - */ - [Test] - public void CallGlobalFunctionNoArgs() - { - lua.DoString("a=2\nfunction f()\na=3\nend"); - lua.GetFunction("f").Call(); - double num=lua.GetNumber("a"); - //Console.WriteLine("a="+num); - Assertion.AssertEquals(num,3); - } - /* - * Tests calling of a global function with one argument - */ - [Test] - public void CallGlobalFunctionOneArg() - { - lua.DoString("a=2\nfunction f(x)\na=a+x\nend"); - lua.GetFunction("f").Call(1); - double num=lua.GetNumber("a"); - //Console.WriteLine("a="+num); - Assertion.AssertEquals(num,3); - } - /* - * Tests calling of a global function with two arguments - */ - [Test] - public void CallGlobalFunctionTwoArgs() - { - lua.DoString("a=2\nfunction f(x,y)\na=x+y\nend"); - lua.GetFunction("f").Call(1,3); - double num=lua.GetNumber("a"); - //Console.WriteLine("a="+num); - Assertion.AssertEquals(num,4); - } - /* - * Tests calling of a global function that returns one value - */ - [Test] - public void CallGlobalFunctionOneReturn() - { - lua.DoString("function f(x)\nreturn x+2\nend"); - object[] ret=lua.GetFunction("f").Call(3); - //Console.WriteLine("ret="+ret[0]); - Assertion.AssertEquals(1,ret.Length); - Assertion.AssertEquals(5,ret[0]); - } - /* - * Tests calling of a global function that returns two values - */ - [Test] - public void CallGlobalFunctionTwoReturns() - { - lua.DoString("function f(x,y)\nreturn x,x+y\nend"); - object[] ret=lua.GetFunction("f").Call(3,2); - //Console.WriteLine("ret="+ret[0]+","+ret[1]); - Assertion.AssertEquals(2,ret.Length); - Assertion.AssertEquals(3,ret[0]); - Assertion.AssertEquals(5,ret[1]); - } - /* - * Tests calling of a function inside a table - */ - [Test] - public void CallTableFunctionTwoReturns() - { - lua.DoString("a={}\nfunction a.f(x,y)\nreturn x,x+y\nend"); - object[] ret=lua.GetFunction("a.f").Call(3,2); - //Console.WriteLine("ret="+ret[0]+","+ret[1]); - Assertion.AssertEquals(2,ret.Length); - Assertion.AssertEquals(3,ret[0]); - Assertion.AssertEquals(5,ret[1]); - } - /* - * Tests setting of a global variable to a CLR object value - */ - [Test] - public void SetGlobalObject() - { - TestClass t1=new TestClass(); - t1.testval=4; - lua["netobj"]=t1; - object o=lua["netobj"]; - TestClass t2=(TestClass)lua["netobj"]; - Assertion.AssertEquals(t2.testval,4); - Assertion.Assert(t1==t2); - } - /* - * Tests if CLR object is being correctly collected by Lua - */ - [Test] - public void GarbageCollection() - { - TestClass t1=new TestClass(); - t1.testval=4; - lua["netobj"]=t1; - TestClass t2=(TestClass)lua["netobj"]; - Assertion.Assert(lua.translator.objects[0]!=null); - lua.DoString("netobj=nil;collectgarbage();"); - Assertion.Assert(lua.translator.objects[0]==null); - } - /* - * Tests setting of a table field to a CLR object value - */ - [Test] - public void SetTableObjectField1() - { - lua.DoString("a={b={c=\"test\"}}"); - LuaTable tab=lua.GetTable("a.b"); - TestClass t1=new TestClass(); - t1.testval=4; - tab["c"]=t1; - TestClass t2=(TestClass)lua["a.b.c"]; - //Console.WriteLine("a.b.c="+t2.testval); - Assertion.AssertEquals(t2.testval,4); - Assertion.Assert(t1==t2); - } - /* - * Tests reading and writing of an object's field - */ - [Test] - public void AccessObjectField() - { - TestClass t1=new TestClass(); - t1.val=4; - lua["netobj"]=t1; - lua.DoString("var=netobj.val"); - double var=(double)lua["var"]; - //Console.WriteLine("value from Lua="+var); - Assertion.AssertEquals(4,var); - lua.DoString("netobj.val=3"); - Assertion.AssertEquals(3,t1.val); - //Console.WriteLine("new val (from Lua)="+t1.val); - } - /* - * Tests reading and writing of an object's non-indexed - * property - */ - [Test] - public void AccessObjectProperty() - { - TestClass t1=new TestClass(); - t1.testval=4; - lua["netobj"]=t1; - lua.DoString("var=netobj.testval"); - double var=(double)lua["var"]; - //Console.WriteLine("value from Lua="+var); - Assertion.AssertEquals(4,var); - lua.DoString("netobj.testval=3"); - Assertion.AssertEquals(3,t1.testval); - //Console.WriteLine("new val (from Lua)="+t1.testval); - } - /* - * Tests calling of an object's method with no overloads - */ - [Test] - public void CallObjectMethod() - { - TestClass t1=new TestClass(); - t1.testval=4; - lua["netobj"]=t1; - lua.DoString("netobj:setVal(3)"); - Assertion.AssertEquals(3,t1.testval); - //Console.WriteLine("new val(from C#)="+t1.testval); - lua.DoString("val=netobj:getVal()"); - int val=(int)lua.GetNumber("val"); - Assertion.AssertEquals(3,val); - //Console.WriteLine("new val(from Lua)="+val); - } - /* - * Tests calling of an object's method with overloading - */ - [Test] - public void CallObjectMethodByType() - { - TestClass t1=new TestClass(); - lua["netobj"]=t1; - lua.DoString("netobj:setVal('str')"); - Assertion.AssertEquals("str",t1.getStrVal()); - //Console.WriteLine("new val(from C#)="+t1.getStrVal()); - } - /* - * Tests calling of an object's method with no overloading - * and out parameters - */ - [Test] - public void CallObjectMethodOutParam() - { - TestClass t1=new TestClass(); - lua["netobj"]=t1; - lua.DoString("a,b=netobj:outVal()"); - int a=(int)lua.GetNumber("a"); - int b=(int)lua.GetNumber("b"); - Assertion.AssertEquals(3,a); - Assertion.AssertEquals(5,b); - //Console.WriteLine("function returned (from lua)="+a+","+b); - } - /* - * Tests calling of an object's method with overloading and - * out params - */ - [Test] - public void CallObjectMethodOverloadedOutParam() - { - TestClass t1=new TestClass(); - lua["netobj"]=t1; - lua.DoString("a,b=netobj:outVal(2)"); - int a=(int)lua.GetNumber("a"); - int b=(int)lua.GetNumber("b"); - Assertion.AssertEquals(2,a); - Assertion.AssertEquals(5,b); - //Console.WriteLine("function returned (from lua)="+a+","+b); - } - /* - * Tests calling of an object's method with ref params - */ - [Test] - public void CallObjectMethodByRefParam() - { - TestClass t1=new TestClass(); - lua["netobj"]=t1; - lua.DoString("a,b=netobj:outVal(2,3)"); - int a=(int)lua.GetNumber("a"); - int b=(int)lua.GetNumber("b"); - Assertion.AssertEquals(2,a); - Assertion.AssertEquals(5,b); - //Console.WriteLine("function returned (from lua)="+a+","+b); - } - /* - * Tests calling of two versions of an object's method that have - * the same name and signature but implement different interfaces - */ - [Test] - public void CallObjectMethodDistinctInterfaces() - { - TestClass t1=new TestClass(); - lua["netobj"]=t1; - lua.DoString("a=netobj:foo()"); - lua.DoString("b=netobj['LuaInterface.Tests.IFoo1.foo'](netobj)"); - int a=(int)lua.GetNumber("a"); - int b=(int)lua.GetNumber("b"); - Assertion.AssertEquals(5,a); - Assertion.AssertEquals(3,b); - //Console.WriteLine("function returned (from lua)="+a+","+b); - } - /* - * Tests instantiating an object with no-argument constructor - */ - [Test] - public void CreateNetObjectNoArgsCons() - { - lua.DoString("load_assembly(\"TestLua\")"); - lua.DoString("TestClass=import_type(\"LuaInterface.Tests.TestClass\")"); - lua.DoString("test=TestClass()"); - lua.DoString("test:setVal(3)"); - object[] res=lua.DoString("return test"); - TestClass test=(TestClass)res[0]; - //Console.WriteLine("returned: "+test.testval); - Assertion.AssertEquals(3,test.testval); - } - /* - * Tests instantiating an object with one-argument constructor - */ - [Test] - public void CreateNetObjectOneArgCons() - { - lua.DoString("load_assembly(\"TestLua\")"); - lua.DoString("TestClass=import_type(\"LuaInterface.Tests.TestClass\")"); - lua.DoString("test=TestClass(3)"); - object[] res=lua.DoString("return test"); - TestClass test=(TestClass)res[0]; - //Console.WriteLine("returned: "+test.testval); - Assertion.AssertEquals(3,test.testval); - } - /* - * Tests instantiating an object with overloaded constructor - */ - [Test] - public void CreateNetObjectOverloadedCons() - { - lua.DoString("load_assembly(\"TestLua\")"); - lua.DoString("TestClass=import_type(\"LuaInterface.Tests.TestClass\")"); - lua.DoString("test=TestClass('str')"); - object[] res=lua.DoString("return test"); - TestClass test=(TestClass)res[0]; - //Console.WriteLine("returned: "+test.getStrVal()); - Assertion.AssertEquals("str",test.getStrVal()); - } - /* - * Tests getting item of a CLR array - */ - [Test] - public void ReadArrayField() - { - string[] arr=new string[] { "str1", "str2", "str3" }; - lua["netobj"]=arr; - lua.DoString("val=netobj[1]"); - string val=lua.GetString("val"); - Assertion.AssertEquals("str2",val); - //Console.WriteLine("new val(from array to Lua)="+val); - } - /* - * Tests setting item of a CLR array - */ - [Test] - public void WriteArrayField() - { - string[] arr=new string[] { "str1", "str2", "str3" }; - lua["netobj"]=arr; - lua.DoString("netobj[1]='test'"); - Assertion.AssertEquals("test",arr[1]); - //Console.WriteLine("new val(from Lua to array)="+arr[1]); - } - /* - * Tests creating a new CLR array - */ - [Test] - public void CreateArray() - { - lua.DoString("load_assembly(\"TestLua\")"); - lua.DoString("TestClass=import_type(\"LuaInterface.Tests.TestClass\")"); - lua.DoString("arr=TestClass[3]"); - lua.DoString("for i=0,2 do arr[i]=TestClass(i+1) end"); - TestClass[] arr=(TestClass[])lua["arr"]; - Assertion.AssertEquals(arr[1].testval,2); - } - /* - * Tests passing a Lua function to a delegate - * with value-type arguments - */ - [Test] - public void LuaDelegateValueTypes() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("function func(x,y) return x+y; end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callDelegate1(func)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(5,a); - //Console.WriteLine("delegate returned: "+a); - } - /* - * Tests passing a Lua function to a delegate - * with value-type arguments and out params - */ - [Test] - public void LuaDelegateValueTypesOutParam() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("function func(x) return x,x*2; end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callDelegate2(func)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(6,a); - //Console.WriteLine("delegate returned: "+a); - } - /* - * Tests passing a Lua function to a delegate - * with value-type arguments and ref params - */ - [Test] - public void LuaDelegateValueTypesByRefParam() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("function func(x,y) return x+y; end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callDelegate3(func)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(5,a); - //Console.WriteLine("delegate returned: "+a); - } - /* - * Tests passing a Lua function to a delegate - * with value-type arguments that returns a reference type - */ - [Test] - public void LuaDelegateValueTypesReturnReferenceType() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("function func(x,y) return TestClass(x+y); end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callDelegate4(func)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(5,a); - //Console.WriteLine("delegate returned: "+a); - } - /* - * Tests passing a Lua function to a delegate - * with reference type arguments - */ - [Test] - public void LuaDelegateReferenceTypes() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("function func(x,y) return x.testval+y.testval; end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callDelegate5(func)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(5,a); - //Console.WriteLine("delegate returned: "+a); - } - /* - * Tests passing a Lua function to a delegate - * with reference type arguments and an out param - */ - [Test] - public void LuaDelegateReferenceTypesOutParam() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("function func(x) return x,TestClass(x*2); end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callDelegate6(func)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(6,a); - //Console.WriteLine("delegate returned: "+a); - } - /* - * Tests passing a Lua function to a delegate - * with reference type arguments and a ref param - */ - [Test] - public void LuaDelegateReferenceTypesByRefParam() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("function func(x,y) return TestClass(x+y.testval); end"); - lua.DoString("a=test:callDelegate7(func)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(5,a); - //Console.WriteLine("delegate returned: "+a); - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with value-type params - */ - [Test] - public void LuaInterfaceValueTypes() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("itest={}"); - lua.DoString("function itest:test1(x,y) return x+y; end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callInterface1(itest)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(5,a); - //Console.WriteLine("interface returned: "+a); - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with value-type params - * and an out param - */ - [Test] - public void LuaInterfaceValueTypesOutParam() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("itest={}"); - lua.DoString("function itest:test2(x) return x,x*2; end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callInterface2(itest)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(6,a); - //Console.WriteLine("interface returned: "+a); - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with value-type params - * and a ref param - */ - [Test] - public void LuaInterfaceValueTypesByRefParam() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("itest={}"); - lua.DoString("function itest:test3(x,y) return x+y; end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callInterface3(itest)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(5,a); - //Console.WriteLine("interface returned: "+a); - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with value-type params - * returning a reference type param - */ - [Test] - public void LuaInterfaceValueTypesReturnReferenceType() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("itest={}"); - lua.DoString("function itest:test4(x,y) return TestClass(x+y); end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callInterface4(itest)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(5,a); - //Console.WriteLine("interface returned: "+a); - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with reference type params - */ - [Test] - public void LuaInterfaceReferenceTypes() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("itest={}"); - lua.DoString("function itest:test5(x,y) return x.testval+y.testval; end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callInterface5(itest)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(5,a); - //Console.WriteLine("interface returned: "+a); - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with reference type params - * and an out param - */ - [Test] - public void LuaInterfaceReferenceTypesOutParam() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("itest={}"); - lua.DoString("function itest:test6(x) return x,TestClass(x*2); end"); - lua.DoString("test=TestClass()"); - lua.DoString("a=test:callInterface6(itest)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(6,a); - //Console.WriteLine("interface returned: "+a); - } - /* - * Tests passing a Lua table as an interface and - * calling one of its methods with reference type params - * and a ref param - */ - [Test] - public void LuaInterfaceReferenceTypesByRefParam() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("itest={}"); - lua.DoString("function itest:test7(x,y) return TestClass(x+y.testval); end"); - lua.DoString("a=test:callInterface7(itest)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(5,a); - //Console.WriteLine("interface returned: "+a); - } - /* - * Tests passing a Lua table as an interface and - * accessing one of its value-type properties - */ - [Test] - public void LuaInterfaceValueProperty() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("itest={}"); - lua.DoString("function itest:get_intProp() return itest.int_prop; end"); - lua.DoString("function itest:set_intProp(val) itest.int_prop=val; end"); - lua.DoString("a=test:callInterface8(itest)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(3,a); - //Console.WriteLine("interface returned: "+a); - } - /* - * Tests passing a Lua table as an interface and - * accessing one of its reference type properties - */ - [Test] - public void LuaInterfaceReferenceProperty() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("itest={}"); - lua.DoString("function itest:get_refProp() return TestClass(itest.int_prop); end"); - lua.DoString("function itest:set_refProp(val) itest.int_prop=val.testval; end"); - lua.DoString("a=test:callInterface9(itest)"); - int a=(int)lua.GetNumber("a"); - Assertion.AssertEquals(3,a); - //Console.WriteLine("interface returned: "+a); - } - - - /* - * Tests making an object from a Lua table and calling the base - * class version of one of the methods the table overrides. - */ - [Test] - public void LuaTableBaseMethod() - { - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test={}"); - lua.DoString("function test:overridableMethod(x,y) return 2*self.base:overridableMethod(x,y); end"); - lua.DoString("make_object(test,'LuaInterface.Tests.TestClass')"); - lua.DoString("a=TestClass:callOverridable(test,2,3)"); - int a=(int)lua.GetNumber("a"); - lua.DoString("free_object(test)"); - Assertion.AssertEquals(10,a); - //Console.WriteLine("interface returned: "+a); - } - /* - * Tests getting an object's method by its signature - * (from object) - */ - [Test] - public void GetMethodBySignatureFromObj() - { - lua.DoString("load_assembly('mscorlib')"); - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("setMethod=get_method_bysig(test,'setVal','System.String')"); - lua.DoString("setMethod('test')"); - TestClass test=(TestClass)lua["test"]; - Assertion.AssertEquals("test",test.getStrVal()); - //Console.WriteLine("interface returned: "+test.getStrVal()); - } - /* - * Tests getting an object's method by its signature - * (from type) - */ - [Test] - public void GetMethodBySignatureFromType() - { - lua.DoString("load_assembly('mscorlib')"); - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test=TestClass()"); - lua.DoString("setMethod=get_method_bysig(TestClass,'setVal','System.String')"); - lua.DoString("setMethod(test,'test')"); - TestClass test=(TestClass)lua["test"]; - Assertion.AssertEquals("test",test.getStrVal()); - //Console.WriteLine("interface returned: "+test.getStrVal()); - } - /* - * Tests getting a type's method by its signature - */ - [Test] - public void GetStaticMethodBySignature() - { - lua.DoString("load_assembly('mscorlib')"); - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("make_method=get_method_bysig(TestClass,'makeFromString','System.String')"); - lua.DoString("test=make_method('test')"); - TestClass test=(TestClass)lua["test"]; - Assertion.AssertEquals("test",test.getStrVal()); - //Console.WriteLine("interface returned: "+test.getStrVal()); - } - /* - * Tests getting an object's constructor by its signature - */ - [Test] - public void GetConstructorBySignature() - { - lua.DoString("load_assembly('mscorlib')"); - lua.DoString("load_assembly('TestLua')"); - lua.DoString("TestClass=import_type('LuaInterface.Tests.TestClass')"); - lua.DoString("test_cons=get_constructor_bysig(TestClass,'System.String')"); - lua.DoString("test=test_cons('test')"); - TestClass test=(TestClass)lua["test"]; - Assertion.AssertEquals("test",test.getStrVal()); - //Console.WriteLine("interface returned: "+test.getStrVal()); - } -#endif - void TestOk(bool flag) - { - if(flag) - Console.WriteLine("Test Passed."); - else - Console.WriteLine("Test Failed!!!!"); - } - - /* - * Tests capturing an exception - */ - public void ThrowException() - { - Init(); - _Lua.DoString("luanet.load_assembly('mscorlib')"); - _Lua.DoString("luanet.load_assembly('TestLua')"); - _Lua.DoString("TestClass=luanet.import_type('LuaInterface.Tests.TestClass')"); - _Lua.DoString("test=TestClass()"); - _Lua.DoString("err,errMsg=pcall(test.exceptionMethod,test)"); - bool err = (bool)_Lua["err"]; - Exception errMsg = (Exception)_Lua["errMsg"]; - TestOk(!err); - TestOk(errMsg.InnerException != null); - - if(errMsg.InnerException != null) - TestOk("exception test" == errMsg.InnerException.Message); - - //Console.WriteLine("interface returned: "+errMsg.ToString()); - Destroy(); - } - - /* - * Tests capturing an exception - */ - public void ThrowUncaughtException() - { - Init(); - _Lua.DoString("luanet.load_assembly('mscorlib')"); - _Lua.DoString("luanet.load_assembly('TestLua')"); - _Lua.DoString("TestClass=luanet.import_type('LuaInterface.Tests.TestClass')"); - _Lua.DoString("test=TestClass()"); - - try - { - _Lua.DoString("test:exceptionMethod()"); - Console.WriteLine("Test failed!!! Should have thrown an exception all the way out of Lua"); - } - catch (Exception) - { - Console.WriteLine("Uncaught exception success"); - } - - Destroy(); - } - - /* - * Tests nullable fields - */ - public void TestNullable() - { - Init(); - _Lua.DoString("luanet.load_assembly('mscorlib')"); - _Lua.DoString("luanet.load_assembly('TestLua')"); - _Lua.DoString("TestClass=luanet.import_type('LuaInterface.Tests.TestClass')"); - _Lua.DoString("test=TestClass()"); - _Lua.DoString("val=test.NullableBool"); - TestOk(((object)_Lua["val"]) == null); - _Lua.DoString("test.NullableBool = true"); - _Lua.DoString("val=test.NullableBool"); - TestOk(((bool)_Lua["val"]) == true); - Destroy(); - } - - /* - * Tests structure assignment - */ - public void TestStructs() - { - Init(); - _Lua.DoString("luanet.load_assembly('TestLua')"); - _Lua.DoString("TestClass=luanet.import_type('LuaInterface.Tests.TestClass')"); - _Lua.DoString("test=TestClass()"); - _Lua.DoString("TestStruct=luanet.import_type('LuaInterface.Tests.TestStruct')"); - _Lua.DoString("struct=TestStruct(2)"); - _Lua.DoString("test.Struct = struct"); - _Lua.DoString("val=test.Struct.val"); - TestOk(((double)_Lua["val"]) == 2.0); - Destroy(); - } - - public void TestMethodOverloads() - { - Init(); - _Lua.DoString("luanet.load_assembly('mscorlib')"); - _Lua.DoString("luanet.load_assembly('TestLua')"); - _Lua.DoString("TestClass=luanet.import_type('LuaInterface.Tests.TestClass')"); - _Lua.DoString("test=TestClass()"); - _Lua.DoString("test:MethodOverload()"); - _Lua.DoString("test:MethodOverload(test)"); - _Lua.DoString("test:MethodOverload(1,1,1)"); - _Lua.DoString("test:MethodOverload(2,2,i)\r\nprint(i)"); - } - - private void TestDispose() - { - GC.Collect(); - long startingMem = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64; - - for(int i = 0; i < 10000; i++) - { - using (Lua lua = new Lua()) - { - _Calc(lua, i); - } - } - - Console.WriteLine("Was using " + startingMem / 1024 / 1024 + "MB, now using: " + System.Diagnostics.Process.GetCurrentProcess().WorkingSet64 / 1024 / 1024 + "MB"); - } - - private void _Calc(Lua lua, int i) - { - lua.DoString( - "sqrt = math.sqrt;" + - "sqr = function(x) return math.pow(x,2); end;" + - "log = math.log;" + - "log10 = math.log10;" + - "exp = math.exp;" + - "sin = math.sin;" + - "cos = math.cos;" + - "tan = math.tan;" + - "abs = math.abs;" - ); - - lua.DoString("function calcVP(a,b) return a+b end"); - LuaFunction lf = lua.GetFunction("calcVP"); - /*Object[] ret = */lf.Call(i, 20); - } - - private void TestThreading() - { - Init(); - var doWork = new DoWorkClass(); - _Lua.RegisterFunction("dowork", doWork, typeof(DoWorkClass).GetMethod("DoWork")); - - bool failureDetected = false; - int completed = 0; - int iterations = 500; - - for(int i = 0; i < iterations; i++) - { - ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object o) - { - try - { - _Lua.DoString("dowork()"); - } - catch - { - failureDetected = true; - } - - completed++; - })); - } - - while(completed < iterations && !failureDetected) - Thread.Sleep(50); - - if(failureDetected) - Console.WriteLine("==Problem with threading!=="); - } - - private void TestPrivateMethod() - { - Init(); - _Lua.DoString("luanet.load_assembly('mscorlib')"); - _Lua.DoString("luanet.load_assembly('TestLua')"); - _Lua.DoString("TestClass=luanet.import_type('LuaInterface.Tests.TestClass')"); - _Lua.DoString("test=TestClass()"); - - try - { - _Lua.DoString("test:_PrivateMethod()"); - } - catch - { - Console.WriteLine("Test Passed"); - return; - } - - Console.WriteLine("Test Failed"); - } - - /* - * Tests functions - */ - public void TestFunctions() - { - Init(); - _Lua.DoString("luanet.load_assembly('mscorlib')"); - _Lua.DoString("luanet.load_assembly('TestLua')"); - _Lua.RegisterFunction("p", null, typeof(System.Console).GetMethod("WriteLine", new Type[] { typeof(String) })); - - /// Lua command that works (prints to console) - _Lua.DoString("p('Foo')"); - - /// Yet this works... - _Lua.DoString("string.gsub('some string', '(%w+)', function(s) p(s) end)"); - - /// This fails if you don't fix Lua5.1 lstrlib.c/add_value to treat LUA_TUSERDATA the same as LUA_FUNCTION - _Lua.DoString("string.gsub('some string', '(%w+)', p)"); - Destroy(); - } - - /* - * Tests making an object from a Lua table and calling one of - * methods the table overrides. - */ - public void LuaTableOverridedMethod() - { - Init(); - _Lua.DoString("luanet.load_assembly('TestLua')"); - _Lua.DoString("TestClass=luanet.import_type('LuaInterface.Tests.TestClass')"); - _Lua.DoString("test={}"); - _Lua.DoString("function test:overridableMethod(x,y) return x*y; end"); - _Lua.DoString("luanet.make_object(test,'LuaInterface.Tests.TestClass')"); - _Lua.DoString("a=TestClass.callOverridable(test,2,3)"); - int a = (int)_Lua.GetNumber("a"); - _Lua.DoString("luanet.free_object(test)"); - TestOk(6 == a); - //Console.WriteLine("interface returned: "+a); - } - - /* - * Tests making an object from a Lua table and calling a method - * the table does not override. - */ - public void LuaTableInheritedMethod() - { - Init(); - _Lua.DoString("luanet.load_assembly('TestLua')"); - _Lua.DoString("TestClass=luanet.import_type('LuaInterface.Tests.TestClass')"); - _Lua.DoString("test={}"); - _Lua.DoString("function test:overridableMethod(x,y) return x*y; end"); - _Lua.DoString("luanet.make_object(test,'LuaInterface.Tests.TestClass')"); - _Lua.DoString("test:setVal(3)"); - _Lua.DoString("a=test.testval"); - int a = (int)_Lua.GetNumber("a"); - _Lua.DoString("luanet.free_object(test)"); - TestOk(3 == a); - //Console.WriteLine("interface returned: "+a); - } - - /// - /// Basic multiply method which expects 2 floats - /// - /// - /// - /// - private float _TestException(float val, float val2) - { - return val * val2; - } - - public void TestEventException() - { - Init(); - - //Register a C# function - MethodInfo testException = this.GetType().GetMethod("_TestException", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance, null, new Type[] { typeof(float), typeof(float) }, null); - _Lua.RegisterFunction("Multiply", this, testException); - - //create the lua event handler code for the entity - //includes the bad code! - _Lua.DoString("function OnClick(sender, eventArgs)\r\n" + - "--Multiply expects 2 floats, but instead receives 2 strings\r\n" + - "Multiply(asd, we)\r\n" + - "end"); - - //create the lua event handler code for the entity - //good code - //lua.DoString("function OnClick(sender, eventArgs)\r\n" + - // "--Multiply expects 2 floats\r\n" + - // "Multiply(2, 50)\r\n" + - // "end"); - - //Create the event handler script - _Lua.DoString("function SubscribeEntity(e)\r\ne.Clicked:Add(OnClick)\r\nend"); - - //Create the entity object - var entity = new Entity(); - - //Register the entity object with the event handler inside lua - LuaFunction lf = _Lua.GetFunction("SubscribeEntity"); - lf.Call(new object[1] { entity }); - - try - { - //Cause the event to be fired - entity.Click(); - - Console.WriteLine("Test failed!!! Should have thrown an exception all the way out of Lua"); - } - catch (LuaException) - { - Console.WriteLine("Event exception success"); - } - } - - public void TestExceptionWithChunkOverload() - { - Init(); - - try - { - _Lua.DoString("thiswillthrowanerror", "MyChunk"); - } - catch(Exception e) - { - if (e.Message.StartsWith("[string \"MyChunk\"]")) - Console.WriteLine("Chunk overload passed"); - else - Console.WriteLine("Chunk overload failed"); - } - } - - public void TestGenerics() - { - Init(); - - //Im not sure support for generic classes is possible to implement, see: http://msdn.microsoft.com/en-us/library/system.reflection.methodinfo.containsgenericparameters.aspx - //specifically the line that says: "If the ContainsGenericParameters property returns true, the method cannot be invoked" - - //TestClassGeneric genericClass = new TestClassGeneric(); - - //_Lua.RegisterFunction("genericMethod", genericClass, typeof(TestClassGeneric<>).GetMethod("GenericMethod")); - //_Lua.RegisterFunction("regularMethod", genericClass, typeof(TestClassGeneric<>).GetMethod("RegularMethod")); - - //try - //{ - // _Lua.DoString("genericMethod('thestring')"); - //} - //catch { } - - //try - //{ - // _Lua.DoString("regularMethod()"); - //} - //catch { } - - //if (genericClass.GenericMethodSuccess && genericClass.RegularMethodSuccess && genericClass.Validate("thestring")) - // Console.WriteLine("Generic class passed"); - //else - // Console.WriteLine("Generic class failed"); - - bool passed = true; - TestClassWithGenericMethod classWithGenericMethod = new TestClassWithGenericMethod(); - - _Lua.RegisterFunction("genericMethod2", classWithGenericMethod, typeof(TestClassWithGenericMethod).GetMethod("GenericMethod")); - - try - { - _Lua.DoString("genericMethod2(100)"); - } - catch - { - - } - - if(!classWithGenericMethod.GenericMethodSuccess || !classWithGenericMethod.Validate(100)) //note the gotcha: numbers are all being passed to generic methods as doubles - passed = false; - - try - { - _Lua.DoString("luanet.load_assembly('TestLua')"); - _Lua.DoString("TestClass=luanet.import_type('LuaInterface.Tests.TestClass')"); - _Lua.DoString("test=TestClass(56)"); - _Lua.DoString("genericMethod2(test)"); - } - catch - { - - } - - if(!classWithGenericMethod.GenericMethodSuccess || (classWithGenericMethod.PassedValue as TestClass).val != 56) - passed = false; - - if(passed) - Console.WriteLine("Class with generic method passed"); - else - Console.WriteLine("Class with generic method failed"); - } - - public static int func(int x, int y) - { - return x + y; - } - public int funcInstance(int x, int y) - { - return x + y; - } - - public void RegisterFunctionStressTest() - { - LuaFunction fc = null; - const int Count = 200; // it seems to work with 41 - - Init(); - var t = new MyClass(); - - for(int i = 1; i < Count - 1; ++i) - fc = _Lua.RegisterFunction("func" + i, t, typeof(MyClass).GetMethod("Func1")); - - fc = _Lua.RegisterFunction("func" + (Count - 1), t, typeof(MyClass).GetMethod("Func1")); - _Lua.DoString("print(func1())"); - } - - /* - * Sample test script that shows some of the capabilities of - * LuaInterface - */ - public static void Main() - { - Console.WriteLine("Starting interpreter..."); - var l = new Lua(); - - // Pause so we can connect with the debugger - // Thread.Sleep(30000); - Console.WriteLine("Reading test.lua file..."); - l.DoFile("test.lua"); - double width = l.GetNumber("width"); - double height = l.GetNumber("height"); - string message = l.GetString("message"); - double color_r = l.GetNumber("color.r"); - double color_g = l.GetNumber("color.g"); - double color_b = l.GetNumber("color.b"); - Console.WriteLine("Printing values of global variables width, height and message..."); - Console.WriteLine("width: " + width); - Console.WriteLine("height: " + height); - Console.WriteLine("message: " + message); - Console.WriteLine("Printing values of the 'color' table's fields..."); - Console.WriteLine("color.r: " + color_r); - Console.WriteLine("color.g: " + color_g); - Console.WriteLine("color.b: " + color_b); - width = 150; - Console.WriteLine("Changing width's value and calling Lua function print to show it..."); - l["width"] = width; - l.GetFunction("print").Call(width); - message = "LuaNet Interface Test"; - Console.WriteLine("Changing message's value and calling Lua function print to show it..."); - l["message"] = message; - l.GetFunction("print").Call(message); - color_r = 30; - color_g = 10; - color_b = 200; - Console.WriteLine("Changing color's fields' values and calling Lua function print to show it..."); - l["color.r"] = color_r; - l["color.g"] = color_g; - l["color.b"] = color_b; - l.DoString("print(color.r,color.g,color.b)"); - Console.WriteLine("Printing values of the tree table's fields..."); - double leaf1 = l.GetNumber("tree.branch1.leaf1"); - string leaf2 = l.GetString("tree.branch1.leaf2"); - string leaf3 = l.GetString("tree.leaf3"); - Console.WriteLine("leaf1: " + leaf1); - Console.WriteLine("leaf2: " + leaf2); - Console.WriteLine("leaf3: " + leaf3); - leaf1 = 30; leaf2 = "new leaf2"; - Console.WriteLine("Changing tree's fields' values and calling Lua function print to show it..."); - l["tree.branch1.leaf1"] = leaf1; l["tree.branch1.leaf2"] = leaf2; - l.DoString("print(tree.branch1.leaf1,tree.branch1.leaf2)"); - Console.WriteLine("Returning values from Lua with 'return'..."); - object[] vals = l.DoString("return 2,3"); - Console.WriteLine("Returned: " + vals[0] + " and " + vals[1]); - Console.WriteLine("Calling a Lua function that returns multiple values..."); - object[] vals1 = l.GetFunction("func").Call(2, 3); - Console.WriteLine("Returned: " + vals1[0] + " and " + vals1[1]); - Console.WriteLine("Creating a table and filling it from C#..."); - l.NewTable("tab"); - l.NewTable("tab.tab"); - l["tab.a"] = "a!"; - l["tab.b"] = 5.5; - l["tab.tab.c"] = 6.5; - l.DoString("print(tab.a,tab.b,tab.tab.c)"); - Console.WriteLine("Setting a table as another table's field..."); - l["tab.a"] = l["tab.tab"]; - l.DoString("print(tab.a.c)"); - Console.WriteLine("Registering a C# static method and calling it from Lua..."); - - // Pause so we can connect with the debugger - // Thread.Sleep(30000); - l.RegisterFunction("func1", null, typeof(TestLuaInterface).GetMethod("func")); - vals1 = l.GetFunction("func1").Call(2, 3); - Console.WriteLine("Returned: " + vals1[0]); - TestLuaInterface obj = new TestLuaInterface(); - Console.WriteLine("Registering a C# instance method and calling it from Lua..."); - l.RegisterFunction("func2", obj, typeof(TestLuaInterface).GetMethod("funcInstance")); - vals1 = l.GetFunction("func2").Call(2, 3); - Console.WriteLine("Returned: " + vals1[0]); - - Console.WriteLine("Testing throwing an exception..."); - obj.ThrowUncaughtException(); - - Console.WriteLine("Testing catching an exception..."); - obj.ThrowException(); - - Console.WriteLine("Testing inheriting a method from Lua..."); - obj.LuaTableInheritedMethod(); - - Console.WriteLine("Testing overriding a C# method with Lua..."); - obj.LuaTableOverridedMethod(); - - Console.WriteLine("Stress test RegisterFunction (based on a reported bug).."); - obj.RegisterFunctionStressTest(); - - Console.WriteLine("Test structures..."); - obj.TestStructs(); - - Console.WriteLine("Test Nullable types..."); - obj.TestNullable(); - - Console.WriteLine("Test functions..."); - obj.TestFunctions(); - - Console.WriteLine("Test method overloads..."); - obj.TestMethodOverloads(); - - Console.WriteLine("Test accessing private method..."); - obj.TestPrivateMethod(); - - Console.WriteLine("Test event exceptions..."); - obj.TestEventException(); - - Console.WriteLine("Test chunk overload exception..."); - obj.TestExceptionWithChunkOverload(); - - Console.WriteLine("Test generics..."); - obj.TestGenerics(); - - Console.WriteLine("Test threading..."); - obj.TestThreading(); - - Console.WriteLine("Test memory leakage..."); - obj.TestDispose(); - - Console.WriteLine("Press enter to exit."); - Console.ReadLine(); - } - } -} \ No newline at end of file diff --git a/Test/TestLuaInterface/TestLuaInterface.csproj b/Test/TestLuaInterface/TestLuaInterface.csproj deleted file mode 100644 index 2150124..0000000 --- a/Test/TestLuaInterface/TestLuaInterface.csproj +++ /dev/null @@ -1,82 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AEAB974E-4F69-4840-A2C4-7BC55F7C7C3E} - Exe - Properties - LuaInterface.Tests - TestLua - 2.x - - - true - full - false - ..\..\Run\Debug - DEBUG - prompt - 4 - AllRules.ruleset - - - none - true - ..\..\Run\Release - RELEASE - prompt - 4 - AllRules.ruleset - - - - - - - - - - - - - - - {F55CABBB-4108-4A39-94E1-581FD46DC021} - LuaInterface - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - diff --git a/Test/TestLuaInterface/TestLuaInterface.make b/Test/TestLuaInterface/TestLuaInterface.make deleted file mode 100644 index 7a6c710..0000000 --- a/Test/TestLuaInterface/TestLuaInterface.make +++ /dev/null @@ -1,103 +0,0 @@ - - -# Warning: This is an automatically generated file, do not edit! - -if ENABLE_DEBUG -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" -ASSEMBLY = ../../Run/Debug/TestLua.exe -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../../Run/Debug/LuaInterface.dll -BUILD_DIR = ../../Run/Debug - -TESTLUA_EXE_MDB_SOURCE=../../Run/Debug/TestLua.exe.mdb -TESTLUA_EXE_MDB=$(BUILD_DIR)/TestLua.exe.mdb -LUAINTERFACE_DLL_SOURCE=../../Run/Debug/LuaInterface.dll -LUAINTERFACE_DLL_MDB_SOURCE=../../Run/Debug/LuaInterface.dll.mdb -LUAINTERFACE_DLL_MDB=$(BUILD_DIR)/LuaInterface.dll.mdb -KOPILUA_DLL_SOURCE=../../Run/Debug/KopiLua.dll -KOPILUA_DLL_MDB_SOURCE=../../Run/Debug/KopiLua.dll.mdb -KOPILUA_DLL_MDB=$(BUILD_DIR)/KopiLua.dll.mdb - -endif - -if ENABLE_RELEASE -ASSEMBLY_COMPILER_COMMAND = dmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ "-define:RELEASE" -ASSEMBLY = ../../Run/Release/TestLua.exe -ASSEMBLY_MDB = -COMPILE_TARGET = exe -PROJECT_REFERENCES = \ - ../../Run/Release/LuaInterface.dll -BUILD_DIR = ../../Run/Release - -TESTLUA_EXE_MDB= -LUAINTERFACE_DLL_SOURCE=../../Run/Release/LuaInterface.dll -LUAINTERFACE_DLL_MDB= -KOPILUA_DLL_SOURCE=../../Run/Release/KopiLua.dll -KOPILUA_DLL_MDB= - -endif - -AL=al -SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll - -PROGRAMFILES = \ - $(TESTLUA_EXE_MDB) \ - $(LUAINTERFACE_DLL) \ - $(LUAINTERFACE_DLL_MDB) \ - $(KOPILUA_DLL) \ - $(KOPILUA_DLL_MDB) - -BINARIES = \ - $(TESTLUAINTERFACE) - - -RESGEN=resgen2 - -all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) - -FILES = \ - Entity.cs \ - TestLua.cs \ - TestLuaInterface.cs \ - Properties/AssemblyInfo.cs - -DATA_FILES = - -RESOURCES = - -EXTRAS = \ - Properties \ - Readme.txt \ - testluainterface.in - -REFERENCES = \ - System \ - System.Data \ - System.Xml - -DLL_REFERENCES = - -CLEANFILES = $(PROGRAMFILES) $(BINARIES) - -include $(top_srcdir)/Makefile.include - -LUAINTERFACE_DLL = $(BUILD_DIR)/LuaInterface.dll -KOPILUA_DLL = $(BUILD_DIR)/KopiLua.dll -TESTLUAINTERFACE = $(BUILD_DIR)/testluainterface - -$(eval $(call emit-deploy-wrapper,TESTLUAINTERFACE,testluainterface,x)) - - -$(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) diff --git a/Test/TestLuaInterface/testluainterface.in b/Test/TestLuaInterface/testluainterface.in deleted file mode 100644 index 5b8286c..0000000 --- a/Test/TestLuaInterface/testluainterface.in +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec mono "@expanded_libdir@/@PACKAGE@/TestLua.exe" "$@"