From 9e2cc83f23c1351fefd36053c23a01698faa8c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 26 Mar 2024 12:28:50 +0000 Subject: [PATCH] ges: add check to make sure headers are C++ compiler clean See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3421 Part-of: --- .../tests/check/gescpp.cc | 49 +++++++++++++++++++ .../tests/check/meson.build | 13 ++++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 subprojects/gst-editing-services/tests/check/gescpp.cc diff --git a/subprojects/gst-editing-services/tests/check/gescpp.cc b/subprojects/gst-editing-services/tests/check/gescpp.cc new file mode 100644 index 0000000000..22965a5d1b --- /dev/null +++ b/subprojects/gst-editing-services/tests/check/gescpp.cc @@ -0,0 +1,49 @@ +/* GStreamer + * Copyright (C) 2024 Tim-Philipp Müller + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include + +/* we mostly just want to make sure that our library headers don't + * contain anything a C++ compiler might not like */ +GST_START_TEST (test_nothing) +{ + gst_init (NULL, NULL); +} + +GST_END_TEST; + +static Suite * +gescpp_suite (void) +{ + Suite *s = suite_create ("GstGESCpp"); + TCase *tc_chain = tcase_create ("C++ GES headers tests"); + + suite_add_tcase (s, tc_chain); + tcase_add_test (tc_chain, test_nothing); + + return s; +} + +GST_CHECK_MAIN (gescpp); diff --git a/subprojects/gst-editing-services/tests/check/meson.build b/subprojects/gst-editing-services/tests/check/meson.build index a283f0371b..784c592ba6 100644 --- a/subprojects/gst-editing-services/tests/check/meson.build +++ b/subprojects/gst-editing-services/tests/check/meson.build @@ -25,6 +25,13 @@ ges_tests = [ ['nle/tempochange'] ] +# Make sure our headers are C++ clean +if add_languages('cpp', native: false, required: false) + ges_tests += [ + [ 'gescpp.cc', false ], + ] +endif + fsmod = import('fs') test_defines = [ '-UG_DISABLE_ASSERT', @@ -50,7 +57,11 @@ endif gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner') foreach t : ges_tests - fname = '@0@.c'.format(t.get(0)) + if t.get(0).endswith('.cc') + fname = t.get(0) + else + fname = '@0@.c'.format(t.get(0)) + endif test_name = t.get(0).underscorify() if t.length() == 2 skip_test = t.get(1)