Beispiel #1
0
        public bool runTest(ref String errorMessage)
        {
            ContinuouslyRunningTest test = new ContinuouslyRunningTest("StateMachineExercise", 100);

            test.runTest(ref errorMessage);

            NSFOSThread.sleep(20);

            test.terminate(true);
            return(true);
        }
        public bool runTest(ref String errorMessage)
        {
            ContinuouslyRunningTest test = new ContinuouslyRunningTest("StateMachineExercise", 100);

            test.runTest(ref errorMessage);

            NSFOSThread.sleep(20);

            test.terminate(true);
            return true;
        }
Beispiel #3
0
        public bool runTest(ref String errorMessage)
        {
            bool returnValue = true;

            readyToTerminate = false;

            List <ContinuouslyRunningTest> tests     = new List <ContinuouslyRunningTest>();
            ContinuouslyRunningTest        firstTest = null;

            for (int i = 0; i < NumberOfInstances; ++i)
            {
                ContinuouslyRunningTest test = new ContinuouslyRunningTest(Name + ".SubTest" + i.ToString(), NumberOfCycles);
                if (i == 0)
                {
                    firstTest = test;
                    test.State1_2_2.EntryActions += terminateTest;
                }

                tests.Add(test);

                test.runTest(ref errorMessage);
            }

            while (!readyToTerminate)
            {
                NSFOSThread.sleep(1);
            }

            // terminate all the test
            foreach (ContinuouslyRunningTest test in tests)
            {
                test.terminate(false);
            }

            // Wait for all test to terminate
            foreach (ContinuouslyRunningTest test in tests)
            {
                test.terminate(true);
            }

            firstTest.State1_2_2.EntryActions -= terminateTest;

            NSFDebugUtility.PrimaryDebugUtility.writeLineToConsole("");

            return(returnValue);
        }
        public bool runTest(ref String errorMessage)
        {
            bool returnValue = true;
            readyToTerminate = false;

            List<ContinuouslyRunningTest> tests = new List<ContinuouslyRunningTest>();
            ContinuouslyRunningTest firstTest = null;

            for (int i = 0; i < NumberOfInstances; ++i)
            {
                ContinuouslyRunningTest test = new ContinuouslyRunningTest(Name + ".SubTest" + i.ToString(), NumberOfCycles);
                if (i == 0)
                {
                    firstTest = test;
                    test.State1_2_2.EntryActions += terminateTest;
                }

                tests.Add(test);

                test.runTest(ref errorMessage);
            }

            while (!readyToTerminate)
            {
                NSFOSThread.sleep(1);
            }

            // terminate all the test
            foreach (ContinuouslyRunningTest test in tests)
            {
                test.terminate(false);
            }

            // Wait for all test to terminate
            foreach (ContinuouslyRunningTest test in tests)
            {
                test.terminate(true);
            }

            firstTest.State1_2_2.EntryActions -= terminateTest;

            NSFDebugUtility.PrimaryDebugUtility.writeLineToConsole("");

            return returnValue;
        }