Пример #1
0
        static void DevRun()
        {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();


            var opts = new Options();
            opts.ExecutionMode = ExecutionMode.Serial;
            ProtoCore.Core core = new Core(opts);
            core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
            core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
#if DEBUG
            core.Options.DumpByteCode = true;
            core.Options.Verbose = true;
#else
            core.Options.DumpByteCode = false;
            core.Options.Verbose = false;
#endif
            ProtoFFI.DLLFFIHandler.Register(ProtoFFI.FFILanguage.CSharp, new ProtoFFI.CSModuleHelper());
            ProtoScriptTestRunner runner = new ProtoScriptTestRunner();

            // Assuming current directory in test/debug mode is "...\Dynamo\bin\AnyCPU\Debug"
            ExecutionMirror mirror = runner.LoadAndExecute(@"..\..\..\test\core\dsevaluation\DSFiles\test.ds", core);

            long ms = sw.ElapsedMilliseconds;
            sw.Stop();
            Console.WriteLine(ms);
            Console.ReadLine();
        }
Пример #2
0
        static void DevRun()
        {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();


            var opts = new Options();
            opts.ExecutionMode = ExecutionMode.Serial;
            ProtoCore.Core core = new Core(opts);
            core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
            core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
#if DEBUG
            core.Options.DumpByteCode = true;
            core.Options.Verbose = true;
#else
            core.Options.DumpByteCode = false;
            core.Options.Verbose = false;
#endif
            ProtoFFI.DLLFFIHandler.Register(ProtoFFI.FFILanguage.CSharp, new ProtoFFI.CSModuleHelper());
            ProtoScriptTestRunner runner = new ProtoScriptTestRunner();
            ExecutionMirror mirror = runner.LoadAndExecute(@"C:\Users\Yu\dev\github\test.ds", core);

            long ms = sw.ElapsedMilliseconds;
            sw.Stop();
            Console.WriteLine(ms);
            Console.ReadLine();
        }
Пример #3
0
        static void DevRun()
        {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();


            var opts = new Options();
            opts.ExecutionMode = ExecutionMode.Serial;
            ProtoCore.Core core = new Core(opts);
            core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
            core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
#if DEBUG
            core.Options.DumpByteCode = true;
            core.Options.Verbose = true;
#else
            core.Options.DumpByteCode = false;
            core.Options.Verbose = false;
#endif

#if __RUN_TESTFILE
            ProtoFFI.DLLFFIHandler.Register(ProtoFFI.FFILanguage.CSharp, new ProtoFFI.CSModuleHelper());
            ProtoScriptTestRunner runner = new ProtoScriptTestRunner();
            ExecutionMirror mirror = runner.LoadAndExecute(@"D:\jun\AutodeskResearch\git\designscript\Scripts\jun.ds", core);
#else
            // Insert test cases here

            //ProtoTest.LiveRunner.MicroFeatureTests test = new ProtoTest.LiveRunner.MicroFeatureTests();
            //test.Setup();
            //test.TestPythonCodeExecution();

            ProtoTest.Associative.MicroFeatureTests test = new ProtoTest.Associative.MicroFeatureTests();
            test.Setup();
           test.TestUpdateRedefinition01();

            //IntegrationTests.IncrementingTraceTests test = new IntegrationTests.IncrementingTraceTests();
            //test.Setup();
            //test.IntermediateValueIncrementerIDTestUpdate1DReplicated();

            //ProtoFFITests.CSFFIDispose test = new ProtoFFITests.CSFFIDispose();
            //test.Setup();
            //test.IntermediateValueIncrementerIDTestUpdate1DReplicated();
           // test.Dispose_FFITarget_Overridden();

            //ProtoTest.EventTests.PropertyChangedNotifyTest test = new ProtoTest.EventTests.PropertyChangedNotifyTest();
            //test.Setup();
            //test.RunPropertyChangedNegative();
            

#endif

            long ms = sw.ElapsedMilliseconds;
            sw.Stop();
            Console.WriteLine(ms);
            Console.ReadLine();
        }
Пример #4
0
        static void Run(string filename, bool verbose)
        {
            if (!File.Exists(filename))
            {
                Console.WriteLine("Cannot find file " + filename);
                return;
            }
            var opts = new Options();
            opts.ExecutionMode = ExecutionMode.Serial;
            ProtoCore.Core core = new Core(opts);
            core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
            core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
            core.Options.DumpByteCode = verbose;
            core.Options.Verbose = verbose;
            ProtoFFI.DLLFFIHandler.Register(ProtoFFI.FFILanguage.CSharp, new ProtoFFI.CSModuleHelper());

            ProtoScriptTestRunner runner = new ProtoScriptTestRunner();
            ExecutionMirror mirror = runner.LoadAndExecute(filename, core);
        }
Пример #5
0
        static void DevRun()
        {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();


            var opts = new Options();
            opts.ExecutionMode = ExecutionMode.Serial;
            ProtoCore.Core core = new Core(opts);
            core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
            core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
#if DEBUG
            core.Options.DumpByteCode = true;
            core.Options.Verbose = true;
#else
            core.Options.DumpByteCode = false;
            core.Options.Verbose = false;
#endif
#if __RUN_TESTFILE

            ProtoFFI.DLLFFIHandler.Register(ProtoFFI.FFILanguage.CSharp, new ProtoFFI.CSModuleHelper());


            ProtoScriptTestRunner runner = new ProtoScriptTestRunner();
            ExecutionMirror mirror = runner.LoadAndExecute(@"defectverify.ds", core);

#else

            ProtoTest.GraphCompiler.MicroFeatureTests test = new ProtoTest.GraphCompiler.MicroFeatureTests();
            test.Setup();
            test.GraphILTest_Assign02();
            
#endif
            long ms = sw.ElapsedMilliseconds;
            sw.Stop();
            Console.WriteLine(ms);
            Console.ReadLine();
        }
Пример #6
0
        public static void Main(string[] args)
        {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            bool testScript = string.Equals(args[0], "test") && args.Length == 2;
            var opts = new Options();
            if (args.Length == 0 || testScript)
            {
                opts.WebRunner = false;
            }
            else
            {
                opts.WebRunner = true;
            }
            opts.ExecutionMode = ExecutionMode.Serial;

            ProtoCore.Core core = new Core(opts);
            core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
            core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));


            if (!opts.WebRunner)
            {
                string fileName;
                if (testScript)
                {
                    fileName = args[1];
                }
                else
                {
                    fileName = @"..\..\..\Scripts\defectverify.ds";
                }

                ProtoScriptTestRunner runner = new ProtoScriptTestRunner();
                DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
                ExecutionMirror mirror = runner.LoadAndExecute(fileName, core);
                string str = mirror.GetCoreDump();
                //Console.WriteLine(str);
            }
            else //if (arg)
            {
                // @TODO(Gemeng): Do set "core.ExecutionLog" to some file :)

                ProtoScriptWebRunner runner = new ProtoScriptWebRunner();
                DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
                ExecutionMirror mirror = runner.LoadAndExecute(args[0], core);
                if (null != mirror)
                {
                    string str = mirror.GetCoreDump();
                    // core.coreDumpWriter.WriteLine(str);

                }

                // @TODO(Gemeng): 'coreDumpWriter' has been removed, instead of 
                // doing that we should create an output file stream here with a
                // file name, and then write the "str" content into it.
                // 
                // core.coreDumpWriter.Close();
            }


            //runner.LoadAndExecute(@"..\..\..\Scripts\array.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\arrayargs.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\class.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\class2.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\class3.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\class4.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\class5.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\class6.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\class7.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\class8.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\class9.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\class10.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\demo.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\expr.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\fusionarray.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\replication.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\simple.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\simple2.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\functionoverload.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\classfunctionoverload.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\inheritance.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\inheritance2.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\update.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\null.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\forloop.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\blockassign_imperative.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\blockassign_associative.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\test.ds", core);
            //runner.LoadAndExecute(@"..\..\..\Scripts\importtest.ds", core);

            //ExecutionMirror mirror = null;   



            //string str = mirror.GetCoreDump();
            long ms = sw.ElapsedMilliseconds;
            sw.Stop();

            if (!opts.WebRunner)
            {
                Console.WriteLine(ms);
                Console.ReadLine();
            }
        }
Пример #7
0
        static void DevRun()
        {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();


            var opts = new Options();
            opts.ExecutionMode = ExecutionMode.Serial;
            ProtoCore.Core core = new Core(opts);
            core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
            core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
#if DEBUG
            core.Options.DumpByteCode = true;
            core.Options.Verbose = true;
#else
            core.Options.DumpByteCode = false;
            core.Options.Verbose = false;
#endif
            
#if __RUN_TEST_FILE
            
            ProtoFFI.DLLFFIHandler.Register(ProtoFFI.FFILanguage.CSharp, new ProtoFFI.CSModuleHelper());

            ProtoScriptTestRunner runner = new ProtoScriptTestRunner();
            ExecutionMirror mirror = runner.LoadAndExecute(@"c:\jun\AutodeskResearch\git\designscript\Scripts\jun.ds", core);
          
#else
            /*
            var runnerConfig = new ProtoScript.Config.RunConfiguration();
            runnerConfig.IsParrallel = false;
            var fsr = new ProtoScript.Runners.DebugRunner(core);
            fsr.LoadAndPreStart(@"c:\project\designscript\test.ds", runnerConfig);
            fsr.Run();
            */


            
            //ProtoTest.TD.OtherMiscTests.MiscTest test = new ProtoTest.TD.OtherMiscTests.MiscTest();
            //test.TestDynamicSetValueAfterExecution();
            


            //ProtoTest.DebugTests.RunEqualityTests test = new ProtoTest.DebugTests.RunEqualityTests();
            //test.DebugTest_Jun_ReplicationGuide();

            //ProtoTest.Associative.MicroFeatureTests test = new ProtoTest.Associative.MicroFeatureTests();
            //test.Setup();
            //test.TestContextInject01();


            ProtoFFITests.ContextInjectionTests test = new ProtoFFITests.ContextInjectionTests();
            test.Setup();
            test.TestContextInjectDummy();



            //ProtoTest.Associative.MethodsFocusTeam test = new ProtoTest.Associative.MethodsFocusTeam();
            //test.Setup();
            //test.T014_DotOp_UserDefinedClass_03();
            
#endif

            long ms = sw.ElapsedMilliseconds;
            sw.Stop();
            Console.WriteLine(ms);
            Console.ReadLine();
        }