From 5bc960b2ac0d152e5d7c5f9ca3e7425dfc634a65 Mon Sep 17 00:00:00 2001
From: Valentin Perrelle <valentin.perrelle@cea.fr>
Date: Fri, 21 Jun 2019 14:07:56 +0200
Subject: [PATCH] [Kernel] add test for -cpp-command

---
 tests/syntax/cpp-command.c                   | 6 ++++++
 tests/syntax/oracle/cpp-command.0.res.oracle | 2 ++
 tests/syntax/oracle/cpp-command.1.res.oracle | 2 ++
 tests/syntax/oracle/cpp-command.2.res.oracle | 2 ++
 tests/syntax/oracle/cpp-command.3.res.oracle | 2 ++
 5 files changed, 14 insertions(+)
 create mode 100644 tests/syntax/cpp-command.c
 create mode 100644 tests/syntax/oracle/cpp-command.0.res.oracle
 create mode 100644 tests/syntax/oracle/cpp-command.1.res.oracle
 create mode 100644 tests/syntax/oracle/cpp-command.2.res.oracle
 create mode 100644 tests/syntax/oracle/cpp-command.3.res.oracle

diff --git a/tests/syntax/cpp-command.c b/tests/syntax/cpp-command.c
new file mode 100644
index 00000000000..8b55bb3e5fd
--- /dev/null
+++ b/tests/syntax/cpp-command.c
@@ -0,0 +1,6 @@
+/* run.config*
+   OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo ['%1' '%1' '%i' '%input'] ['%2' '%2' '%o' '%output'] ['%args']"
+   OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo %%1 = %1 %%2 = %2 %%args = %args"
+   OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo using \\\\% has no effect : \\\\%input"
+   OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo %var is not an interpreted placeholder"
+   */
\ No newline at end of file
diff --git a/tests/syntax/oracle/cpp-command.0.res.oracle b/tests/syntax/oracle/cpp-command.0.res.oracle
new file mode 100644
index 00000000000..d5d058033c1
--- /dev/null
+++ b/tests/syntax/oracle/cpp-command.0.res.oracle
@@ -0,0 +1,2 @@
+[kernel] Parsing tests/syntax/cpp-command.c (with preprocessing)
+[tests/syntax/cpp-command.c tests/syntax/cpp-command.c tests/syntax/cpp-command.c tests/syntax/cpp-command.c] [/tmp/cpp-command.cc1c5af.i /tmp/cpp-command.cc1c5af.i /tmp/cpp-command.cc1c5af.i /tmp/cpp-command.cc1c5af.i] [ -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32]
diff --git a/tests/syntax/oracle/cpp-command.1.res.oracle b/tests/syntax/oracle/cpp-command.1.res.oracle
new file mode 100644
index 00000000000..c8e543a9189
--- /dev/null
+++ b/tests/syntax/oracle/cpp-command.1.res.oracle
@@ -0,0 +1,2 @@
+[kernel] Parsing tests/syntax/cpp-command.c (with preprocessing)
+%1 = tests/syntax/cpp-command.c %2 = /tmp/cpp-command.cee4fe3.i %args = -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32
diff --git a/tests/syntax/oracle/cpp-command.2.res.oracle b/tests/syntax/oracle/cpp-command.2.res.oracle
new file mode 100644
index 00000000000..55681f51386
--- /dev/null
+++ b/tests/syntax/oracle/cpp-command.2.res.oracle
@@ -0,0 +1,2 @@
+[kernel] Parsing tests/syntax/cpp-command.c (with preprocessing)
+using \% has no effect : 	ests/syntax/cpp-command.c
diff --git a/tests/syntax/oracle/cpp-command.3.res.oracle b/tests/syntax/oracle/cpp-command.3.res.oracle
new file mode 100644
index 00000000000..f149d8c6d5b
--- /dev/null
+++ b/tests/syntax/oracle/cpp-command.3.res.oracle
@@ -0,0 +1,2 @@
+[kernel] Parsing tests/syntax/cpp-command.c (with preprocessing)
+%var is not an interpreted placeholder
-- 
GitLab