def test_if_first(self):
     subprocess.call(r'tests.bat branching_kernels\if_1\if_1.bin ' +
                     r'branching_kernels\if_1\if_1.asm')
     parser_for_instructions.main(r"branching_kernels\if_1\if_1.asm",
                                  r"branching_kernels\if_1\if_1_dcmpl.cl")
     with open(r"branching_kernels\if_1\if_1_hands.cl"
               ) as hands_decompilation:
         with open(r"branching_kernels\if_1\if_1_dcmpl.cl") as decompiled:
             self.assertEqual(hands_decompilation.read(), decompiled.read())
 def test_addition(self):
     subprocess.call(r'tests.bat linear_kernels\addition\addition.bin ' +
                     r'linear_kernels\addition\addition.asm')
     parser_for_instructions.main(
         r"linear_kernels\addition\addition.asm",
         r"linear_kernels\addition\addition_dcmpl.cl")
     with open(r"linear_kernels\addition\addition_hands.cl"
               ) as hands_decompilation:
         with open(r"linear_kernels\addition\addition_dcmpl.cl"
                   ) as decompiled:
             self.assertEqual(hands_decompilation.read(), decompiled.read())
 def test_big_type_test(self):
     subprocess.call(
         r'tests.bat different_types\big_type_test\big_type_test.bin ' +
         r'different_types\big_type_test\big_type_test.asm')
     parser_for_instructions.main(
         r"different_types\big_type_test\big_type_test.asm",
         r"different_types\big_type_test\big_type_test_dcmpl.cl")
     with open(r"different_types\big_type_test\big_type_test_hands.cl"
               ) as hands_decompilation:
         with open(r"different_types\big_type_test\big_type_test_dcmpl.cl"
                   ) as decompiled:
             self.assertEqual(hands_decompilation.read(), decompiled.read())
 def test_mask_kernel(self):
     subprocess.call(
         r'tests.bat real_kernels\mask_kernel\mask_kernel.bin ' +
         r'real_kernels\mask_kernel\mask_kernel.asm')
     parser_for_instructions.main(
         r"real_kernels\mask_kernel\mask_kernel.asm",
         r"real_kernels\mask_kernel\mask_kernel_dcmpl.cl")
     with open(r"real_kernels\mask_kernel\mask_kernel_hands.cl"
               ) as hands_decompilation:
         with open(r"real_kernels\mask_kernel\mask_kernel_dcmpl.cl"
                   ) as decompiled:
             self.assertEqual(hands_decompilation.read(), decompiled.read())
 def test_barrier_1(self):
     subprocess.call(
         r'tests.bat local_memory_kernels\barrier_1\barrier_1.bin ' +
         r'local_memory_kernels\barrier_1\barrier_1.asm')
     parser_for_instructions.main(
         r"local_memory_kernels\barrier_1\barrier_1.asm",
         r"local_memory_kernels\barrier_1\barrier_1_dcmpl.cl")
     with open(r"local_memory_kernels\barrier_1\barrier_1_hands.cl"
               ) as hands_decompilation:
         with open(r"local_memory_kernels\barrier_1\barrier_1_dcmpl.cl"
                   ) as decompiled:
             self.assertEqual(hands_decompilation.read(), decompiled.read())
 def test_two_unused_params(self):
     subprocess.call(
         r'tests.bat unused_params\two_unused_params\two_unused_params.bin '
         + r'unused_params\two_unused_params\two_unused_params.asm')
     parser_for_instructions.main(
         r"unused_params\two_unused_params\two_unused_params.asm",
         r"unused_params\two_unused_params\two_unused_params_dcmpl.cl")
     with open(r"unused_params\two_unused_params\two_unused_params_hands.cl"
               ) as hands_decompilation:
         with open(
                 r"unused_params\two_unused_params\two_unused_params_dcmpl.cl"
         ) as decompiled:
             self.assertEqual(hands_decompilation.read(), decompiled.read())
 def test_work_item_built_in_functions(self):
     subprocess.call(
         r'tests.bat linear_kernels\work_item_built_in_functions\work_item_built_in_functions.bin '
         +
         r'linear_kernels\work_item_built_in_functions\work_item_built_in_functions.asm'
     )
     parser_for_instructions.main(
         r"linear_kernels\work_item_built_in_functions\work_item_built_in_functions.asm",
         r"linear_kernels\work_item_built_in_functions\work_item_built_in_functions_dcmpl.cl"
     )
     with open(
             r"linear_kernels\work_item_built_in_functions\work_item_built_in_functions_hands.cl"
     ) as hands_decompilation:
         with open(
                 r"linear_kernels\work_item_built_in_functions\work_item_built_in_functions_dcmpl.cl"
         ) as decompiled:
             self.assertEqual(hands_decompilation.read(), decompiled.read())