Skip to content

Commit

Permalink
test: respect conf.py clang config options for cli and parser tests
Browse files Browse the repository at this point in the history
Replicate hawkmoth_clang, hawkmoth_clang_c, and hawkmoth_clang_cpp
config options for cli and parser tests in testenv. Tests can still
override them.
  • Loading branch information
jnikula committed Sep 14, 2024
1 parent 5f61e5d commit bf22664
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/testenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import pytest
import strictyaml

from test import conf

testext = '.yaml'
testdir = os.path.dirname(os.path.abspath(__file__))
rootdir = os.path.dirname(testdir)
Expand Down Expand Up @@ -43,7 +45,12 @@ def get_directive_string(self):
return directive_str

def get_clang_args(self):
clang_args = []
clang_args = getattr(conf, 'hawkmoth_clang', [])

if self.domain == 'c':
clang_args.extend(getattr(conf, 'hawkmoth_clang_c', []))
else:
clang_args.extend(getattr(conf, 'hawkmoth_clang_cpp', []))

clang_args.extend(self.options.get('clang', []))

Expand Down

0 comments on commit bf22664

Please sign in to comment.