summaryrefslogtreecommitdiff
path: root/tests/test_util.py
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2021-08-31 06:11:37 -0700
committerEli Bendersky <eliben@gmail.com>2021-08-31 06:11:37 -0700
commit0e4f8ae855a54142e812b4604eca20f186db9fe4 (patch)
tree7a5096158bb7177253dc69126ab66338a67a5d82 /tests/test_util.py
parentb1dbdc5e21346de0fec7fbb814dedbe1585bcfec (diff)
downloadpycparser-0e4f8ae855a54142e812b4604eca20f186db9fe4.tar.gz
Add comments and clean up whitespace
Diffstat (limited to 'tests/test_util.py')
-rw-r--r--tests/test_util.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index 0b3365c..3ac3886 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -1,14 +1,29 @@
+#------------------------------------------------------------------------------
+# pycparser: test_util.py
+#
+# Utility code for tests.
+#
+# Eli Bendersky [https://eli.thegreenplace.net/]
+# This file contributed by vit9696@users.noreply.github.com
+# License: BSD
+#------------------------------------------------------------------------------
import platform
+
def cpp_supported():
+ """Is cpp (the C preprocessor) supported as a native command?"""
return platform.system() == 'Linux' or platform.system() == 'Darwin'
+
def cpp_path():
+ """Path to cpp command."""
if platform.system() == 'Darwin':
return 'gcc'
return 'cpp'
+
def cpp_args(args=[]):
+ """Turn args into a suitable format for passing to cpp."""
if isinstance(args, str):
args = [args]
if platform.system() == 'Darwin':