Skip to content

Commit

Permalink
[Refactor] compiled tests run if the compiler is present
Browse files Browse the repository at this point in the history
  • Loading branch information
g5t committed Nov 22, 2023
1 parent 71bf7b2 commit 269fb87
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/test_instr.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,13 @@ def test_tas1_c1(self):

class CompiledTest(TestCase):
def setUp(self):
import platform
if platform.system() == 'Windows':
self.skipTest('Skipping test on Windows')
import subprocess
from mccode_antlr.config import config
try:
subprocess.run([config['cc'].get(str), '--version'], check=True)
except FileNotFoundError:
log.info(f'Provide alternate C compiler via MCCODE_ANTLR_CC environment variable')
self.skipTest(f"C compiler {config['cc']} not found")


class CompiledInstr(CompiledTest):
Expand Down

0 comments on commit 269fb87

Please sign in to comment.