[Acmcontester-developers] SF.net SVN: acmcontester:[326]
ACMServer/trunk/sharp tester/SourceTest 2.0
From: <Or...@us...> - 2008-08-17 20:30:38
|
Revision: 326 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=326&view=rev Author: Oracle_ Date: 2008-08-17 20:30:41 +0000 (Sun, 17 Aug 2008) Log Message: ----------- Added new version Added Paths: ----------- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/ ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Load.csproj ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Properties/ ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Properties/AssemblyInfo.cs ACMServer/trunk/sharp tester/SourceTest 2.0/Main/ ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Main.csproj ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Properties/ ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Properties/AssemblyInfo.cs ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/ ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Plugin.csproj ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/PluginClass.cs ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Properties/ ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Properties/AssemblyInfo.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/DLLTester.csproj ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Properties/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Properties/AssemblyInfo.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/AllowedFunc.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/InData.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/TesterInData.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7.bat ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/DCC32.exe here.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/dcc32.cfg ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/includeD7/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/includeD7/includes here.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/rlink32.dll here.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test1/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test1/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test1/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test10/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test10/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test10/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test11/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test11/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test11/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test12/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test12/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test12/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test13/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test13/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test13/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test14/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test14/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test14/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test15/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test15/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test15/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test2/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test2/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test2/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test3/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test3/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test3/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test4/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test4/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test4/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test5/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test5/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test5/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test6/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test6/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test6/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test7/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test7/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test7/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test8/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test8/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test8/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test9/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test9/in.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test9/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/scriptExample.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/source.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err1.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err10.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err11.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err12.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err13.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err14.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err15.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err2.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err3.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err4.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err5.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err6.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err7.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err8.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err9.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out1.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out10.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out11.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out12.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out13.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out14.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out15.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out2.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out3.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out4.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out5.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out6.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out7.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out8.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out9.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.exe ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0.sln ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0.suo ACMServer/trunk/sharp tester/SourceTest 2.0/Test/ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/AdvAPI32.lib here.txt ACMServer/trunk/sharp tester/SourceTest 2.0/Test/AssemblyInfo.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/DbgHelp.lib here.txt ACMServer/trunk/sharp tester/SourceTest 2.0/Test/NetAPI32.lib here.txt ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj ACMServer/trunk/sharp tester/SourceTest 2.0/Test/User32.lib here.txt ACMServer/trunk/sharp tester/SourceTest 2.0/Test/UserEnv.lib here.txt ACMServer/trunk/sharp tester/SourceTest 2.0/VirtualPlugin/ ACMServer/trunk/sharp tester/SourceTest 2.0/VirtualPlugin/Properties/ ACMServer/trunk/sharp tester/SourceTest 2.0/VirtualPlugin/Properties/AssemblyInfo.cs ACMServer/trunk/sharp tester/SourceTest 2.0/VirtualPlugin/VirtPlugin.cs ACMServer/trunk/sharp tester/SourceTest 2.0/VirtualPlugin/VirtualPlugin.csproj Added: ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Load.csproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Load.csproj (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Load.csproj 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{77676781-AE80-47DB-9A4D-204B97BE955D}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Load</RootNamespace> + <AssemblyName>Load</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="LoaderClass.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\VirtualPlugin\VirtualPlugin.csproj"> + <Project>{6AC363DA-BBBF-4809-8D42-A5391A918630}</Project> + <Name>VirtualPlugin</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,219 @@ +using System; +using System.Text; +using System.IO; +using VirtualPlugin; +using System.Reflection; + +namespace Load +{ + public class DataLoader + { + public string path; + public int CodeLimit=65536; + public int CompilationTimeLimit=10000; + public int MemoryLimit=67108864; + public int OutputLimit=20000000; + public int RealTimeLimit=20000; + public int TimeLimit=1000; + public int MaxThreads=2; + public int PerTestCount=2; + public string InputName="in.txt"; + public string OutputName="out.txt"; + public string PointFileName="points.txt"; + public string TestFolderName="test*"; + public string Checker=""; + public string CheckPlugin = ""; + + public DataLoader(string Path) + { + path=Path; + } + + public bool Load() + { + if (!File.Exists(path)) + return false; + StreamReader f = File.OpenText(path); + while (!f.EndOfStream) + { + string[] param=f.ReadLine().Split(' '); + switch (param[0]) + { + case "CodeLimit:": CodeLimit = Convert.ToInt32(param[1]); break; + case "CompilationTimeLimit:": CompilationTimeLimit = Convert.ToInt32(param[1]); break; + case "MemoryLimit:": MemoryLimit = Convert.ToInt32(param[1]); break; + case "OutputLimit:": OutputLimit = Convert.ToInt32(param[1]); break; + case "RealTimeLimit:": RealTimeLimit = Convert.ToInt32(param[1]); break; + case "TimeLimit:": TimeLimit = Convert.ToInt32(param[1]); break; + case "MaxThreads:": MaxThreads = Convert.ToInt32(param[1]); break; + case "PerTestCount:": PerTestCount = Convert.ToInt32(param[1]); break; + case "InputName:": InputName = param[1]; break; + case "OutputName:": OutputName = param[1]; break; + case "PointFileName:": PointFileName = param[1]; break; + case "TestFolderName:": TestFolderName = param[1]; break; + case "Checker:": Checker = param[1]; break; + case "CheckPlugin:": CheckPlugin = param[1]; break; + } + } + return true; + } + } + + public class Test + { + public string input; + public string output; + public int points; + + public string InPath; + public string OutPath; + public string PointPath; + + public Test() + { + + } + + public void Load(string inname,string outname,string pointname) + { + InPath = inname; + OutPath = outname; + PointPath = pointname; + if (File.Exists(inname)) + input = File.OpenText(inname).ReadToEnd(); + else + input = ""; + + if (File.Exists(outname)) + output = File.OpenText(outname).ReadToEnd(); + else + output = ""; + + if (File.Exists(pointname)) + points = Convert.ToInt32(File.OpenText(pointname).ReadToEnd()); + else + points = 1; + } + } + + public class TestLoader + { + private string MaskToString(string mask, int numb) + { + int star; + if ((star=mask.IndexOf('*')) == -1) + return mask; + int cnt=0; + while (star < mask.Length && mask[star] == '*') + { + star++; + cnt++; + } + string NS = numb.ToString(); + while (NS.Length < cnt) NS = '0' + NS; + return mask.Replace(mask.Substring(star - cnt, cnt), NS); ; + } + + public string InName; + public string OutName; + public string PointName; + public string FolderName; + public string ProblemPath; + public Test[] tests; + + public TestLoader(string _InName, string _OutName, string _PointName, string _FolderName, string _ProblemPath) + { + InName = _InName; + OutName = _OutName; + PointName = _PointName; + FolderName = _FolderName; + ProblemPath = _ProblemPath; + } + + public void Load() + { + int cnt = 0; + while (true) + { + string curInPath = ProblemPath + MaskToString(FolderName,cnt+1)+"\\"+MaskToString(InName,cnt+1); + string curOutPath = ProblemPath + MaskToString(FolderName, cnt+1) + "\\" + MaskToString(OutName, cnt+1); + string curPointPath = ProblemPath + MaskToString(FolderName, cnt+1) + "\\" + MaskToString(PointName, cnt+1); + if (File.Exists(curInPath)||File.Exists(curOutPath)||File.Exists(curPointPath)) + cnt++; + else + break; + } + tests = new Test[cnt]; + for (int i = 1; i <= cnt; i++) + { + string curInPath = ProblemPath + MaskToString(FolderName, i) + "\\" + MaskToString(InName, i); + string curOutPath = ProblemPath + MaskToString(FolderName, i) + "\\" + MaskToString(OutName, i); + string curPointPath = ProblemPath + MaskToString(FolderName, i) + "\\" + MaskToString(PointName, i); + tests[i - 1] = new Test(); + tests[i - 1].Load(curInPath, curOutPath, curPointPath); + } + } + } + + public class PluginLoader + { + public VirtPlugin p; + public string filename; + + public PluginLoader(string FileName) + { + filename = FileName; + } + + public bool Load() + { + if (File.Exists(filename) == false) + { + return false; + } + + Assembly assembly; + try + { + assembly = Assembly.LoadFrom(filename); + } + catch + { + return false; + } + if (assembly != null) + { + Type[] types = assembly.GetExportedTypes(); + foreach (Type t in types) + { + try + { + if (t.IsClass && !t.IsAbstract) + if (t.GetInterface(typeof(VirtPlugin).FullName) != null || t.IsSubclassOf(typeof(VirtPlugin))) + { + p = (VirtPlugin)Activator.CreateInstance(t); + return true; + } + } + catch (System.Reflection.TargetInvocationException) + { + + } + catch (System.MissingMethodException) + { + + } + catch (System.InvalidCastException) + { + + } + catch + { + + } + } + } + return false; + } + } +} Added: ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Properties/AssemblyInfo.cs 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,36 @@ +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("Load")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("Load")] +[assembly: AssemblyCopyright("Copyright © Home 2008")] +[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("91b77ead-03cd-40a1-b86f-62ec1cb2fe98")] + +// 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")] Added: ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Main.csproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Main.csproj (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Main.csproj 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{A9377496-295B-4271-A078-C7A925CC2CD8}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Main</RootNamespace> + <AssemblyName>Main</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="TestEnvClass.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Load\Load.csproj"> + <Project>{77676781-AE80-47DB-9A4D-204B97BE955D}</Project> + <Name>Load</Name> + </ProjectReference> + <ProjectReference Include="..\Test\Test.vcproj"> + <Project>{036108C1-B126-4DC6-95D6-4D6543C8BFF7}</Project> + <Name>Test</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Properties/AssemblyInfo.cs 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,36 @@ +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("Main")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("Main")] +[assembly: AssemblyCopyright("Copyright © Home 2008")] +[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("42a47bfc-a4ee-4434-a87d-cb1708d36b1b")] + +// 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")] Added: ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,40 @@ +using System; +using System.IO; +using Test; +using Load; + +namespace Main +{ + public class TestEnv + { + public string ProblemPath; + public string TempPath; + public string CompPath; + public string Source; + public Compiler comp; + public Runner run; + + public TestEnv(string Source,string CompPath,string TempPath,string ProblemPath) + { + this.Source = Source; + this.TempPath = Path.GetFullPath(TempPath); + this.CompPath = Path.GetFullPath(CompPath); + this.ProblemPath = Path.GetFullPath(ProblemPath); + } + + public void Compile() + { + DataLoader dat = new DataLoader(ProblemPath + "ProblemData.txt"); + dat.Load(); + string[] InData=System.IO.File.ReadAllLines("TesterInData.txt"); + comp=new Compiler(CompPath,Source,TempPath,dat.CompilationTimeLimit,Convert.ToInt32(InData[0])); + comp.Compile(); + } + + public void RunAllTests(SecureType SecType) + { + run = new Runner(SecType,ProblemPath,comp.ExeFile,TempPath,comp.CONST_SLEEP); + run.RunTests(); + } + } +} Added: ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Plugin.csproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Plugin.csproj (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Plugin.csproj 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{C43666B0-F0AF-4122-A0A8-8C2ED951BC4E}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Plugin</RootNamespace> + <AssemblyName>Plugin</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="PluginClass.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\VirtualPlugin\VirtualPlugin.csproj"> + <Project>{6AC363DA-BBBF-4809-8D42-A5391A918630}</Project> + <Name>VirtualPlugin</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/PluginClass.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/PluginClass.cs (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/PluginClass.cs 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Text; +using VirtualPlugin; + +namespace Plugin +{ + public class Plugin:VirtPlugin + { + public override bool TimeLimit(int UsedTime, int TL, ref string Details) + { + Details = ""; + return UsedTime > TL; + } + + public override bool MemoryLimit(int UsedMemory, int ML, ref string Details) + { + Details = ""; + return UsedMemory > ML; + } + + public override bool OutputLimit(int OutputSize, int OL, ref string Details) + { + Details = ""; + return OutputSize > OL; + } + + public override bool RealTimeLimit(int UsedRealTime, int RTL, ref string Details) + { + Details = ""; + return UsedRealTime > RTL; + } + + public override bool CodeLimit(string source, int CL, ref string Details) + { + Details = ""; + return source.Length > CL; + } + } +} Added: ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Properties/AssemblyInfo.cs 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,36 @@ +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("Plugin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("Plugin")] +[assembly: AssemblyCopyright("Copyright © Home 2008")] +[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("515fab2a-b9c0-4bfe-aae4-cefe7d7cb77e")] + +// 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")] Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/DLLTester.csproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/DLLTester.csproj (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/DLLTester.csproj 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{7FA90C26-FD23-4558-A3EE-DBD74A3311F8}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>SourceTest_2._0</RootNamespace> + <AssemblyName>SourceTest 2.0</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Xml.Linq"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data.DataSetExtensions"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Main\Main.csproj"> + <Project>{A9377496-295B-4271-A078-C7A925CC2CD8}</Project> + <Name>Main</Name> + </ProjectReference> + <ProjectReference Include="..\Test\Test.vcproj"> + <Project>{036108C1-B126-4DC6-95D6-4D6543C8BFF7}</Project> + <Name>Test</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using Main; +using Test; + +namespace SourceTest +{ + class Program + { + static void Main(string[] args) + { + string[] data=File.ReadAllLines("InData.txt"); + TestEnv test = new TestEnv(File.ReadAllText("source.txt"),data[0],data[1],data[2]); + test.Compile(); + Console.WriteLine("Compile result: {0}, details: {1}, usedtime:{2}",test.comp.Result.ToString(),test.comp.Details,test.comp.UsedTime); + Console.WriteLine("Comp Output: {0}", test.comp.CompilerOutput); + if (test.comp.Result == Test.CompRes.OK) + { + test.RunAllTests(SecureType.Double); + + for (int i = 0; i < test.run.results.Length; i++) + { + Console.WriteLine("Test #{0} result: {1}, details: {2}, usedtime:{3}, usedRealTime: {4}, usedmemory: {5}", i + 1, + test.run.results[i].res, test.run.results[i].Details, test.run.results[i].UsedTime, test.run.results[i].UsedRealTime, test.run.results[i].UsedMemory); + } + } + Console.ReadKey(); + } + } +} Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Properties/AssemblyInfo.cs 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,36 @@ +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("SourceTest 2.0")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("SourceTest 2.0")] +[assembly: AssemblyCopyright("Copyright © Home 2008")] +[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("aeb8bd6d-2d70-4d0f-a8b3-5e75bb3bf7f3")] + +// 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")] Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/AllowedFunc.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/AllowedFunc.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/AllowedFunc.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,57 @@ +kernel32.dll DeleteCriticalSection +kernel32.dll LeaveCriticalSection +kernel32.dll EnterCriticalSection +kernel32.dll InitializeCriticalSection +kernel32.dll VirtualFree +kernel32.dll VirtualAlloc +kernel32.dll LocalFree +kernel32.dll LocalAlloc +kernel32.dll GetVersion +kernel32.dll GetCurrentThreadId +kernel32.dll GetThreadLocale +kernel32.dll GetStartupInfoA +kernel32.dll GetLocaleInfoA +kernel32.dll GetCommandLineA +kernel32.dll FreeLibrary +kernel32.dll ExitProcess +kernel32.dll WriteFile +kernel32.dll UnhandledExceptionFilter +kernel32.dll RtlUnwind +kernel32.dll RaiseException +kernel32.dll GetStdHandle +user32.dll GetKeyboardType +user32.dll MessageBoxA +advapi32.dll RegQueryValueExA +advapi32.dll RegOpenKeyExA +advapi32.dll RegCloseKey +kernel32.dll TlsSetValue +kernel32.dll TlsGetValue +kernel32.dll GetModuleHandleA +kernel32.dll WideCharToMultiByte +kernel32.dll lstrlenA +kernel32.dll lstrcpynA +kernel32.dll LoadLibraryExA +kernel32.dll GetProcAddress +kernel32.dll GetModuleFileNameA +kernel32.dll FindFirstFileA +kernel32.dll FindClose +user32.dll LoadStringA +user32.dll CharNextA +oleaut32.dll SysFreeString +kernel32.dll VirtualQuery +kernel32.dll GetVersionExA +kernel32.dll GetStringTypeExA +kernel32.dll GetDiskFreeSpaceA +kernel32.dll GetCPInfo +kernel32.dll GetACP +kernel32.dll EnumCalendarInfoA +user32.dll GetSystemMetrics +user32.dll CharToOemA +kernel32.dll GetLastError +kernel32.dll SetFilePointer +kernel32.dll SetEndOfFile +kernel32.dll ReadFile +kernel32.dll GetFileSize +kernel32.dll GetFileType +kernel32.dll CreateFileA +kernel32.dll CloseHandle \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/InData.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/InData.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/InData.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,3 @@ +Compiler\D7.bat +Temp\ +Problem\ \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/TesterInData.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/TesterInData.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/TesterInData.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,3 @@ +100 +TestingUser +USER12345 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7.bat =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7.bat (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7.bat 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +DCC32.EXE -CC %1 -E%2 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/dcc32.cfg =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/dcc32.cfg (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/dcc32.cfg 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +-u"includeD7" Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1,9 @@ +CodeLimit: 1024 +CompilationTimeLimit: 10000 +MemoryLimit: 21000000 +OutputLimit: 1024 +RealTimeLimit: 20000 +TimeLimit: 1000 +MaxThreads: 1 +Checker: scriptExample.txt +CheckPlugin: Plugin.dll \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test1/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test1/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test1/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1 1 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test1/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test1/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test1/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +2 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test10/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test10/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test10/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test10/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test10/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test10/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test11/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test11/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test11/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test11/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test11/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test11/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test12/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test12/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test12/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test12/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test12/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test12/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test13/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test13/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test13/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test13/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test13/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test13/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test14/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test14/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test14/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test14/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test14/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test14/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test15/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test15/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test15/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test15/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test15/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test15/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test2/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test2/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test2/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test2/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test2/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test2/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test3/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test3/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test3/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test3/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test3/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test3/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test4/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test4/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test4/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test4/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test4/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test4/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test5/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test5/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test5/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test5/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test5/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test5/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test6/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test6/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test6/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test6/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test6/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test6/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test7/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test7/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test7/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test7/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test7/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test7/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test8/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test8/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test8/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test8/out.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test8/out.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test8/out.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1349 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test9/in.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test9/in.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/test9/in.txt 2008-08-17 20:30:41 UTC (rev 326) @@ -0,0 +1 @@ +1334 15 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/D... [truncated message content] |
[Acmcontester-developers] SF.net SVN: acmcontester:[330]
ACMServer/trunk/sharp tester/SourceTest 2.0
From: <Or...@us...> - 2008-08-17 22:24:35
|
Revision: 330 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=330&view=rev Author: Oracle_ Date: 2008-08-17 22:24:45 +0000 (Sun, 17 Aug 2008) Log Message: ----------- Changed framework to 2.0 Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Load.csproj ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Main.csproj ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Plugin.csproj ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/DLLTester.csproj ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj ACMServer/trunk/sharp tester/SourceTest 2.0/VirtualPlugin/VirtualPlugin.csproj Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Load.csproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Load.csproj 2008-08-17 21:40:55 UTC (rev 329) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Load/Load.csproj 2008-08-17 22:24:45 UTC (rev 330) @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>Load</RootNamespace> <AssemblyName>Load</AssemblyName> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Main.csproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Main.csproj 2008-08-17 21:40:55 UTC (rev 329) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Main/Main.csproj 2008-08-17 22:24:45 UTC (rev 330) @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>Main</RootNamespace> <AssemblyName>Main</AssemblyName> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Plugin.csproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Plugin.csproj 2008-08-17 21:40:55 UTC (rev 329) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Plugin/Plugin.csproj 2008-08-17 22:24:45 UTC (rev 330) @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>Plugin</RootNamespace> <AssemblyName>Plugin</AssemblyName> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/DLLTester.csproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/DLLTester.csproj 2008-08-17 21:40:55 UTC (rev 329) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/DLLTester.csproj 2008-08-17 22:24:45 UTC (rev 330) @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>SourceTest_2._0</RootNamespace> <AssemblyName>SourceTest 2.0</AssemblyName> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> @@ -32,15 +32,6 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> - <Reference Include="System.Core"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Xml.Linq"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Data.DataSetExtensions"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> </ItemGroup> Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj 2008-08-17 21:40:55 UTC (rev 329) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj 2008-08-17 22:24:45 UTC (rev 330) @@ -6,7 +6,7 @@ ProjectGUID="{036108C1-B126-4DC6-95D6-4D6543C8BFF7}" RootNamespace="Test" Keyword="ManagedCProj" - TargetFrameworkVersion="196613" + TargetFrameworkVersion="131072" > <Platforms> <Platform Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/VirtualPlugin/VirtualPlugin.csproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/VirtualPlugin/VirtualPlugin.csproj 2008-08-17 21:40:55 UTC (rev 329) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/VirtualPlugin/VirtualPlugin.csproj 2008-08-17 22:24:45 UTC (rev 330) @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>VirtualPlugin</RootNamespace> <AssemblyName>VirtualPlugin</AssemblyName> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Acmcontester-developers] SF.net SVN: acmcontester:[349]
ACMServer/trunk/sharp tester/SourceTest 2.0
From: <Or...@us...> - 2008-09-14 15:01:06
|
Revision: 349 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=349&view=rev Author: Oracle_ Date: 2008-09-14 15:01:05 +0000 (Sun, 14 Sep 2008) Log Message: ----------- Fixed bug with Too large array in Double security and updated waiting for files. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h Added Paths: ----------- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source11.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source12.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source13.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source14.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source15.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source16.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source18.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source2.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source3.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source4.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source5.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source6.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source7.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source8.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source9.txt Removed Paths: ------------- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/out.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/source.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err1.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err10.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err11.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err12.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err13.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err14.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err15.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err2.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err3.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err4.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err5.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err6.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err7.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err8.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/err9.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out1.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out10.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out11.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out12.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out13.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out14.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out15.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out2.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out3.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out4.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out5.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out6.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out7.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out8.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out9.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.exe ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.txt Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-09-14 15:01:05 UTC (rev 349) @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; using System.IO; using Main; @@ -12,22 +11,32 @@ { static void Main(string[] args) { + Console.SetOut(File.CreateText("D:\\logout.txt")); string[] data=File.ReadAllLines("InData.txt"); - TestEnv test = new TestEnv(File.ReadAllText("source.txt"),data[0],data[1],data[2]); - test.Compile(); - Console.WriteLine("Compile result: {0}, details: {1}, usedtime:{2}",test.comp.Result.ToString(),test.comp.Details,test.comp.UsedTime); - Console.WriteLine("Comp Output: {0}", test.comp.CompilerOutput); - if (test.comp.Result == Test.CompRes.OK) + for (int ind = 1; ind <= 18; ind++) { - test.RunAllTests(SecureType.Double); + string src = File.ReadAllText("src\\source" + ind.ToString() + ".txt"); + TestEnv test = new TestEnv(src, data[0], data[1], data[2]); + test.Compile(); + Console.WriteLine("------------------BEGIN SOURCE #"+ind.ToString()+"--------------------------"); + Console.WriteLine(src); + Console.WriteLine("-------------------END SOURCE #" + ind.ToString() + "---------------------------"); + Console.WriteLine("Compile result: {0}, details: {1}, usedtime:{2}", test.comp.Result.ToString(), test.comp.Details, test.comp.UsedTime); + Console.WriteLine("Comp Output: {0}", test.comp.CompilerOutput); + if (test.comp.Result == Test.CompRes.OK) + { + test.RunAllTests(SecureType.Double); - for (int i = 0; i < test.run.results.Length; i++) - { - Console.WriteLine("Test #{0} result: {1}, details: {2}, usedtime:{3}, usedRealTime: {4}, usedmemory: {5}", i + 1, - test.run.results[i].res, test.run.results[i].Details, test.run.results[i].UsedTime, test.run.results[i].UsedRealTime, test.run.results[i].UsedMemory); + for (int i = 0; i < test.run.results.Length; i++) + { + Console.WriteLine("Test #{0} result: {1}, details: {2}, usedtime:{3}, usedRealTime: {4}, usedmemory: {5}", i + 1, + test.run.results[i].res, test.run.results[i].Details, test.run.results[i].UsedTime, test.run.results[i].UsedRealTime, test.run.results[i].UsedMemory); + } } +// Console.ReadKey(); } - Console.ReadKey(); + Console.Out.Flush(); + Console.Out.Close(); } } } Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -4,6 +4,6 @@ OutputLimit: 1024 RealTimeLimit: 20000 TimeLimit: 1000 -MaxThreads: 1 +MaxThreads: 4 Checker: scriptExample.txt CheckPlugin: Plugin.dll \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/source.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/source.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/source.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1,28 +0,0 @@ -var a,b:integer; -begin -read(a,b); -write(a+b); -end. - -uses math; -begin - -end. - -uses windows; -var a,b:integer; -begin -read(a,b); -write(a+b); -end. - -var a:array [1..2147000000] of char; -begin - fillchar(a,0,sizeof(a)); -end. - -begin -assignfile(output,'out.txt'); -rewrite(output); -closefile(output); -end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,6 @@ +uses windows; +var s:string; +begin +readln(s); +writeln(length(s)); +end. Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,4 @@ +uses windows; +begin +Sleep(100000); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source11.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source11.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source11.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,2 @@ +begin +end; \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source12.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source12.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source12.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,3 @@ +begin +while true do; +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source13.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source13.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source13.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,3 @@ +begin +while true do write(' '); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source14.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source14.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source14.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,4 @@ +var a:Char; +begin + while true do read(a); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source15.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source15.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source15.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,8 @@ +uses Windows; +var k:HKEY; +begin + RegOpenKeyEx(HKEY_CURRENT_USER,'Software\',0,KEY_ALL_ACCESS,k); + RegSetValueEx(k,'GAME2',0,REG_SZ,pchar('hello'),5); + if RegQueryValueEx(k,'GAME2',nil,nil,nil,nil)<>0 then + while true do; +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source16.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source16.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source16.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,8 @@ +var a:array [1..10] of Integer; +x,y:integer; +begin + x:=10000; + a[x]:=138; + readln(x,y); + writeln(x+y); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,6 @@ +program Project2; +{$APPTYPE CONSOLE} +uses Windows; +begin + MessageBox(GetDesktopWindow(),'Hello!','Hello',MB_OK); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source18.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source18.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source18.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,9 @@ +var a,b:Extended; +i:Integer; +x:array of Integer; +begin + read(a,b); + for i:=1 to 5700000 do + a:=sqrt(a)*sqrt(a)+((sqrt(a)*sqrt(a))/sqrt(a))/sqrt(a)-1; + write(a+b:0:0); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source2.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source2.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source2.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,5 @@ +begin +assignfile(output,'out.txt'); +rewrite(output); +closefile(output); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source3.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source3.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source3.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,4 @@ +uses math; +begin + +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source4.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source4.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source4.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,6 @@ +uses windows; +var a,b:integer; +begin +read(a,b); +write(a+b); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source5.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source5.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source5.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,4 @@ +var a:array [1..2147000000] of char; +begin + fillchar(a,0,sizeof(a)); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source6.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source6.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source6.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,8 @@ +type MyStruct=record +a:array [1..1000000] of Integer; +end; + +var a:^MyStruct; +begin +new(a); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source7.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source7.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source7.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,4 @@ +var a:array [1..1000000] of Integer; +begin +fillchar(a,sizeof(a),0); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source8.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source8.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source8.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,8 @@ +var a,b:Extended; +i:integer; +begin +read(a,b); +for i:=1 to 10000000 do + a:=sqrt(a)*sqrt(a); +write(a+b:0:0); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source9.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source9.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source9.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -0,0 +1,9 @@ +var x:array [1..1000000] of ^Integer; +i:integer; +begin +fillchar(x,sizeof(x),0); +for i:=1 to 1000000 do + new(x[i]); +for i:=1 to 1000000 do + dispose(x[i]); +end. \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out1.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out1.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out1.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -2 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out10.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out10.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out10.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out11.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out11.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out11.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out12.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out12.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out12.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out13.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out13.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out13.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out14.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out14.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out14.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out15.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out15.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out15.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out2.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out2.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out2.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out3.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out3.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out3.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out4.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out4.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out4.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out5.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out5.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out5.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out6.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out6.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out6.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out7.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out7.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out7.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out8.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out8.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out8.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out9.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out9.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/out9.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1 +0,0 @@ -1349 \ No newline at end of file Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.txt 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/temp/source.txt 2008-09-14 15:01:05 UTC (rev 349) @@ -1,28 +0,0 @@ -var a,b:integer; -begin -read(a,b); -write(a+b); -end. - -uses math; -begin - -end. - -uses windows; -var a,b:integer; -begin -read(a,b); -write(a+b); -end. - -var a:array [1..2147000000] of char; -begin - fillchar(a,0,sizeof(a)); -end. - -begin -assignfile(output,'out.txt'); -rewrite(output); -closefile(output); -end. \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-14 15:01:05 UTC (rev 349) @@ -35,7 +35,7 @@ src->Write(source); src->Close(); - System::Threading::Thread::Sleep(CONST_SLEEP); //waiting for file to flush on hard + WaitForFile(srcpath); si->FileName=comppath; si->Arguments="\""+srcpath+"\" \""+temp; @@ -53,7 +53,7 @@ } UsedTime=comp->TotalProcessorTime; - System::Threading::Thread::Sleep(CONST_SLEEP); //waiting for creating the file + WaitForFile(ExeFile); if (!File::Exists(ExeFile)) //compilation error { @@ -70,4 +70,24 @@ { comp->Close(); } +} + +void Compiler::WaitForFile(String^ FileName) +{ + for (int i=0;i<CONST_SLEEP;++i) + if (!File::Exists(FileName)) + System::Threading::Thread::Sleep(1); + for (int i=0;i<CONST_SLEEP;++i) + { + try + { + FileStream^ f=File::OpenRead(FileName); + f->Close(); + break; + } catch(...) + { + System::Threading::Thread::Sleep(1); + continue; + } + } } \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h 2008-09-14 15:01:05 UTC (rev 349) @@ -22,6 +22,7 @@ String^ comppath; String^ source; String^ temp; + void WaitForFile(String^ FileName); public: String^ Details; CompRes Result; Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h 2008-09-14 15:01:05 UTC (rev 349) @@ -22,7 +22,7 @@ virtual bool CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo) {return true;}; virtual bool CheckSecure() {return true;}; virtual void Finalize() {}; - int LastError() {return err;}; + virtual int LastError() {return err;}; }; public class UserSecure: public BasicSecure @@ -70,6 +70,7 @@ bool CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo); bool CheckSecure(); void Finalize(); + int LastError() {return syssec->LastError(); } }; public class NoneSecure:public BasicSecure Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-14 15:01:05 UTC (rev 349) @@ -70,8 +70,16 @@ unlock(); if (!sec->Init(bufW)) { - result->res=TestResult::InternalError; - result->Details=gcnew String(sec->Details.c_str())+" Can not init secure"; + int err=sec->LastError(); + if ((err==193)||(err==1455)) + { + result->res=TestResult::RuntimeError; + result->Details=gcnew String(sec->Details.c_str())+" Too large array"; + } else + { + result->res=TestResult::InternalError; + result->Details=gcnew String(sec->Details.c_str())+" Can not init secure"; + } Marshal::FreeHGlobal(IntPtr(bufW)); return false; } @@ -238,7 +246,7 @@ CloseHandle(si.hStdOutput);si.hStdOutput=NULL; CloseHandle(si.hStdInput);si.hStdInput=NULL; - Sleep(CONST_SLEEP); //waiting for file + WaitForFile(oupath); if (!File::Exists(oupath)) { @@ -247,7 +255,7 @@ return false; } - Sleep(CONST_SLEEP); //waiting for closing all handles to this file + WaitForFile(oupath); Checker^ check=gcnew Tester::Checker(Path::GetFullPath(data->Checker),test->tests[index-1]->input,File::ReadAllText(oupath),test->tests[index-1]->output); @@ -367,3 +375,23 @@ { LeaveCriticalSection(cs); } + +void Runner::WaitForFile(String^ FileName) +{ + for (int i=0;i<CONST_SLEEP;++i) + if (!File::Exists(FileName)) + Sleep(1); + for (int i=0;i<CONST_SLEEP;++i) + { + try + { + FileStream^ f=File::OpenRead(FileName); + f->Close(); + break; + } catch(...) + { + Sleep(1); + continue; + } + } +} \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2008-09-01 16:43:21 UTC (rev 348) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2008-09-14 15:01:05 UTC (rev 349) @@ -79,6 +79,7 @@ void destroylock(); void lock(); //locks access to other theads void unlock(); //unlocks access to other threads + void WaitForFile(String^ FileName); //waits for file handle TestLoader^ testfield; DataLoader^ datafield; PluginLoader^ plugfield; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Acmcontester-developers] SF.net SVN: acmcontester:[357]
ACMServer/trunk/sharp tester/SourceTest 2.0
From: <Or...@us...> - 2008-09-20 15:23:46
|
Revision: 357 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=357&view=rev Author: Oracle_ Date: 2008-09-20 15:23:38 +0000 (Sat, 20 Sep 2008) Log Message: ----------- Added SEH, applied some changes to Details, fixed small bug with SecureType::SysCall. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp Added Paths: ----------- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source19.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source20.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source21.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source22.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source23.txt Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs 2008-09-20 15:23:38 UTC (rev 357) @@ -37,23 +37,31 @@ while (!f.EndOfStream) { string[] param=f.ReadLine().Split(' '); - switch (param[0]) + if (param.Length < 2) continue; + try { - case "CodeLimit:": CodeLimit = Convert.ToInt32(param[1]); break; - case "CompilationTimeLimit:": CompilationTimeLimit = Convert.ToInt32(param[1]); break; - case "MemoryLimit:": MemoryLimit = Convert.ToInt32(param[1]); break; - case "OutputLimit:": OutputLimit = Convert.ToInt32(param[1]); break; - case "RealTimeLimit:": RealTimeLimit = Convert.ToInt32(param[1]); break; - case "TimeLimit:": TimeLimit = Convert.ToInt32(param[1]); break; - case "MaxThreads:": MaxThreads = Convert.ToInt32(param[1]); break; - case "PerTestCount:": PerTestCount = Convert.ToInt32(param[1]); break; - case "InputName:": InputName = param[1]; break; - case "OutputName:": OutputName = param[1]; break; - case "PointFileName:": PointFileName = param[1]; break; - case "TestFolderName:": TestFolderName = param[1]; break; - case "Checker:": Checker = param[1]; break; - case "CheckPlugin:": CheckPlugin = param[1]; break; + switch (param[0]) + { + case "CodeLimit:": CodeLimit = Convert.ToInt32(param[1]); break; + case "CompilationTimeLimit:": CompilationTimeLimit = Convert.ToInt32(param[1]); break; + case "MemoryLimit:": MemoryLimit = Convert.ToInt32(param[1]); break; + case "OutputLimit:": OutputLimit = Convert.ToInt32(param[1]); break; + case "RealTimeLimit:": RealTimeLimit = Convert.ToInt32(param[1]); break; + case "TimeLimit:": TimeLimit = Convert.ToInt32(param[1]); break; + case "MaxThreads:": MaxThreads = Convert.ToInt32(param[1]); break; + case "PerTestCount:": PerTestCount = Convert.ToInt32(param[1]); break; + case "InputName:": InputName = param[1]; break; + case "OutputName:": OutputName = param[1]; break; + case "PointFileName:": PointFileName = param[1]; break; + case "TestFolderName:": TestFolderName = param[1]; break; + case "Checker:": Checker = param[1]; break; + case "CheckPlugin:": CheckPlugin = param[1]; break; + } } + catch (Exception e) + { + return false; + } } return true; } @@ -90,7 +98,16 @@ output = ""; if (File.Exists(pointname)) - points = Convert.ToInt32(File.OpenText(pointname).ReadToEnd()); + { + try + { + points = Convert.ToInt32(File.OpenText(pointname).ReadToEnd()); + } + catch (Exception e) + { + points = 1; + } + } else points = 1; } Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs 2008-09-20 15:23:38 UTC (rev 357) @@ -5,6 +5,18 @@ namespace Main { + public class TesterException : ApplicationException + { + public TesterException(string message) : base(message) { } + public TesterException() : base() { } + } + + public class IncorrectFileException : ApplicationException + { + public IncorrectFileException(string message) : base(message) { } + public IncorrectFileException() : base() { } + } + public class TestEnv { public string ProblemPath; @@ -18,23 +30,78 @@ { this.Source = Source; this.TempPath = Path.GetFullPath(TempPath); + if (!Directory.Exists(this.TempPath)) + Directory.CreateDirectory(this.TempPath); this.CompPath = Path.GetFullPath(CompPath); + if (!File.Exists(this.CompPath)) + throw new FileNotFoundException("Compiler file do not exists!"); this.ProblemPath = Path.GetFullPath(ProblemPath); + if (!Directory.Exists(this.ProblemPath)) + throw new DirectoryNotFoundException("Problem path do not exists!"); } public void Compile() { - DataLoader dat = new DataLoader(ProblemPath + "ProblemData.txt"); - dat.Load(); - string[] InData=System.IO.File.ReadAllLines("TesterInData.txt"); - comp=new Compiler(CompPath,Source,TempPath,dat.CompilationTimeLimit,Convert.ToInt32(InData[0])); + if (comp == null) + { + if (!File.Exists(ProblemPath + "ProblemData.txt")) + throw new FileNotFoundException("ProblemData.txt do not exists"); + DataLoader dat = new DataLoader(ProblemPath + "ProblemData.txt"); + if (!dat.Load()) + throw new IncorrectFileException("Can not load data from ProblemData.txt"); + + if (!File.Exists("TesterInData.txt")) + throw new FileNotFoundException("TesterInData.txt do not exists"); + string[] InData = System.IO.File.ReadAllLines("TesterInData.txt"); + if (InData.Length < 1) + throw new IncorrectFileException("Can not load data from ProblemData.txt"); + int buf; + try + { + buf = Convert.ToInt32(InData[0]); + } + catch (Exception e) + { + throw new IncorrectFileException("Can not load sleep time from TesterInData.txt " + e.Message); + } + + comp = new Compiler(CompPath, Source, TempPath, dat.CompilationTimeLimit, buf); + } comp.Compile(); } - public void RunAllTests(SecureType SecType) + public void RunAllTests() { RunAllTests(SecureType.Double,true); } + public void RunAllTests(SecureType SecType) { RunAllTests(SecType,true); } + + public void RunAllTests(SecureType SecType, bool TestAll) { - run = new Runner(SecType,ProblemPath,comp.ExeFile,TempPath,comp.CONST_SLEEP); + if (run == null) + { + if (comp == null) + throw new TesterException("You should first compile source before running tests!"); + run = new Runner(SecType, ProblemPath, comp.ExeFile, TempPath, comp.CONST_SLEEP); + } + run.TestAll = TestAll; run.RunTests(); } + + public void RunOneTest(int index) { RunOneTest(SecureType.Double,index); } + + public void RunOneTest(SecureType SecType, int index) + { + if (run == null) + { + if (comp == null) + throw new TesterException("You should first compile source before running tests!"); + run = new Runner(SecType, ProblemPath, comp.ExeFile, TempPath, comp.CONST_SLEEP); + } + run.ExecuteTest(index); + } + + public void StopTesting() + { + if (run != null) + run.TerminateThreads(); + } } } Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-09-20 15:23:38 UTC (rev 357) @@ -13,7 +13,7 @@ { Console.SetOut(File.CreateText("D:\\logout.txt")); string[] data=File.ReadAllLines("InData.txt"); - for (int ind = 1; ind <= 18; ind++) + for (int ind = 1; ind <= 1; ind++) { string src = File.ReadAllText("src\\source" + ind.ToString() + ".txt"); TestEnv test = new TestEnv(src, data[0], data[1], data[2]); Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source1.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -1,4 +1,4 @@ -uses windows; +uses windows,math; var s:string; begin readln(s); Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source10.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -1,4 +1,19 @@ -uses windows; +program Project2; + +{$APPTYPE CONSOLE} +uses Windows; + +type TMYPROC=procedure (x:Cardinal); stdcall; + +var h:HMODULE; +x:Pointer; begin -Sleep(100000); -end. \ No newline at end of file +h:=LoadLibraryExA('kernel32.dll',0,0); +x:=GetProcAddress(h,'Sleep'); +if (x<>nil) then +begin +TMyPROC(x)(10000000); +end else +writeln('ERROR!!!'); +FreeLibrary(h); +end. Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source17.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -2,5 +2,5 @@ {$APPTYPE CONSOLE} uses Windows; begin - MessageBox(GetDesktopWindow(),'Hello!','Hello',MB_OK); + MessageBox(0,'Hello!','Hello',MB_OK); end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source19.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source19.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source19.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -0,0 +1,7 @@ +var a:array [1..10000000] of Integer; +x,y:integer; +begin +fillchar(a,0,sizeof(a)); +read(x,y); +write(x+y); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source20.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source20.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source20.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -0,0 +1,8 @@ +program hello; +var a,b:integer; +ttt:text; +begin +assign(ttt,'ttt.txt'); +read(a,b); +write(a+b); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source21.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source21.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source21.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -0,0 +1,9 @@ +program hello; +var a,b:integer; +ttt:text; +begin + assign(ttt,'ttt.txt'); + rewrite(ttt); + read(a,b); + write(a+b); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source22.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source22.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source22.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -0,0 +1,9 @@ +program hello; +var a,b:integer; +ttt:text; +begin + assign(ttt,'C:\Documents and Settings\Pavlo\Desktop\ttt.txt'); + rewrite(ttt); + read(a,b); + write(a+b); +end. \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source23.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source23.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/src/source23.txt 2008-09-20 15:23:38 UTC (rev 357) @@ -0,0 +1,12 @@ +program hello; +uses windows; +var t:SystemTime; +begin +t.wYear:=1700; +t.wMonth:=2; +t.wDay:=3; +t.wHour:=3; +t.wMinute:=3; +t.wSecond:=3; +SetSystemTime(t); +end. \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-20 15:23:38 UTC (rev 357) @@ -24,7 +24,12 @@ if (File::Exists(ExeFile)) //delete previsious source { File::Delete(ExeFile); - System::Threading::Thread::Sleep(CONST_SLEEP); //waiting for file to destroy + for (int i=0;i<CONST_SLEEP;i++) //waiting for file to destroy + { + if (!File::Exists(ExeFile)) + break; + System::Threading::Thread::Sleep(1); + } } si->RedirectStandardOutput=true; Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-09-20 15:23:38 UTC (rev 357) @@ -50,8 +50,16 @@ fwscanf(f,L"%d %s %s",&buf,&USER_NAME,&USER_PASSW); fclose(f); - SetUserObjectFullAccess( GetThreadDesktop(GetCurrentThreadId())); //needed for accessing from CreateProcessAsUser - SetUserObjectFullAccess( GetProcessWindowStation()); //needed for accessing from CreateProcessAsUser + if (!SetUserObjectFullAccess(GetThreadDesktop(GetCurrentThreadId()))) + { + Details="Cannot SetUserObjectFullAccess(GetThreadDesktop(GetCurrentThreadId())). Error#"+ToStr(GetLastError()); + return false; //needed for accessing from CreateProcessAsUser + } + if (!SetUserObjectFullAccess( GetProcessWindowStation())) + { + Details="Cannot SetUserObjectFullAccess( GetProcessWindowStation()). Error#"+ToStr(GetLastError()); + return false; //needed for accessing from CreateProcessAsUser + } USER_INFO_1 ui; NET_API_STATUS st; @@ -69,16 +77,16 @@ if (st==NERR_UserExists) userex=true; else { - Details="Cannot create user."; + Details="Cannot create user. Error#"+ToStr(GetLastError()); return false; } } if (!userex) { array<DriveInfo^>^ drv=DriveInfo::GetDrives(); - for (int i=0;i<drv->Length;i++) //for all drives set limitation - if (drv[i]->DriveType==DriveType::Fixed) - DenyAccessFolder(drv[i]->Name); + for (int i=0;i<drv->Length;i++) //for all fixed drives set limitation + if (drv[i]->DriveType==DriveType::Fixed) + DenyAccessFolder(drv[i]->Name); wchar_t buf[MAX_PATH+1]; GetEnvironmentVariableW(L"ProgramFiles",buf,MAX_PATH); DenyAccessFolder(gcnew String(buf)); @@ -91,9 +99,9 @@ DWORD size=MAX_PATH; GetProfilesDirectory(buf,&size); DenyAccessFolder(gcnew String(buf)); - Details="User created."; + Details="User created. "; } else - Details="User exists."; + Details="User exists. "; return true; } @@ -208,12 +216,11 @@ } vector<TFunc> allowed; char mod_name[256],func_name[256]; -while (fscanf(f,"%s %s",mod_name,func_name)>0) +while (fscanf(f,"%s %s",mod_name,func_name)==2) { TFunc func; func.Name=func_name; func.Module=mod_name; - //func.handle=GetProcAddress(GetModuleHandleA(mod_name), func_name); allowed.push_back(func); } fclose(f); @@ -234,11 +241,12 @@ PIMAGE_THUNK_DATA pThunk = (PIMAGE_THUNK_DATA)((PBYTE) hmodCaller + pImportDesc->FirstThunk); for (; pThunk->u1.Function; pThunk++) { - //PROC* ppfn = (PROC*) &pThunk->u1.Function; + if ((pThunk->u1.Function&(1<<31))!=0) + continue; PSTR NAME=(PSTR)((PIMAGE_IMPORT_BY_NAME)((PBYTE)hmodCaller+pThunk->u1.AddressOfData))->Name; bool allow=false; - for (int i=0;i<allowed.size();i++) + for (unsigned i=0;i<allowed.size();i++) if ((allowed[i].Name==string(NAME))&&(allowed[i].Module==string(pszModName))) { allow=true; @@ -247,7 +255,7 @@ if (!allow) { HasDF=true; - Details="Destricted Function. "; + Details="Import DF. \""+string(NAME)+"\" from module \""+string(pszModName)+"\" "; FreeLibrary(hmodCaller); return true; } @@ -309,7 +317,7 @@ return true; } err=GetLastError(); -Details="Cannot create process. Error#"+ToStr(err=GetLastError()); +Details="Cannot create process. Error#"+ToStr(err); return false; } Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h 2008-09-20 15:23:38 UTC (rev 357) @@ -45,7 +45,6 @@ { string Name; string Module; - //PROC handle; }; public class SysCallSecure:public BasicSecure Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-20 10:03:22 UTC (rev 356) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-20 15:23:38 UTC (rev 357) @@ -14,6 +14,7 @@ data->Load(); testfield=gcnew TestLoader(data->InputName,data->OutputName,data->PointFileName,data->TestFolderName,ProblemPath); testfield->Load(); + results=gcnew array<TestRes^>(testfield->tests->Length); plug=gcnew PluginLoader(System::IO::Path::GetFullPath(data->CheckPlugin)); plug->Load(); exe=ExeFile; @@ -85,7 +86,7 @@ if (sec->CheckSecure()) { result->res=TestResult::DestrictedFunction; - result->Details=gcnew String(sec->Details.c_str())+" Destricted function."; + result->Details=gcnew String(sec->Details.c_str())+"Destricted function."; Marshal::FreeHGlobal(IntPtr(bufW)); return false; } @@ -327,8 +328,7 @@ { StopTest=false; CurrentTest=0; - threads=gcnew array<Threading::Thread^>(min(data->MaxThreads,test->tests->Length)); - results=gcnew array<TestRes^>(test->tests->Length); + threads=gcnew array<Threading::Thread^>(min(data->MaxThreads,testfield->tests->Length)); for (int i=0;i<threads->Length;i++) { Threading::Thread^ t=gcnew Threading::Thread(gcnew Threading::ThreadStart(this,&Runner::ThreadProc)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Acmcontester-developers] SF.net SVN: acmcontester:[368]
ACMServer/trunk/sharp tester/SourceTest 2.0
From: <Or...@us...> - 2008-09-21 08:13:53
|
Revision: 368 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=368&view=rev Author: Oracle_ Date: 2008-09-21 08:13:45 +0000 (Sun, 21 Sep 2008) Log Message: ----------- Added global exception. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs 2008-09-20 22:01:36 UTC (rev 367) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs 2008-09-21 08:13:45 UTC (rev 368) @@ -7,16 +7,11 @@ { public class TesterException : ApplicationException { + public TesterException(string message,Exception innerException) : base(message,innerException) { } public TesterException(string message) : base(message) { } public TesterException() : base() { } } - public class IncorrectFileException : ApplicationException - { - public IncorrectFileException(string message) : base(message) { } - public IncorrectFileException() : base() { } - } - public class TestEnv { public string ProblemPath; @@ -28,74 +23,111 @@ public TestEnv(string Source,string CompPath,string TempPath,string ProblemPath) { - this.Source = Source; - this.TempPath = Path.GetFullPath(TempPath); - if (!Directory.Exists(this.TempPath)) - Directory.CreateDirectory(this.TempPath); - this.CompPath = Path.GetFullPath(CompPath); - if (!File.Exists(this.CompPath)) - throw new FileNotFoundException("Compiler file do not exists!"); - this.ProblemPath = Path.GetFullPath(ProblemPath); - if (!Directory.Exists(this.ProblemPath)) - throw new DirectoryNotFoundException("Problem path do not exists!"); + try + { + this.Source = Source; + this.TempPath = Path.GetFullPath(TempPath); + if (!Directory.Exists(this.TempPath)) + Directory.CreateDirectory(this.TempPath); + this.CompPath = Path.GetFullPath(CompPath); + if (!File.Exists(this.CompPath)) + throw new FileNotFoundException("Compiler file do not exists!"); + this.ProblemPath = Path.GetFullPath(ProblemPath); + if (!Directory.Exists(this.ProblemPath)) + throw new DirectoryNotFoundException("Problem path do not exists!"); + } + catch (Exception e) + { + throw new TesterException("Exception in creating TestEnv",e); + } } public void Compile() { - if (comp == null) + try { - if (!File.Exists(ProblemPath + "ProblemData.txt")) - throw new FileNotFoundException("ProblemData.txt do not exists"); - DataLoader dat = new DataLoader(ProblemPath + "ProblemData.txt"); - if (!dat.Load()) - throw new IncorrectFileException("Can not load data from ProblemData.txt"); + if (comp == null) + { + if (!File.Exists(ProblemPath + "ProblemData.txt")) + throw new FileNotFoundException("ProblemData.txt do not exists"); + DataLoader dat = new DataLoader(ProblemPath + "ProblemData.txt"); + if (!dat.Load()) + throw new FileLoadException("Can not load data from ProblemData.txt"); - if (!File.Exists("TesterInData.txt")) - throw new FileNotFoundException("TesterInData.txt do not exists"); - string[] InData = System.IO.File.ReadAllLines("TesterInData.txt"); - if (InData.Length < 1) - throw new IncorrectFileException("Can not load data from ProblemData.txt"); - int buf; - try - { - buf = Convert.ToInt32(InData[0]); + if (!File.Exists("TesterInData.txt")) + throw new FileNotFoundException("TesterInData.txt do not exists"); + string[] InData = System.IO.File.ReadAllLines("TesterInData.txt"); + if (InData.Length < 1) + throw new FileLoadException("Can not load data from ProblemData.txt"); + int buf; + try + { + buf = Convert.ToInt32(InData[0]); + } + catch (Exception e) + { + throw new FileLoadException("Can not load sleep time from TesterInData.txt " + e.Message); + } + + comp = new Compiler(CompPath, Source, TempPath, dat.CompilationTimeLimit, buf); } - catch (Exception e) - { - throw new IncorrectFileException("Can not load sleep time from TesterInData.txt " + e.Message); - } - - comp = new Compiler(CompPath, Source, TempPath, dat.CompilationTimeLimit, buf); + comp.Compile(); } - comp.Compile(); + catch (Exception e) + { + throw new TesterException("Exception in compiling!",e); + } } - public void RunAllTests() { RunAllTests(SecureType.Double,true); } - public void RunAllTests(SecureType SecType) { RunAllTests(SecType,true); } + public void RunAllTests() + { + RunAllTests(SecureType.Double,true); + } + public void RunAllTests(SecureType SecType) + { + RunAllTests(SecType,true); + } public void RunAllTests(SecureType SecType, bool TestAll) { - if (run == null) + try { - if (comp == null) - throw new TesterException("You should first compile source before running tests!"); - run = new Runner(SecType, ProblemPath, comp.ExeFile, TempPath, comp.CONST_SLEEP); + if (run == null) + { + if (comp == null) + throw new TesterException("You should first compile source before running tests!"); + run = new Runner(SecType, ProblemPath, comp.ExeFile, TempPath, comp.CONST_SLEEP); + } + run.TestAll = TestAll; + run.RunTests(); } - run.TestAll = TestAll; - run.RunTests(); + catch (Exception e) + { + throw new TesterException("Exception in running tests!",e); + } } - public void RunOneTest(int index) { RunOneTest(SecureType.Double,index); } + public void RunOneTest(int index) + { + RunOneTest(SecureType.Double,index); + } public void RunOneTest(SecureType SecType, int index) { - if (run == null) + try { - if (comp == null) - throw new TesterException("You should first compile source before running tests!"); - run = new Runner(SecType, ProblemPath, comp.ExeFile, TempPath, comp.CONST_SLEEP); + if (run == null) + { + if (comp == null) + throw new TesterException("You should first compile source before running tests!"); + run = new Runner(SecType, ProblemPath, comp.ExeFile, TempPath, comp.CONST_SLEEP); + } + run.ExecuteTest(index); } - run.ExecuteTest(index); + catch (Exception e) + { + throw new TesterException("Exception in running test",e); + } } public void StopTesting() Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-20 22:01:36 UTC (rev 367) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-21 08:13:45 UTC (rev 368) @@ -10,13 +10,17 @@ { SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS); //for better testing initlock(); + if (!File::Exists(ProblemPath + "ProblemData.txt")) + throw gcnew FileNotFoundException("ProblemData not found!"); data = gcnew DataLoader(ProblemPath + "ProblemData.txt"); - data->Load(); + if (!data->Load()) + throw gcnew FileLoadException("Can not load problem data!"); testfield=gcnew TestLoader(data->InputName,data->OutputName,data->PointFileName,data->TestFolderName,ProblemPath); testfield->Load(); results=gcnew array<TestRes^>(testfield->tests->Length); plug=gcnew PluginLoader(System::IO::Path::GetFullPath(data->CheckPlugin)); - plug->Load(); + if (!plug->Load()) + throw gcnew FileLoadException("Can not load Plugin!"); exe=ExeFile; prob=ProblemPath; temp=TempPath; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Acmcontester-developers] SF.net SVN: acmcontester:[372]
ACMServer/trunk/sharp tester/SourceTest 2.0
From: <Or...@us...> - 2008-09-24 19:51:55
|
Revision: 372 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=372&view=rev Author: Oracle_ Date: 2008-09-24 19:51:37 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Fixed bug with waiting for files. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-09-22 20:14:18 UTC (rev 371) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-09-24 19:51:37 UTC (rev 372) @@ -13,7 +13,7 @@ { Console.SetOut(File.CreateText("D:\\logout.txt")); string[] data=File.ReadAllLines("InData.txt"); - for (int ind = 1; ind <= 1; ind++) + for (int ind = 1; ind <= 5; ind++) { string src = File.ReadAllText("src\\source" + ind.ToString() + ".txt"); TestEnv test = new TestEnv(src, data[0], data[1], data[2]); Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt 2008-09-22 20:14:18 UTC (rev 371) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/problem/ProblemData.txt 2008-09-24 19:51:37 UTC (rev 372) @@ -4,6 +4,6 @@ OutputLimit: 1024 RealTimeLimit: 20000 TimeLimit: 1000 -MaxThreads: 4 +MaxThreads: 16 Checker: scriptExample.txt CheckPlugin: Plugin.dll \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-22 20:14:18 UTC (rev 371) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-24 19:51:37 UTC (rev 372) @@ -28,7 +28,7 @@ { if (!File::Exists(ExeFile)) break; - System::Threading::Thread::Sleep(1); + System::Threading::Thread::Sleep(10); } } @@ -37,9 +37,14 @@ si->CreateNoWindow=true; StreamWriter^ src=File::CreateText(srcpath); src->Write(source); + src->Flush(); src->Close(); - WaitForFile(srcpath); + System::Threading::Thread::Sleep(CONST_SLEEP); + for (int i=0;i<CONST_SLEEP;i++) + if (!File::Exists(srcpath)) + System::Threading::Thread::Sleep(5); else + break; si->FileName=comppath; si->Arguments="\""+srcpath+"\" \""+temp; @@ -57,7 +62,10 @@ } UsedTime=comp->TotalProcessorTime; - WaitForFile(ExeFile); + for (int i=0;i<CONST_SLEEP;i++) + if (!File::Exists(ExeFile)) + System::Threading::Thread::Sleep(5); else + break; if (!File::Exists(ExeFile)) //compilation error { @@ -74,24 +82,4 @@ { comp->Close(); } -} - -void Compiler::WaitForFile(String^ FileName) -{ - for (int i=0;i<CONST_SLEEP;++i) - if (!File::Exists(FileName)) - System::Threading::Thread::Sleep(1); - for (int i=0;i<CONST_SLEEP;++i) - { - try - { - FileStream^ f=File::OpenRead(FileName); - f->Close(); - break; - } catch(...) - { - System::Threading::Thread::Sleep(1); - continue; - } - } } \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h 2008-09-22 20:14:18 UTC (rev 371) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h 2008-09-24 19:51:37 UTC (rev 372) @@ -22,7 +22,6 @@ String^ comppath; String^ source; String^ temp; - void WaitForFile(String^ FileName); public: String^ Details; CompRes Result; Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-09-22 20:14:18 UTC (rev 371) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-09-24 19:51:37 UTC (rev 372) @@ -1,4 +1,3 @@ - #include "SecureClass.h" #include <Lm.h> #include <Userenv.h> Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-22 20:14:18 UTC (rev 371) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-24 19:51:37 UTC (rev 372) @@ -24,7 +24,7 @@ exe=ExeFile; prob=ProblemPath; temp=TempPath; - TestAll=true; + FTestAll=true; SecType=secure; CONST_SLEEP=WaitForFile; } @@ -72,6 +72,7 @@ lock(); bufW=(wchar_t*)Marshal::StringToHGlobalUni(exe).ToPointer(); unlock(); + if (!sec->Init(bufW)) { int err=sec->LastError(); @@ -87,6 +88,7 @@ Marshal::FreeHGlobal(IntPtr(bufW)); return false; } + if (sec->CheckSecure()) { result->res=TestResult::DestrictedFunction; @@ -94,6 +96,7 @@ Marshal::FreeHGlobal(IntPtr(bufW)); return false; } + if (!sec->CreateProc(bufW,TRUE,CREATE_SUSPENDED|CREATE_NO_WINDOW|ABOVE_NORMAL_PRIORITY_CLASS,&si)) { Marshal::FreeHGlobal(IntPtr(bufW)); @@ -118,6 +121,7 @@ } Marshal::FreeHGlobal(IntPtr(bufW)); + job=CreateJobObject(NULL,NULL); mem.BasicLimitInformation.LimitFlags=JOB_OBJECT_LIMIT_JOB_MEMORY; mem.JobMemoryLimit=data->MemoryLimit; @@ -250,8 +254,11 @@ CloseHandle(si.hStdOutput);si.hStdOutput=NULL; CloseHandle(si.hStdInput);si.hStdInput=NULL; - WaitForFile(oupath); - + for (int i=0;i<CONST_SLEEP;i++) + if (!File::Exists(oupath)) + Sleep(5); else + break; + if (!File::Exists(oupath)) { result->res=TestResult::WrongAnswer; @@ -259,10 +266,8 @@ return false; } - WaitForFile(oupath); + Checker^ check=gcnew Tester::Checker(Path::GetFullPath(data->Checker),test->tests[index-1]->input,ReadAllFile(oupath),test->tests[index-1]->output); - Checker^ check=gcnew Tester::Checker(Path::GetFullPath(data->Checker),test->tests[index-1]->input,File::ReadAllText(oupath),test->tests[index-1]->output); - switch (check->Check()) { case CheckResult::OE: @@ -320,11 +325,7 @@ if (n<=test->tests->Length) { if (!ExecuteTest(n)) - { - lock(); StopTest=true; - unlock(); - } } else break; } @@ -332,7 +333,7 @@ void Runner::RunTests() { - StopTest=false; + FStopTest=false; CurrentTest=0; threads=gcnew array<Threading::Thread^>(min(data->MaxThreads,testfield->tests->Length)); for (int i=0;i<threads->Length;i++) @@ -381,22 +382,19 @@ LeaveCriticalSection(cs); } -void Runner::WaitForFile(String^ FileName) +String^ Runner::ReadAllFile(String^ FileName) { for (int i=0;i<CONST_SLEEP;++i) - if (!File::Exists(FileName)) - Sleep(1); - for (int i=0;i<CONST_SLEEP;++i) { try { - FileStream^ f=File::OpenRead(FileName); - f->Close(); - break; + String^ res=File::ReadAllText(FileName); + return res; } catch(...) { - Sleep(1); + Sleep(5); continue; } } + return ""; } \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2008-09-22 20:14:18 UTC (rev 371) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2008-09-24 19:51:37 UTC (rev 372) @@ -70,7 +70,31 @@ String^ temp; String^ exe; void ThreadProc(); - bool StopTest; //true if testing should be stopped + bool FStopTest; + + property bool StopTest + { + bool get() + { + try + { + lock(); + return FStopTest; + } finally + { + unlock(); + } + } + + void set(bool value) + { + lock(); + FStopTest=value; + unlock(); + } + } + + bool FTestAll; array<Threading::Thread^>^ threads; int CurrentTest; //next test needed to be tested @@ -79,14 +103,13 @@ void destroylock(); void lock(); //locks access to other theads void unlock(); //unlocks access to other threads - void WaitForFile(String^ FileName); //waits for file handle + String^ ReadAllFile(String^ FileName); //waits for file handle and returns all file text TestLoader^ testfield; DataLoader^ datafield; PluginLoader^ plugfield; public: array<TestRes^>^ results; - bool TestAll; //set false if break testing after ExecuteTest return false (not AC) SecureType SecType; int CONST_SLEEP; @@ -95,7 +118,29 @@ void RunTests(); void TerminateThreads(); ~Runner(); + + property bool TestAll //set false if break testing after ExecuteTest return false (not AC) + { + bool get() + { + try + { + lock(); + return FTestAll; + } finally + { + unlock(); + } + } + void set(bool value) + { + lock(); + FTestAll=value; + unlock(); + } + } + property TestLoader^ test { TestLoader^ get() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Acmcontester-developers] SF.net SVN: acmcontester:[434]
ACMServer/trunk/sharp tester/SourceTest 2.0
From: <Or...@us...> - 2008-12-06 13:12:38
|
Revision: 434 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=434&view=rev Author: Oracle_ Date: 2008-12-06 13:12:31 +0000 (Sat, 06 Dec 2008) Log Message: ----------- Added C++ compiler. Added support of LangIDs. Made some small changes to code - now it is a bit more readable. Fixed bug with case sensitivity in SysCallSecure. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/AllowedFunc.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/InData.txt ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp Added Paths: ----------- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/CompIDs.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7/D7.bat ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7/DCC32.exe here.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7/dcc32.cfg ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7/rlink32.dll here.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/VC6/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/VC6/VS.bat ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/VC6/includeVS/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/VC6/includeVS/includes here.txt Removed Paths: ------------- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7.bat ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/DCC32.exe here.txt ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/dcc32.cfg ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/includeD7/ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/rlink32.dll here.txt Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Load/LoaderClass.cs 2008-12-06 13:12:31 UTC (rev 434) @@ -9,19 +9,19 @@ public class DataLoader { public string path; - public int CodeLimit=65536; - public int CompilationTimeLimit=10000; - public int MemoryLimit=67108864; - public int OutputLimit=20000000; - public int RealTimeLimit=20000; - public int TimeLimit=1000; - public int MaxThreads=2; - public int PerTestCount=2; - public string InputName="in.txt"; - public string OutputName="out.txt"; - public string PointFileName="points.txt"; - public string TestFolderName="test*"; - public string Checker=""; + public int CodeLimit = 65536; + public int CompilationTimeLimit = 10000; + public int MemoryLimit = 67108864; + public int OutputLimit = 20000000; + public int RealTimeLimit = 20000; + public int TimeLimit = 1000; + public int MaxThreads = 2; + public int PerTestCount = 2; + public string InputName = "in.txt"; + public string OutputName = "out.txt"; + public string PointFileName = "points.txt"; + public string TestFolderName = "test*"; + public string Checker = ""; public string CheckPlugin = ""; public DataLoader(string Path) @@ -36,7 +36,7 @@ StreamReader f = File.OpenText(path); while (!f.EndOfStream) { - string[] param=f.ReadLine().Split(' '); + string[] param = f.ReadLine().Split(' '); if (param.Length < 2) continue; try { @@ -88,14 +88,22 @@ OutPath = outname; PointPath = pointname; if (File.Exists(inname)) - input = File.OpenText(inname).ReadToEnd(); + { + input = File.OpenText(inname).ReadToEnd(); + } else + { input = ""; + } if (File.Exists(outname)) + { output = File.OpenText(outname).ReadToEnd(); + } else + { output = ""; + } if (File.Exists(pointname)) { @@ -109,7 +117,9 @@ } } else + { points = 1; + } } } @@ -118,8 +128,10 @@ private string MaskToString(string mask, int numb) { int star; - if ((star=mask.IndexOf('*')) == -1) + if ((star = mask.IndexOf('*')) == -1) + { return mask; + } int cnt=0; while (star < mask.Length && mask[star] == '*') { @@ -127,8 +139,11 @@ cnt++; } string NS = numb.ToString(); - while (NS.Length < cnt) NS = '0' + NS; - return mask.Replace(mask.Substring(star - cnt, cnt), NS); ; + while (NS.Length < cnt) + { + NS = '0' + NS; + } + return mask.Replace(mask.Substring(star - cnt, cnt), NS); } public string InName; @@ -155,8 +170,10 @@ string curInPath = ProblemPath + MaskToString(FolderName,cnt+1)+"\\"+MaskToString(InName,cnt+1); string curOutPath = ProblemPath + MaskToString(FolderName, cnt+1) + "\\" + MaskToString(OutName, cnt+1); string curPointPath = ProblemPath + MaskToString(FolderName, cnt+1) + "\\" + MaskToString(PointName, cnt+1); - if (File.Exists(curInPath)||File.Exists(curOutPath)||File.Exists(curPointPath)) - cnt++; + if (File.Exists(curInPath) || File.Exists(curOutPath) || File.Exists(curPointPath)) + { + cnt++; + } else break; } Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Main/TestEnvClass.cs 2008-12-06 13:12:31 UTC (rev 434) @@ -1,4 +1,9 @@ -using System; +/* + This file includes definition of class TestEnv, that encapsulates all features of Tester. + Only this file should be used by user. +*/ + +using System; using System.IO; using Test; using Load; @@ -16,25 +21,27 @@ { public string ProblemPath; public string TempPath; - public string CompPath; + public int LangID; //language ID, that stores in CompIDs.txt public string Source; public Compiler comp; public Runner run; - public TestEnv(string Source,string CompPath,string TempPath,string ProblemPath) + public TestEnv(string Source,int LangID,string TempPath,string ProblemPath) { try { this.Source = Source; this.TempPath = Path.GetFullPath(TempPath); if (!Directory.Exists(this.TempPath)) + { Directory.CreateDirectory(this.TempPath); - this.CompPath = Path.GetFullPath(CompPath); - if (!File.Exists(this.CompPath)) - throw new FileNotFoundException("Compiler file do not exists!"); + } + this.LangID = LangID; this.ProblemPath = Path.GetFullPath(ProblemPath); if (!Directory.Exists(this.ProblemPath)) + { throw new DirectoryNotFoundException("Problem path do not exists!"); + } } catch (Exception e) { @@ -49,16 +56,24 @@ if (comp == null) { if (!File.Exists(ProblemPath + "ProblemData.txt")) + { throw new FileNotFoundException("ProblemData.txt do not exists"); + } DataLoader dat = new DataLoader(ProblemPath + "ProblemData.txt"); if (!dat.Load()) + { throw new FileLoadException("Can not load data from ProblemData.txt"); + } if (!File.Exists("TesterInData.txt")) + { throw new FileNotFoundException("TesterInData.txt do not exists"); + } string[] InData = System.IO.File.ReadAllLines("TesterInData.txt"); if (InData.Length < 1) + { throw new FileLoadException("Can not load data from ProblemData.txt"); + } int buf; try { @@ -69,7 +84,7 @@ throw new FileLoadException("Can not load sleep time from TesterInData.txt " + e.Message); } - comp = new Compiler(CompPath, Source, TempPath, dat.CompilationTimeLimit, buf); + comp = new Compiler(LangID, Source, TempPath, dat.CompilationTimeLimit, buf); } comp.Compile(); } @@ -83,6 +98,7 @@ { RunAllTests(SecureType.Double,true); } + public void RunAllTests(SecureType SecType) { RunAllTests(SecType,true); @@ -95,7 +111,9 @@ if (run == null) { if (comp == null) + { throw new TesterException("You should first compile source before running tests!"); + } run = new Runner(SecType, ProblemPath, comp.ExeFile, TempPath, comp.CONST_SLEEP); } run.TestAll = TestAll; @@ -119,7 +137,9 @@ if (run == null) { if (comp == null) + { throw new TesterException("You should first compile source before running tests!"); + } run = new Runner(SecType, ProblemPath, comp.ExeFile, TempPath, comp.CONST_SLEEP); } run.ExecuteTest(index); Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/Program.cs 2008-12-06 13:12:31 UTC (rev 434) @@ -1,4 +1,8 @@ -using System; +/* + This file is just a small program, used to test all features of tester. +*/ + +using System; using System.Collections.Generic; using System.Text; using System.IO; @@ -13,10 +17,10 @@ { Console.SetOut(File.CreateText("D:\\logout.txt")); string[] data=File.ReadAllLines("InData.txt"); - for (int ind = 1; ind <= 5; ind++) + for (int ind = 1; ind <= 1; ind++) { string src = File.ReadAllText("src\\source" + ind.ToString() + ".txt"); - TestEnv test = new TestEnv(src, data[0], data[1], data[2]); + TestEnv test = new TestEnv(src, Convert.ToInt32(data[0]), data[1], data[2]); test.Compile(); Console.WriteLine("------------------BEGIN SOURCE #"+ind.ToString()+"--------------------------"); Console.WriteLine(src); Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/AllowedFunc.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/AllowedFunc.txt 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/AllowedFunc.txt 2008-12-06 13:12:31 UTC (rev 434) @@ -54,4 +54,52 @@ kernel32.dll GetFileSize kernel32.dll GetFileType kernel32.dll CreateFileA -kernel32.dll CloseHandle \ No newline at end of file +kernel32.dll CloseHandle + +kernel32.dll HeapFree +kernel32.dll HeapAlloc +kernel32.dll GetProcessHeap +kernel32.dll FreeEnvironmentStringsA +kernel32.dll GetEnvironmentStrings +kernel32.dll FreeEnvironmentStringsW +kernel32.dll GetEnvironmentStringsW +kernel32.dll SetHandleCount +kernel32.dll TlsAlloc +kernel32.dll TlsFree +kernel32.dll InterlockedIncrement +kernel32.dll SetLastError +kernel32.dll InterlockedDecrement +kernel32.dll HeapDestroy +kernel32.dll HeapCreate +kernel32.dll QueryPerformanceCounter +kernel32.dll GetTickCount +kernel32.dll GetCurrentProcessId +kernel32.dll GetSystemTimeAsFileTime +kernel32.dll TerminateProcess +kernel32.dll GetCurrentProcess +kernel32.dll SetUnhandledExceptionFilter +kernel32.dll IsDebuggerPresent +kernel32.dll LoadLibraryA +kernel32.dll Sleep +kernel32.dll GetOEMCP +kernel32.dll HeapReAlloc +kernel32.dll HeapSize +kernel32.dll MultiByteToWideChar +kernel32.dll LCMapStringA +kernel32.dll LCMapStringW +kernel32.dll GetStringTypeA +kernel32.dll GetStringTypeW + +kernel32.dll InterlockedExchange +kernel32.dll GetUserDefaultLCID +kernel32.dll EnumSystemLocalesA +kernel32.dll IsValidLocale +kernel32.dll IsValidCodePage +kernel32.dll GetConsoleCP +kernel32.dll GetConsoleMode +kernel32.dll FlushFileBuffers +kernel32.dll GetLocaleInfoW +kernel32.dll WriteConsoleA +kernel32.dll GetConsoleOutputCP +kernel32.dll WriteConsoleW +kernel32.dll SetStdHandle \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/CompIDs.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/CompIDs.txt (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/CompIDs.txt 2008-12-06 13:12:31 UTC (rev 434) @@ -0,0 +1,2 @@ +1 Compiler\VC6\VS.bat +2 Compiler\D7\D7.bat \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/InData.txt =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/InData.txt 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/InData.txt 2008-12-06 13:12:31 UTC (rev 434) @@ -1,3 +1,3 @@ -Compiler\D7.bat +1 Temp\ Problem\ \ No newline at end of file Property changes on: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7 ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7/D7.bat =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7/D7.bat (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7/D7.bat 2008-12-06 13:12:31 UTC (rev 434) @@ -0,0 +1 @@ +DCC32.EXE -CC %1 -E%2 \ No newline at end of file Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7/dcc32.cfg =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7/dcc32.cfg (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7/dcc32.cfg 2008-12-06 13:12:31 UTC (rev 434) @@ -0,0 +1 @@ +-u"includeD7" Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7.bat =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7.bat 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/D7.bat 2008-12-06 13:12:31 UTC (rev 434) @@ -1 +0,0 @@ -DCC32.EXE -CC %1 -E%2 \ No newline at end of file Property changes on: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/VC6 ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/VC6/VS.bat =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/VC6/VS.bat (rev 0) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/VC6/VS.bat 2008-12-06 13:12:31 UTC (rev 434) @@ -0,0 +1 @@ +cl /EHsc /TP /Za /O1 /IincludeVS /D ONLINE_JUDGE /Fe%2source.exe" %1 /link /LIBPATH:includeVS \ No newline at end of file Property changes on: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/VC6/includeVS ___________________________________________________________________ Added: tsvn:logminsize + 5 Deleted: ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/dcc32.cfg =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/dcc32.cfg 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/SourceTest 2.0/bin/Debug/compiler/dcc32.cfg 2008-12-06 13:12:31 UTC (rev 434) @@ -1 +0,0 @@ --u"includeD7" Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-12-06 13:12:31 UTC (rev 434) @@ -3,9 +3,50 @@ using namespace System::IO; using namespace System::Diagnostics; -Compiler::Compiler(String^ CompPath, String^ Source, String^ TempPath, int CompilationTimeLimit, int WaitForFile) +String^ Compiler::GetCompFromID(int LangID) //resolves ID to compiler's path { - comppath=CompPath; + if (!File::Exists("CompIDs.txt")) + { + throw gcnew FileNotFoundException("Can not find file CompIDs.txt"); + } + StreamReader^ f = File::OpenText("CompIDs.txt"); + String^ res = ""; + while (!f->EndOfStream) + { + array<String^>^ param = f->ReadLine()->Split(' '); + if (param->Length < 2) continue; + try + { + int curID = Convert::ToInt32(param[0]); + if (curID == LangID) + { + res=""; + for (int i=1;i<param->Length;i++) + { + res += param[i]+" "; + } + } + } + catch (System::Exception^) + { + throw gcnew FileLoadException("Can not load data from CompIDs.txt"); + } + } + if (res=="") + { + throw gcnew FileLoadException("Can not load data from CompIDs.txt"); + } + return res; +} + +Compiler::Compiler(int LangID, String^ Source, String^ TempPath, int CompilationTimeLimit, int WaitForFile) +{ + comppath=GetCompFromID(LangID); + comppath=Path::GetFullPath(comppath); + if (!File::Exists(comppath)) + { + throw gcnew FileNotFoundException("Can not find compiler!"); + } source=Source; temp=TempPath; ExeFile=TempPath+"source.exe"; @@ -42,9 +83,15 @@ System::Threading::Thread::Sleep(CONST_SLEEP); for (int i=0;i<CONST_SLEEP;i++) + { if (!File::Exists(srcpath)) - System::Threading::Thread::Sleep(5); else + { + System::Threading::Thread::Sleep(5); + } else + { break; + } + } si->FileName=comppath; si->Arguments="\""+srcpath+"\" \""+temp; @@ -63,9 +110,15 @@ UsedTime=comp->TotalProcessorTime; for (int i=0;i<CONST_SLEEP;i++) + { if (!File::Exists(ExeFile)) - System::Threading::Thread::Sleep(5); else + { + System::Threading::Thread::Sleep(5); + } else + { break; + } + } if (!File::Exists(ExeFile)) //compilation error { Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.h 2008-12-06 13:12:31 UTC (rev 434) @@ -22,6 +22,7 @@ String^ comppath; String^ source; String^ temp; + String^ GetCompFromID(int LangID); public: String^ Details; CompRes Result; @@ -31,7 +32,7 @@ int TL; int CONST_SLEEP; - Compiler(String^ CompPath, String^ Source, String^ TempPath, int CompilationTimeLimit, int WaitForFile); + Compiler(int LangID, String^ Source, String^ TempPath, int CompilationTimeLimit, int WaitForFile); void Compile(); }; } \ No newline at end of file Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-12-06 13:12:31 UTC (rev 434) @@ -8,9 +8,9 @@ UserSecure::UserSecure() { - process=NULL; - thread=NULL; - err=0; + process=NULL; + thread=NULL; + err=0; } BOOL UserSecure::SetUserObjectFullAccess(HANDLE hUserObject) @@ -39,86 +39,92 @@ bool UserSecure::Init(LPWSTR lpApplicationName) { - FILE* f=_wfopen(L"TesterInData.txt",L"r"); - if (f==NULL) - { - Details="Cannot open TesterInData.txt"; - return false; - } - int buf=0; - fwscanf(f,L"%d %s %s",&buf,&USER_NAME,&USER_PASSW); - fclose(f); + FILE* f=_wfopen(L"TesterInData.txt",L"r"); + if (f==NULL) + { + Details="Cannot open TesterInData.txt"; + return false; + } + int buf=0; + fwscanf(f,L"%d %s %s",&buf,&USER_NAME,&USER_PASSW); + fclose(f); - if (!SetUserObjectFullAccess(GetThreadDesktop(GetCurrentThreadId()))) - { - Details="Cannot SetUserObjectFullAccess(GetThreadDesktop(GetCurrentThreadId())). Error#"+ToStr(GetLastError()); - return false; //needed for accessing from CreateProcessAsUser - } - if (!SetUserObjectFullAccess( GetProcessWindowStation())) - { - Details="Cannot SetUserObjectFullAccess( GetProcessWindowStation()). Error#"+ToStr(GetLastError()); - return false; //needed for accessing from CreateProcessAsUser - } + if (!SetUserObjectFullAccess(GetThreadDesktop(GetCurrentThreadId()))) + { + Details="Cannot SetUserObjectFullAccess(GetThreadDesktop(GetCurrentThreadId())). Error#"+ToStr(GetLastError()); + return false; //needed for accessing from CreateProcessAsUser + } + if (!SetUserObjectFullAccess( GetProcessWindowStation())) + { + Details="Cannot SetUserObjectFullAccess(GetProcessWindowStation()). Error#"+ToStr(GetLastError()); + return false; //needed for accessing from CreateProcessAsUser + } - USER_INFO_1 ui; - NET_API_STATUS st; - ui.usri1_comment=NULL; - ui.usri1_flags=UF_SCRIPT|UF_PASSWD_CANT_CHANGE|UF_DONT_EXPIRE_PASSWD; - ui.usri1_home_dir=NULL; - ui.usri1_name=USER_NAME; - ui.usri1_password=USER_PASSW; - ui.usri1_priv=USER_PRIV_USER; - ui.usri1_script_path=NULL; - st=NetUserAdd(NULL,1,(LPBYTE)&ui,NULL); //trying to create new user - bool userex=false; - if (st!=NERR_Success) - { - if (st==NERR_UserExists) - userex=true; else - { - Details="Cannot create user. Error#"+ToStr(GetLastError()); - return false; - } - } - if (!userex) - { - array<DriveInfo^>^ drv=DriveInfo::GetDrives(); - for (int i=0;i<drv->Length;i++) //for all fixed drives set limitation - if (drv[i]->DriveType==DriveType::Fixed) - DenyAccessFolder(drv[i]->Name); - wchar_t buf[MAX_PATH+1]; - GetEnvironmentVariableW(L"ProgramFiles",buf,MAX_PATH); - DenyAccessFolder(gcnew String(buf)); - GetEnvironmentVariable(L"ALLUSERSPROFILE",buf,MAX_PATH); - DenyAccessFolder(gcnew String(buf)); - GetWindowsDirectory(buf,MAX_PATH); - DenyAccessFolder(gcnew String(buf)); - GetSystemDirectory(buf,MAX_PATH); - DenyAccessFolder(gcnew String(buf)); - DWORD size=MAX_PATH; - GetProfilesDirectory(buf,&size); - DenyAccessFolder(gcnew String(buf)); - Details="User created. "; - } else - Details="User exists. "; - return true; + USER_INFO_1 ui; + NET_API_STATUS st; + ui.usri1_comment=NULL; + ui.usri1_flags=UF_SCRIPT|UF_PASSWD_CANT_CHANGE|UF_DONT_EXPIRE_PASSWD; + ui.usri1_home_dir=NULL; + ui.usri1_name=USER_NAME; + ui.usri1_password=USER_PASSW; + ui.usri1_priv=USER_PRIV_USER; + ui.usri1_script_path=NULL; + st=NetUserAdd(NULL,1,(LPBYTE)&ui,NULL); //trying to create new user + bool userex=false; + if (st!=NERR_Success) + { + if (st==NERR_UserExists) + { + userex=true; + } else + { + Details="Cannot create user. Error#"+ToStr(GetLastError()); + return false; + } + } + if (!userex) + { + array<DriveInfo^>^ drv=DriveInfo::GetDrives(); + for (int i=0;i<drv->Length;i++) //for all fixed drives set limitation + { + if (drv[i]->DriveType==DriveType::Fixed) + { + DenyAccessFolder(drv[i]->Name); + } + } + wchar_t buf[MAX_PATH+1]; + GetEnvironmentVariableW(L"ProgramFiles",buf,MAX_PATH); + DenyAccessFolder(gcnew String(buf)); + GetEnvironmentVariable(L"ALLUSERSPROFILE",buf,MAX_PATH); + DenyAccessFolder(gcnew String(buf)); + GetWindowsDirectory(buf,MAX_PATH); + DenyAccessFolder(gcnew String(buf)); + GetSystemDirectory(buf,MAX_PATH); + DenyAccessFolder(gcnew String(buf)); + DWORD size=MAX_PATH; + GetProfilesDirectory(buf,&size); + DenyAccessFolder(gcnew String(buf)); + Details="User created. "; + } else + Details="User exists. "; + return true; } BOOL UserSecure::AddPrivilege(HANDLE hToken,LPCTSTR lpszPrivilege) { -TOKEN_PRIVILEGES tp; -LUID luid; -if (!LookupPrivilegeValue( NULL,lpszPrivilege,&luid)) - return FALSE; -tp.PrivilegeCount = 1; -tp.Privileges[0].Luid = luid; -tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; + TOKEN_PRIVILEGES tp; + LUID luid; + if (!LookupPrivilegeValue( NULL,lpszPrivilege,&luid)) + return FALSE; + tp.PrivilegeCount = 1; + tp.Privileges[0].Luid = luid; + tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; -if ( !AdjustTokenPrivileges(hToken,FALSE,&tp,sizeof(TOKEN_PRIVILEGES),(PTOKEN_PRIVILEGES) NULL,(PDWORD) NULL) ) - return FALSE; -if (GetLastError() == ERROR_NOT_ALL_ASSIGNED) - return FALSE; -return TRUE; + if (!AdjustTokenPrivileges(hToken,FALSE,&tp,sizeof(TOKEN_PRIVILEGES),(PTOKEN_PRIVILEGES)NULL,(PDWORD)NULL)) + return FALSE; + if (GetLastError() == ERROR_NOT_ALL_ASSIGNED) + return FALSE; + return TRUE; } bool UserSecure::CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo) @@ -186,151 +192,153 @@ bool UserSecure::CheckSecure() { - return false; //NoDF + return false; //NoDF } void UserSecure::Finalize() { - if (process!=NULL) - CloseHandle(process); - if (thread!=NULL) - CloseHandle(thread); + if (process!=NULL) + CloseHandle(process); + if (thread!=NULL) + CloseHandle(thread); } SysCallSecure::SysCallSecure() { -process=NULL; -thread=NULL; -err=0; + process=NULL; + thread=NULL; + err=0; } bool SysCallSecure::Init(LPWSTR lpApplicationName) { -HasDF=false; -FILE* f=fopen("AllowedFunc.txt","r"); -if (f==NULL) -{ - Details="Cannot open AllowedFunc.txt"; - return false; -} -vector<TFunc> allowed; -char mod_name[256],func_name[256]; -while (fscanf(f,"%s %s",mod_name,func_name)==2) -{ - TFunc func; - func.Name=func_name; - func.Module=mod_name; - allowed.push_back(func); -} -fclose(f); + HasDF=false; + FILE* f=fopen("AllowedFunc.txt","r"); + if (f==NULL) + { + Details="Cannot open AllowedFunc.txt"; + return false; + } + vector<TFunc> allowed; + char mod_name[256],func_name[256]; + while (fscanf(f,"%s %s",mod_name,func_name)==2) + { + TFunc func; + strcpy_s(func.Name,256,func_name); + strcpy_s(func.Module,256,mod_name); + allowed.push_back(func); + } + fclose(f); -HMODULE hmodCaller=LoadLibrary(lpApplicationName); -if (hmodCaller==NULL) -{ - Details="Can not load module. Error#"+ToStr(err=GetLastError()); - return false; -} -ULONG ulSize; -PIMAGE_IMPORT_DESCRIPTOR pImportDesc = (PIMAGE_IMPORT_DESCRIPTOR) ImageDirectoryEntryToData(hmodCaller,TRUE,IMAGE_DIRECTORY_ENTRY_IMPORT,&ulSize); -if (pImportDesc!=NULL) -{ -for (;pImportDesc->Name; pImportDesc++) -{ - PSTR pszModName = (PSTR)((PBYTE) hmodCaller + pImportDesc->Name); - PIMAGE_THUNK_DATA pThunk = (PIMAGE_THUNK_DATA)((PBYTE) hmodCaller + pImportDesc->FirstThunk); - for (; pThunk->u1.Function; pThunk++) - { - if ((pThunk->u1.Function&(1<<31))!=0) - continue; - PSTR NAME=(PSTR)((PIMAGE_IMPORT_BY_NAME)((PBYTE)hmodCaller+pThunk->u1.AddressOfData))->Name; - - bool allow=false; - for (unsigned i=0;i<allowed.size();i++) - if ((allowed[i].Name==string(NAME))&&(allowed[i].Module==string(pszModName))) + HMODULE hmodCaller=LoadLibrary(lpApplicationName); + if (hmodCaller==NULL) { - allow=true; - break; + Details="Can not load module. Error#"+ToStr(err=GetLastError()); + return false; } - if (!allow) - { - HasDF=true; - Details="Import DF. \""+string(NAME)+"\" from module \""+string(pszModName)+"\" "; - FreeLibrary(hmodCaller); - return true; - } - } + ULONG ulSize; + PIMAGE_IMPORT_DESCRIPTOR pImportDesc = (PIMAGE_IMPORT_DESCRIPTOR) ImageDirectoryEntryToData(hmodCaller,TRUE,IMAGE_DIRECTORY_ENTRY_IMPORT,&ulSize); + if (pImportDesc!=NULL) + { + for (;pImportDesc->Name; pImportDesc++) + { + PSTR pszModName = (PSTR)((PBYTE) hmodCaller + pImportDesc->Name); + PIMAGE_THUNK_DATA pThunk = (PIMAGE_THUNK_DATA)((PBYTE) hmodCaller + pImportDesc->FirstThunk); + for (; pThunk->u1.Function; pThunk++) + { + if ((pThunk->u1.Function&(1<<31))!=0) + continue; + PSTR NAME=(PSTR)((PIMAGE_IMPORT_BY_NAME)((PBYTE)hmodCaller+pThunk->u1.AddressOfData))->Name; + + bool allow=false; + for (unsigned i=0;i<allowed.size();i++) + { + if ((strcmp(allowed[i].Name,NAME)==0)&&(stricmp(allowed[i].Module,pszModName)==0)) + { + allow=true; + break; + } + } + if (!allow) + { + HasDF=true; + Details="Import DF. \""+string(NAME)+"\" from module \""+string(pszModName)+"\" "; + FreeLibrary(hmodCaller); + return true; + } + } + } + } + FreeLibrary(hmodCaller); + return true; } -} -FreeLibrary(hmodCaller); -return true; -} bool SysCallSecure::CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo) { -PROCESS_INFORMATION pi;ZeroMemory(&pi,sizeof(pi)); -if (!CreateProcess(lpApplicationName,NULL,NULL,NULL,bInheritHandles,dwCreationFlags,NULL,NULL,lpStartupInfo,&pi)) -{ - Details+="Cannot create process. Error#"+ToStr(err=GetLastError()); - return false; -} -process=pi.hProcess; -thread=pi.hThread; + PROCESS_INFORMATION pi;ZeroMemory(&pi,sizeof(pi)); + if (!CreateProcess(lpApplicationName,NULL,NULL,NULL,bInheritHandles,dwCreationFlags,NULL,NULL,lpStartupInfo,&pi)) + { + Details+="Cannot create process. Error#"+ToStr(err=GetLastError()); + return false; + } + process=pi.hProcess; + thread=pi.hThread; -Details+="Process created."; -return true; + Details+="Process created."; + return true; } bool SysCallSecure::CheckSecure() { -return HasDF; + return HasDF; } void SysCallSecure::Finalize() { -if (process!=NULL) - CloseHandle(process); -if (thread!=NULL) - CloseHandle(thread); + if (process!=NULL) + CloseHandle(process); + if (thread!=NULL) + CloseHandle(thread); } NoneSecure::NoneSecure() { -process=NULL; -thread=NULL; -err=0; + process=NULL; + thread=NULL; + err=0; } bool NoneSecure::Init(LPWSTR lpApplicationName) { -return true; + return true; } bool NoneSecure::CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo) { -PROCESS_INFORMATION pi;ZeroMemory(&pi,sizeof(pi)); -if (CreateProcess(lpApplicationName,NULL,NULL,NULL,bInheritHandles,dwCreationFlags,NULL,NULL,lpStartupInfo,&pi)) -{ - process=pi.hProcess; - thread=pi.hThread; - Details="Process created."; - return true; + PROCESS_INFORMATION pi;ZeroMemory(&pi,sizeof(pi)); + if (CreateProcess(lpApplicationName,NULL,NULL,NULL,bInheritHandles,dwCreationFlags,NULL,NULL,lpStartupInfo,&pi)) + { + process=pi.hProcess; + thread=pi.hThread; + Details="Process created."; + return true; + } + err=GetLastError(); + Details="Cannot create process. Error#"+ToStr(err); + return false; } -err=GetLastError(); -Details="Cannot create process. Error#"+ToStr(err); -return false; -} bool NoneSecure::CheckSecure() { -return false; //No DF + return false; //No DF } void NoneSecure::Finalize() { -if (process!=NULL) - CloseHandle(process); -if (thread!=NULL) - CloseHandle(thread); + if (process!=NULL) + CloseHandle(process); + if (thread!=NULL) + CloseHandle(thread); } DoubleSecure::DoubleSecure() Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.h 2008-12-06 13:12:31 UTC (rev 434) @@ -13,16 +13,39 @@ { protected: int err; - string ToStr(int x) {char c[15]; _itoa_s(x,c,10); return string(c);}; + string ToStr(int x) + { + char c[15]; + _itoa_s(x,c,10); + return string(c); + }; + public: string Details; HANDLE process; HANDLE thread; - virtual bool Init(LPWSTR lpApplicationName) {return true;}; - virtual bool CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo) {return true;}; - virtual bool CheckSecure() {return true;}; + + virtual bool Init(LPWSTR lpApplicationName) + { + return true; + }; + + virtual bool CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo) + { + return true; + }; + + virtual bool CheckSecure() + { + return true; + }; + virtual void Finalize() {}; - virtual int LastError() {return err;}; + + virtual int LastError() + { + return err; + } }; public class UserSecure: public BasicSecure @@ -43,8 +66,8 @@ private struct TFunc { - string Name; - string Module; + char Name[256]; + char Module[256]; }; public class SysCallSecure:public BasicSecure @@ -69,7 +92,10 @@ bool CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo); bool CheckSecure(); void Finalize(); - int LastError() {return syssec->LastError(); } + int LastError() + { + return syssec->LastError(); + } }; public class NoneSecure:public BasicSecure Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-11-07 10:17:40 UTC (rev 433) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-12-06 13:12:31 UTC (rev 434) @@ -11,16 +11,22 @@ SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS); //for better testing initlock(); if (!File::Exists(ProblemPath + "ProblemData.txt")) + { throw gcnew FileNotFoundException("ProblemData not found!"); + } data = gcnew DataLoader(ProblemPath + "ProblemData.txt"); if (!data->Load()) + { throw gcnew FileLoadException("Can not load problem data!"); + } testfield=gcnew TestLoader(data->InputName,data->OutputName,data->PointFileName,data->TestFolderName,ProblemPath); testfield->Load(); results=gcnew array<TestRes^>(testfield->tests->Length); plug=gcnew PluginLoader(System::IO::Path::GetFullPath(data->CheckPlugin)); if (!plug->Load()) + { throw gcnew FileLoadException("Can not load Plugin!"); + } exe=ExeFile; prob=ProblemPath; temp=TempPath; @@ -31,288 +37,295 @@ bool Runner::ExecuteTest(int index) //returns false if not AC verdict { -STARTUPINFO si;ZeroMemory(&si,sizeof(si)); -SECURITY_ATTRIBUTES secdesc; -secdesc.bInheritHandle=TRUE; -secdesc.nLength=sizeof(secdesc); -secdesc.lpSecurityDescriptor=NULL; -JOBOBJECT_BASIC_ACCOUNTING_INFORMATION acc; -JOBOBJECT_EXTENDED_LIMIT_INFORMATION mem; -HANDLE job=NULL; -JOBOBJECT_ASSOCIATE_COMPLETION_PORT port; ZeroMemory(&port,sizeof(port)); -JOBOBJECT_BASIC_UI_RESTRICTIONS uilim; -DWORD len=0; -wchar_t* bufW; -TestRes^ result=gcnew TestRes(); -BasicSecure* sec=NULL; -try -{ - if (SecType==SecureType::None) - sec=new NoneSecure(); else - if (SecType==SecureType::User) - sec=new UserSecure(); else - if (SecType==SecureType::SysCall) - sec=new SysCallSecure(); else - if (SecType==SecureType::Double) - sec=new DoubleSecure(); - lock(); - String^ oupath=temp+"out"+index.ToString()+".txt"; - String^ erpath=temp+"err"+index.ToString()+".txt"; - unlock(); - String^ inpath=test->tests[index-1]->InPath; - - si.cb=sizeof(si); - si.dwFlags=STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW; - si.wShowWindow=FALSE; - si.hStdInput= CreateFile(bufW=(wchar_t*)Marshal::StringToHGlobalUni(inpath).ToPointer(),GENERIC_READ,FILE_SHARE_READ,&secdesc,OPEN_EXISTING,0,NULL); Marshal::FreeHGlobal(IntPtr(bufW)); - si.hStdOutput=CreateFile(bufW=(wchar_t*)Marshal::StringToHGlobalUni(oupath).ToPointer(),GENERIC_WRITE,0,&secdesc,CREATE_ALWAYS,0,NULL); Marshal::FreeHGlobal(IntPtr(bufW)); - si.hStdError=CreateFile(bufW=(wchar_t*)Marshal::StringToHGlobalUni(erpath).ToPointer(),GENERIC_WRITE,FILE_SHARE_WRITE,&secdesc,CREATE_ALWAYS,0,NULL); Marshal::FreeHGlobal(IntPtr(bufW)); + STARTUPINFO si;ZeroMemory(&si,sizeof(si)); + SECURITY_ATTRIBUTES secdesc; + secdesc.bInheritHandle=TRUE; + secdesc.nLength=sizeof(secdesc); + secdesc.lpSecurityDescriptor=NULL; + JOBOBJECT_BASIC_ACCOUNTING_INFORMATION acc; + JOBOBJECT_EXTENDED_LIMIT_INFORMATION mem; + HANDLE job=NULL; + JOBOBJECT_ASSOCIATE_COMPLETION_PORT port; ZeroMemory(&port,sizeof(port)); + JOBOBJECT_BASIC_UI_RESTRICTIONS uilim; + DWORD len=0; + wchar_t* bufW; + TestRes^ result=gcnew TestRes(); + BasicSecure* sec=NULL; + try + { + lock(); + if (SecType==SecureType::None) + sec=new NoneSecure(); else + if (SecType==SecureType::User) + sec=new UserSecure(); else + if (SecType==SecureType::SysCall) + sec=new SysCallSecure(); else + if (SecType==SecureType::Double) + sec=new DoubleSecure(); + String^ oupath=temp+"out"+index.ToString()+".txt"; + String^ erpath=temp+"err"+index.ToString()+".txt"; + unlock(); + String^ inpath=test->tests[index-1]->InPath; + + si.cb=sizeof(si); + si.dwFlags=STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW; + si.wShowWindow=FALSE; + si.hStdInput= CreateFile(bufW=(wchar_t*)Marshal::StringToHGlobalUni(inpath).ToPointer(),GENERIC_READ,FILE_SHARE_READ,&secdesc,OPEN_EXISTING,0,NULL); Marshal::FreeHGlobal(IntPtr(bufW)); + si.hStdOutput=CreateFile(bufW=(wchar_t*)Marshal::StringToHGlobalUni(oupath).ToPointer(),GENERIC_WRITE,0,&secdesc,CREATE_ALWAYS,0,NULL); Marshal::FreeHGlobal(IntPtr(bufW)); + si.hStdError=CreateFile(bufW=(wchar_t*)Marshal::StringToHGlobalUni(erpath).ToPointer(),GENERIC_WRITE,FILE_SHARE_WRITE,&secdesc,CREATE_ALWAYS,0,NULL); Marshal::FreeHGlobal(IntPtr(bufW)); - SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT|SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX); - lock(); - bufW=(wchar_t*)Marshal::StringToHGlobalUni(exe).ToPointer(); - unlock(); + SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT|SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX); + lock(); + bufW=(wchar_t*)Marshal::StringToHGlobalUni(exe).ToPointer(); + bool Succed=sec->Init(bufW); + unlock(); - if (!sec->Init(bufW)) - { - int err=sec->LastError(); - if ((err==193)||(err==1455)) + if (!Succed) { - result->res=TestResult::RuntimeError; - result->Details=gcnew String(sec->Details.c_str())+" Too large array"; - } else + int err=sec->LastError(); + if ((err==193)||(err==1455)) + { + result->res=TestResult::RuntimeError; + result->Details=gcnew String(sec->Details.c_str())+" Too large array"; + } else + { + result->res=TestResult::InternalError; + result->Details=gcnew String(sec->Details.c_str())+" Can not init secure"; + } + Marshal::FreeHGlobal(IntPtr(bufW)); + return false; + } + + if (sec->CheckSecure()) { - result->res=TestResult::InternalError; - result->Details=gcnew String(sec->Details.c_str())+" Can not init secure"; + result->res=TestResult::DestrictedFunction; + result->Details=gcnew String(sec->Details.c_str())+"Destricted function."; + Marshal::FreeHGlobal(IntPtr(bufW)); + return false; } - Marshal::FreeHGlobal(IntPtr(bufW)); - return false; - } - if (sec->CheckSecure()) - { - result->res=TestResult::DestrictedFunction; - result->Details=gcnew String(sec->Details.c_str())+"Destricted function."; - Marshal::FreeHGlobal(IntPtr(bufW)); - return false; - } - - if (!sec->CreateProc(bufW,TRUE,CREATE_SUSPENDED|CREATE_NO_WINDOW|ABOVE_NORMAL_PRIORITY_CLASS,&si)) - { - Marshal::FreeHGlobal(IntPtr(bufW)); - int err=sec->LastError(); - if ((err==193)||(err==1455)) + if (!sec->CreateProc(bufW,TRUE,CREATE_SUSPENDED|CREATE_NO_WINDOW|ABOVE_NORMAL_PRIORITY_CLASS,&si)) { - result->res=TestResult::RuntimeError; - result->Details=gcnew String(sec->Details.c_str())+" Too large array"; - } else - { - if (!sec->CheckSecure()) + Marshal::FreeHGlobal(IntPtr(bufW)); + int err=sec->LastError(); + if ((err==193)||(err==1455)) { - result->res=TestResult::InternalError; - result->Details=gcnew String(sec->Details.c_str())+" Can not start process"; + result->res=TestResult::RuntimeError; + result->Details=gcnew String(sec->Details.c_str())+" Too large array"; } else { - result->res=TestResult::DestrictedFunction; - result->Details=gcnew String(sec->Details.c_str())+" Destricted function"; + if (!sec->CheckSecure()) + { + result->res=TestResult::InternalError; + result->Details=gcnew String(sec->Details.c_str())+" Can not start process"; + } else + { + result->res=TestResult::DestrictedFunction; + result->Details=gcnew String(sec->Details.c_str())+" Destricted function"; + } } + return false; } - return false; - } - Marshal::FreeHGlobal(IntPtr(bufW)); + Marshal::FreeHGlobal(IntPtr(bufW)); - job=CreateJobObject(NULL,NULL); - mem.BasicLimitInformation.LimitFlags=JOB_OBJECT_LIMIT_JOB_MEMORY; - mem.JobMemoryLimit=data->MemoryLimit; - SetInformationJobObject(job,JobObjectExtendedLimitInformation,&mem,sizeof(mem)); - port.CompletionKey=(void*)index; - port.CompletionPort=CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, 0); - SetInformationJobObject(job,JobObjectAssociateCompletionPortInformation,&port,sizeof(port)); - - uilim.UIRestrictionsClass=JOB_OBJECT_UILIMIT_ALL; - SetInformationJobObject(job,JobObjectBasicUIRestrictions,&uilim,sizeof(uilim)); + job=CreateJobObject(NULL,NULL); + mem.BasicLimitInformation.LimitFlags=JOB_OBJECT_LIMIT_JOB_MEMORY; + mem.JobMemoryLimit=data->MemoryLimit; + SetInformationJobObject(job,JobObjectExtendedLimitInformation,&mem,sizeof(mem)); + port.CompletionKey=(void*)index; + port.CompletionPort=CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, 0); + SetInformationJobObject(job,JobObjectAssociateCompletionPortInformation,&port,sizeof(port)); + + uilim.UIRestrictionsClass=JOB_OBJECT_UILIMIT_ALL; + SetInformationJobObject(job,JobObjectBasicUIRestrictions,&uilim,sizeof(uilim)); - AssignProcessToJobObject(job,sec->process); + AssignProcessToJobObject(job,sec->process); - ResumeThread(sec->thread); + ResumeThread(sec->thread); - DWORD start=GetTickCount(); - while (true) - { + DWORD start=GetTickCount(); + while (true) + { + if (plug->p->OutputLimit((int)GetFileSize(si.hStdOutput,NULL),data->OutputLimit,result->Details)) + { + TerminateJobObject(job,0); + result->res=TestResult::OutputLimit; + break; + } + QueryInformationJobObject(job,JobObjectBasicAccountingInformation,&acc,sizeof(acc),NULL); + if (plug->p->RealTimeLimit((int)(GetTickCount()-start),data->RealTimeLimit,result->Details)) + { + TerminateJobObject(job,0); + result->res=TestResult::RealTimeLimit; + break; + } + if (plug->p->TimeLimit((int)((acc.TotalUserTime.QuadPart)/10000),data->TimeLimit,result->Details)) + { + TerminateJobObject(job,0); + result->res=TestResult::TimeLimit; + break; + } + + unsigned long len,key; + HANDLE proc; + if (GetQueuedCompletionStatus(port.CompletionPort, &len, &key, (LPOVERLAPPED*)&proc, 1)&&(key==index)) + { + DWORD code=0; + bool needbreak=false; + switch(len) + { + case JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS: + GetExitCodeProcess(sec->process,&code); + if (code==5) + { + result->res=TestResult::DestrictedFunction; + result->Details="Access denied."; + } else + if (code!=0) + { + result->res=TestResult::RuntimeError; + result->Details="Runtime error #"+code.ToString(); + } + needbreak=true; + break; + case JOB_OBJECT_MSG_JOB_MEMORY_LIMIT: + result->res=TestResult::MemoryLimit; + result->Details="Memory Limit"; + needbreak=true; + break; + case JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO: + GetExitCodeProcess(sec->process,&code); + if (code==5) + { + result->res=TestResult::DestrictedFunction; + result->Details="Access denied."; + } else + if (code!=0) + { + result->res=TestResult::RuntimeError; + result->Details="Runtime error #"+code.ToString(); + } + needbreak=true; + break; + } + if (needbreak) + { + TerminateJobObject(job,0); + break; + } + } + Sleep(1); + } + + result->UsedRealTime=GetTickCount()-start; + QueryInformationJobObject(job,JobObjectExtendedLimitInformation,&mem,sizeof(mem),NULL); + QueryInformationJobObject(job,JobObjectBasicAccountingInformation,&acc,sizeof(acc),NULL); + result->UsedMemory=mem.PeakJobMemoryUsed; + result->UsedTime=(int)((acc.TotalUserTime.QuadPart)/10000); + + if (result->res!=TestResult::NotTested) + { + result->Details=gcnew String(sec->Details.c_str())+result->Details; + return false; + } + if (plug->p->OutputLimit((int)GetFileSize(si.hStdOutput,NULL),data->OutputLimit,result->Details)) { - TerminateJobObject(job,0); + result->Details=gcnew String(sec->Details.c_str())+result->Details; result->res=TestResult::OutputLimit; - break; + return false; } - QueryInformationJobObject(job,JobObjectBasicAccountingInformation,&acc,sizeof(acc),NULL); - if (plug->p->RealTimeLimit((int)(GetTickCount()-start),data->RealTimeLimit,result->Details)) + + if (plug->p->TimeLimit(result->UsedTime,data->TimeLimit,result->Details)) { - TerminateJobObject(job,0); + result->Details=gcnew String(sec->Details.c_str())+result->Details; + result->res=TestResult::TimeLimit; + return false; + } + + if (plug->p->RealTimeLimit(result->UsedRealTime,data->RealTimeLimit,result->Details)) + { + result->Details=gcnew String(sec->Details.c_str())+result->Details; result->res=TestResult::RealTimeLimit; - break; + return false; } - if (plug->p->TimeLimit((int)((acc.TotalUserTime.QuadPart)/10000),data->TimeLimit,result->Details)) + + if (plug->p->MemoryLimit(result->UsedMemory,data->MemoryLimit,result->Details)) { - TerminateJobObject(job,0); - result->res=TestResult::TimeLimit; - break; + result->Details=gcnew String(sec->Details.c_str())+result->Details; + result->res=TestResult::MemoryLimit; + return false; } - unsigned long len,key; - HANDLE proc; - if (GetQueuedCompletionStatus(port.CompletionPort, &len, &key, (LPOVERLAPPED*)&proc, 1)&&(key==index)) + CloseHandle(si.hStdOutput);si.hStdOutput=NULL; + CloseHandle(si.hStdInput);si.hStdInput=NULL; + + for (int i=0;i<CONST_SLEEP;i++) { - DWORD code=0; - bool needbreak=false; - switch(len) + if (!File::Exists(oupath)) { - case JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS: - GetExitCodeProcess(sec->process,&code); - if (code==5) - { - result->res=TestResult::DestrictedFunction; - result->Details="Access denied."; - } else - if (code!=0) - { - result->res=TestResult::RuntimeError; - result->Details="Runtime error #"+code.ToString(); - } - needbreak=true; - break; - case JOB_OBJECT_MSG_JOB_MEMORY_LIMIT: - result->res=TestResult::MemoryLimit; - result->Details="Memory Limit"; - needbreak=true; - break; - case JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO: - GetExitCodeProcess(sec->process,&code); - if (code==5) - { - result->res=TestResult::DestrictedFunction; - result->Details="Access denied."; - } else - if (code!=0) - { - result->res=TestResult::RuntimeError; - result->Details="Runtime error #"+code.ToString(); - } - needbreak=true; - break; - } - if (needbreak) + Sleep(5); + } else { - TerminateJobObject(job,0); break; } } - Sleep(1); - } - result->UsedRealTime=GetTickCount()-start; - QueryInformationJobObject(job,JobObjectExtendedLimitInformation,&mem,sizeof(mem),NULL); - QueryInformationJobObject(job,JobObjectBasicAccountingInformation,&acc,sizeof(acc),NULL); - result->UsedMemory=mem.PeakJobMemoryUsed; - result->UsedTime=(int)((acc.TotalUserTime.QuadPart)/10000); + if (!File::Exists(oupath)) + { + result->res=TestResult::WrongAnswer; + result->Details=gcnew String(sec->Details.c_str())+" No output file"; + return false; + } - if (result->res!=TestResult::NotTested) - { - result->Details=gcnew String(sec->Details.c_str())+result->Details; - return false; - } + Checker^ check=gcnew Tester::Checker(Path::GetFullPath(data->Checker),test->tests[index-1]->input,ReadAllFile(oupath),test->tests[index-1]->output); - if (plug->p->OutputLimit((int)GetFileSize(si.hStdOutput,NULL),data->OutputLimit,result->Details)) - { + switch (check->Check()) + { + case CheckResult::OE: + result->res=TestResult::OutputError; + result->Details="Output Error"; + break; + case CheckResult::PE: + result->res=TestResult::PresentationError; + result->Details="Presentation Error"; + break; + case CheckResult::WA: + result->res=TestResult::WrongAnswer; + result->Details="Wrong Answer"; + break; + case CheckResult::AC: + result->res=TestResult::Accepted; + result->Details="Accepted"; + break; + }; result->Details=gcnew String(sec->Details.c_str())+result->Details; - result->res=TestResult::OutputLimit; - return false; - } - - if (plug->p->TimeLimit(result->UsedTime,data->TimeLimit,result->Details)) + if (result->res!=TestResult::Accepted) + return false; + return true; + }finally { - result->Details=gcnew String(sec->Details.c_str())+result->Details; - result->res=TestResult::TimeLimit; - return false; + lock(); + results[index-1]=result; + unlock(); + if (sec!=NULL) + { + sec->Finalize(); + delete sec; + } + if (si.hStdInput!=NULL) + CloseHandle(si.hStdInput); + if (si.hStdOutput!=NULL) + CloseHandle(si.hStdOutput); + if (si.hStdError!=NULL) + CloseHandle(si.hStdError); + if (port.CompletionPort!=NULL) + CloseHandle(port.CompletionPort); + if (job!=NULL) + CloseHandle(job); } - - if (plug->p->RealTimeLimit(result->UsedRealTime,data->RealTimeLimit,result->Details)) - { - result->Details=gcnew String(sec->Details.c_str())+result->Details; - result->res=TestResult::RealTimeLimit; - return false; - } - - if (plug->p->MemoryLimit(result->UsedMemory,data->MemoryLimit,result->Details)) - { - result->Details=gcnew String(sec->Details.c_str())+result->Details; - result->res=TestResult::MemoryLimit; - return false; - } - - CloseHandle(si.hStdOutput);si.hStdOutput=NULL; - CloseHandle(si.hStdInput);si.hStdInput=NULL; - - for (int i=0;i<CONST_SLEEP;i++) - if (!File::Exists(oupath)) - Sleep(5); else - break; - - if (!File::Exists(oupath)) - { - result->res=TestResult::WrongAnswer; - result->Details=gcnew String(sec->Details.c_str())+" No output file"; - return false; - } - - Checker^ check=gcnew Tester::Checker(Path::GetFullPath(data->Checker),test->tests[index-1]->input,ReadAllFile(oupath),test->tests[index-1]->output); - - switch (check->Check()) - { - case CheckResult::OE: - result->res=TestResult::OutputError; - result->Details="Output Error"; - break; - case CheckResult::PE: - result->res=TestResult::PresentationError; - result->Details="Presentation Error"; - break; - case CheckResult::WA: - result->res=TestResult::WrongAnswer; - result->Details="Wrong Answer"; - break; - case CheckResult::AC: - result->res=TestResult::Accepted; - result->Details="Accepted"; - break; - }; - result->Details=gcnew String(sec->Details.c_str())+result->Details; - if (result->res!=TestResult::Accepted) - return false; - return true; -}finally -{ - lock(); - results[index-1]=result; - unlock(); - if (sec!=NULL) - { - sec->Finalize(); - delete sec; - } - if (si.hStdInput!=NULL) - CloseHandle(si.hStdInput); - if (si.hStdOutput!=NULL) - CloseHandle(si.hStdOutput); - if (si.hStdError!=NULL) - CloseHandle(si.hStdError); - if (port.CompletionPort!=NULL) - CloseHandle(port.CompletionPort); - if (job!=NULL) - CloseHandle(job); } -} void Runner::ThreadProc() { @@ -325,7 +338,9 @@ if (n<=test->tests->Length) { if (!ExecuteTest(n)) + { StopTest=true; + } } else break; } @@ -351,7 +366,9 @@ void Runner::TerminateThreads() { for (int i=0;i<threads->Length;i++) + { threads[i]->Abort(); + } } Runner::~Runner() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |