[test] Add test for headers included from C and C++
This commit is contained in:
parent
107a50581c
commit
fb6291d9c9
@ -15,6 +15,23 @@ TEST_PROGS += \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|
||||||
|
# Tests for header compilation
|
||||||
|
TEST_PROGS += \
|
||||||
|
test-c \
|
||||||
|
test-cplusplus \
|
||||||
|
$(NULL)
|
||||||
|
test_cplusplus_SOURCES = test-cplusplus.cc
|
||||||
|
test_c_CPPFLAGS = $(AM_CPPFLAGS)
|
||||||
|
test_cplusplus_CPPFLAGS = $(AM_CPPFLAGS)
|
||||||
|
if HAVE_ICU
|
||||||
|
test_c_CPPFLAGS += $(ICU_CFLAGS)
|
||||||
|
test_cplusplus_CPPFLAGS += $(ICU_CFLAGS)
|
||||||
|
endif
|
||||||
|
if HAVE_FREETYPE
|
||||||
|
test_c_CPPFLAGS += $(FREETYPE_CFLAGS)
|
||||||
|
test_cplusplus_CPPFLAGS += $(FREETYPE_CFLAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
check-am:
|
check-am:
|
||||||
|
49
test/test-c.c
Normal file
49
test/test-c.c
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010 Google, Inc.
|
||||||
|
*
|
||||||
|
* This is part of HarfBuzz, a text shaping library.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, without written agreement and without
|
||||||
|
* license or royalty fees, to use, copy, modify, and distribute this
|
||||||
|
* software and its documentation for any purpose, provided that the
|
||||||
|
* above copyright notice and the following two paragraphs appear in
|
||||||
|
* all copies of this software.
|
||||||
|
*
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
||||||
|
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
||||||
|
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
|
* DAMAGE.
|
||||||
|
*
|
||||||
|
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
||||||
|
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
||||||
|
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||||
|
*
|
||||||
|
* Google Author(s): Behdad Esfahbod
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* This file tests that all headers can be included from .c files */
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <hb.h>
|
||||||
|
|
||||||
|
#if HAVE_GLIB
|
||||||
|
#include <hb-glib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_ICU
|
||||||
|
#include <hb-icu.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_FREETYPE
|
||||||
|
#include <hb-ft.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main (int argc, char **argv)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
29
test/test-cplusplus.cc
Normal file
29
test/test-cplusplus.cc
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010 Google, Inc.
|
||||||
|
*
|
||||||
|
* This is part of HarfBuzz, a text shaping library.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, without written agreement and without
|
||||||
|
* license or royalty fees, to use, copy, modify, and distribute this
|
||||||
|
* software and its documentation for any purpose, provided that the
|
||||||
|
* above copyright notice and the following two paragraphs appear in
|
||||||
|
* all copies of this software.
|
||||||
|
*
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
||||||
|
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
||||||
|
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
|
* DAMAGE.
|
||||||
|
*
|
||||||
|
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
||||||
|
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
||||||
|
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||||
|
*
|
||||||
|
* Google Author(s): Behdad Esfahbod
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* This file tests that all headers can be included from .cc files */
|
||||||
|
|
||||||
|
#include "test-c.c"
|
Loading…
Reference in New Issue
Block a user