Esempio n. 1
0
  def test_instruction(self, mock):
    mock.side_effect = lambda c: self.execute_mock(c)

    with Console() as console:
      main([sys.argv[0]] + list(map(lambda t: t[0], defined_tests)))
      output = console.get_output()

    for_all_test_results(output, self.check_encoding_results)
Esempio n. 2
0
    def test_result_of_timed_out_test(self, mock):
        mock.side_effect = self.execute_mock

        with Console() as console:
            test_base()
            output = console.get_output()

        for_all_test_results(output, self.check_output)
Esempio n. 3
0
  def test_hypster_execution_results(self, test_hypster_execution_mock):
    test_hypster_execution_mock.side_effect = self.hypster_execution_mock

    tests = list(map(lambda t: t[0], defined_tests))
    tests.remove('assembler-1')
    tests.remove('assembler-2')
    tests.remove('concurrent-machines')
    tests.remove('fork-wait')
    tests.remove('lock')
    tests.remove('thread')
    tests.remove('treiber-stack')

    with Console():
      grader_main([sys.argv[0]] + tests)
Esempio n. 4
0
  def test_compilability_of_test_files(self, test_compilable_mock):
  
    test_compilable_mock.side_effect = self.compilable_mock

    tests = list(map(lambda t: t[0], defined_tests))
    tests.remove('assembler-1')
    tests.remove('assembler-2')
    tests.remove('concurrent-machines')
    tests.remove('fork-wait')
    tests.remove('lock')
    tests.remove('thread')
    tests.remove('treiber-stack')

    with Console():
      main([sys.argv[0]] + tests)
Esempio n. 5
0
    def test_path_name_with_whitespaces(self, mock):
        mock.side_effect = lambda c: self.execute_mock(c)

        dst = 'grader/tests/.tmp/sel fie'

        copytree('.', dst, ignore=ignore)

        cwd = getcwd()

        chdir('grader/tests/.tmp/sel fie')

        with Console():
            grader_main([getcwd(), 'hex-literal'])

        chdir(cwd)

        rmtree(dst)