From 3f2bed52cc4eca3a8fcfb399cf89328c322b447d Mon Sep 17 00:00:00 2001 From: Bruno Santos Date: Mon, 30 Dec 2024 12:21:31 +0000 Subject: [PATCH] test: add compiler/autoconf option tests --- test/c/autoconf-invalid.stderr | 1 + test/c/autoconf-invalid.yaml | 12 ++++++++++++ test/c/autoconf.yaml | 13 +++++++++++++ test/c/compiler-autoconf-mismatch.stderr | 1 + test/c/compiler-autoconf-mismatch.yaml | 13 +++++++++++++ test/c/compiler-not-found.stderr | 2 ++ test/c/compiler-not-found.yaml | 11 +++++++++++ test/c/compiler-unknown.stderr | 2 ++ test/c/compiler-unknown.yaml | 11 +++++++++++ 9 files changed, 66 insertions(+) create mode 100644 test/c/autoconf-invalid.stderr create mode 100644 test/c/autoconf-invalid.yaml create mode 100644 test/c/autoconf.yaml create mode 100644 test/c/compiler-autoconf-mismatch.stderr create mode 100644 test/c/compiler-autoconf-mismatch.yaml create mode 100644 test/c/compiler-not-found.stderr create mode 100644 test/c/compiler-not-found.yaml create mode 100644 test/c/compiler-unknown.stderr create mode 100644 test/c/compiler-unknown.yaml diff --git a/test/c/autoconf-invalid.stderr b/test/c/autoconf-invalid.stderr new file mode 100644 index 00000000..2a565ee7 --- /dev/null +++ b/test/c/autoconf-invalid.stderr @@ -0,0 +1 @@ +WARNING: autoconf: ['invalid'] unsupported option(s) ignored diff --git a/test/c/autoconf-invalid.yaml b/test/c/autoconf-invalid.yaml new file mode 100644 index 00000000..6d2303fe --- /dev/null +++ b/test/c/autoconf-invalid.yaml @@ -0,0 +1,12 @@ +test: +- extension +directives: +- domain: c + directive: autodoc + arguments: + - doc.c +conf-overrides: + hawkmoth_autoconf: + - 'invalid' +errors: autoconf-invalid.stderr +expected: doc.rst diff --git a/test/c/autoconf.yaml b/test/c/autoconf.yaml new file mode 100644 index 00000000..5e3194be --- /dev/null +++ b/test/c/autoconf.yaml @@ -0,0 +1,13 @@ +test: +- extension +directives: +- domain: c + directive: autodoc + arguments: + - bool.c +conf-overrides: + hawkmoth_clang: -nostdinc + hawkmoth_compiler: clang + hawkmoth_autoconf: + - 'stdinc' +expected: bool.rst diff --git a/test/c/compiler-autoconf-mismatch.stderr b/test/c/compiler-autoconf-mismatch.stderr new file mode 100644 index 00000000..3e3bc1b0 --- /dev/null +++ b/test/c/compiler-autoconf-mismatch.stderr @@ -0,0 +1 @@ +WARNING: autoconf: 'stdinc' option ignored (missing compiler) diff --git a/test/c/compiler-autoconf-mismatch.yaml b/test/c/compiler-autoconf-mismatch.yaml new file mode 100644 index 00000000..87b63d4a --- /dev/null +++ b/test/c/compiler-autoconf-mismatch.yaml @@ -0,0 +1,13 @@ +test: +- extension +directives: +- domain: c + directive: autodoc + arguments: + - doc.c +conf-overrides: + hawkmoth_compiler: null + hawkmoth_autoconf: + - 'stdinc' +errors: compiler-autoconf-mismatch.stderr +expected: doc.rst diff --git a/test/c/compiler-not-found.stderr b/test/c/compiler-not-found.stderr new file mode 100644 index 00000000..2339ae30 --- /dev/null +++ b/test/c/compiler-not-found.stderr @@ -0,0 +1,2 @@ +WARNING: get_include_args: c compiler not found ('invalid') +WARNING: get_include_args: c++ compiler not found ('invalid') diff --git a/test/c/compiler-not-found.yaml b/test/c/compiler-not-found.yaml new file mode 100644 index 00000000..00ed457e --- /dev/null +++ b/test/c/compiler-not-found.yaml @@ -0,0 +1,11 @@ +test: +- extension +directives: +- domain: c + directive: autodoc + arguments: + - doc.c +conf-overrides: + hawkmoth_compiler: invalid +errors: compiler-not-found.stderr +expected: doc.rst diff --git a/test/c/compiler-unknown.stderr b/test/c/compiler-unknown.stderr new file mode 100644 index 00000000..03be0e53 --- /dev/null +++ b/test/c/compiler-unknown.stderr @@ -0,0 +1,2 @@ +WARNING: get_include_args: incompatible c compiler ('false') +WARNING: get_include_args: incompatible c++ compiler ('false') diff --git a/test/c/compiler-unknown.yaml b/test/c/compiler-unknown.yaml new file mode 100644 index 00000000..f86ee65f --- /dev/null +++ b/test/c/compiler-unknown.yaml @@ -0,0 +1,11 @@ +test: +- extension +directives: +- domain: c + directive: autodoc + arguments: + - doc.c +conf-overrides: + hawkmoth_compiler: false +errors: compiler-unknown.stderr +expected: doc.rst