Openwsman / openwsman

Openwsman server implementation and client api with bindings
BSD 3-Clause "New" or "Revised" License
112 stars 53 forks source link

2.7.1: `BUILD_CUNIT_TESTS=ON` build fails #164

Closed kloczek closed 2 years ago

kloczek commented 2 years ago

build failss because missing dependency checking for cunit in cmake which is causing that cmake passes correctly but build fails on

[ 98%] Building C object tests/serialization/CMakeFiles/ser1.dir/ser1.c.o
cd /home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/x86_64-redhat-linux-gnu/tests/serialization && /usr/bin/gcc -DHAVE_CONFIG_H -I/usr/include/libxml2 -I/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include -I/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1 -I/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/x86_64-redhat-linux-gnu/tests/serialization -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -DFEDORA -DNO_SSL_CALLBACK -fno-strict-aliasing -DNDEBUG   -fPIC -MD -MT tests/serialization/CMakeFiles/ser1.dir/ser1.c.o -MF CMakeFiles/ser1.dir/ser1.c.o.d -o CMakeFiles/ser1.dir/ser1.c.o -c /home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:9:10: fatal error: CUnit/Basic.h: No such file or directory
    9 | #include "CUnit/Basic.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
kloczek commented 2 years ago

After add cunit devel reources to build env build fails with:

[ 98%] Building C object tests/serialization/CMakeFiles/ser1.dir/ser1.c.o
cd /home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/x86_64-redhat-linux-gnu/tests/serialization && /usr/bin/gcc -DHAVE_CONFIG_H -I/usr/include/libxml2 -I/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include -I/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1 -I/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/x86_64-redhat-linux-gnu/tests/serialization -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -DFEDORA -DNO_SSL_CALLBACK -fno-strict-aliasing -DNDEBUG   -fPIC -MD -MT tests/serialization/CMakeFiles/ser1.dir/ser1.c.o -MF CMakeFiles/ser1.dir/ser1.c.o.d -o CMakeFiles/ser1.dir/ser1.c.o -c /home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c: In function ‘test_basic_types’:
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:146:37: warning: passing argument 1 of ‘ws_xml_create_doc’ from incompatible pointer type [-Wincompatible-pointer-types]
  146 |         doc = ws_xml_create_doc(cntx->soap, NULL, "example");
      |                                 ~~~~^~~~~~
      |                                     |
      |                                     SoapH {aka struct __Soap *}
In file included from /home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:12:
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include/wsman-xml.h:107:42: note: expected ‘const char *’ but argument is of type ‘SoapH’ {aka ‘struct __Soap *’}
  107 | WsXmlDocH ws_xml_create_doc( const char *rootNsUri, const char *rootName);
      |                              ~~~~~~~~~~~~^~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:146:15: error: too many arguments to function ‘ws_xml_create_doc’
  146 |         doc = ws_xml_create_doc(cntx->soap, NULL, "example");
      |               ^~~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include/wsman-xml.h:107:11: note: declared here
  107 | WsXmlDocH ws_xml_create_doc( const char *rootNsUri, const char *rootName);
      |           ^~~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:149:31: warning: passing argument 1 of ‘ws_serialize’ from incompatible pointer type [-Wincompatible-pointer-types]
  149 |         retval = ws_serialize(cntx, node, &servie, Sample_Servie_TypeInfo,
      |                               ^~~~
      |                               |
      |                               WsContextH {aka struct _WS_CONTEXT *}
In file included from /home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include/wsman-soap.h:49,
                 from /home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:11:
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include/wsman-xml-serializer.h:662:39: note: expected ‘WsSerializerContextH’ {aka ‘struct __WsSerializerContext *’} but argument is of type ‘WsContextH’ {aka ‘struct _WS_CONTEXT *’}
  662 | int ws_serialize(WsSerializerContextH serctx,
      |                  ~~~~~~~~~~~~~~~~~~~~~^~~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:154:62: warning: passing argument 1 of ‘ws_deserialize’ from incompatible pointer type [-Wincompatible-pointer-types]
  154 |         Sample_Servie *cs = (Sample_Servie *) ws_deserialize(cntx,
      |                                                              ^~~~
      |                                                              |
      |                                                              WsContextH {aka struct _WS_CONTEXT *}
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include/wsman-xml-serializer.h:671:43: note: expected ‘WsSerializerContextH’ {aka ‘struct __WsSerializerContext *’} but argument is of type ‘WsContextH’ {aka ‘struct _WS_CONTEXT *’}
  671 | void *ws_deserialize(WsSerializerContextH serctx,
      |                      ~~~~~~~~~~~~~~~~~~~~~^~~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:161:44: warning: argument to ‘sizeof’ in ‘memcmp’ call is the same pointer type ‘Sample_Servie *’ {aka ‘struct __Sample_Servie *’} as the first source; expected ‘Sample_Servie’ {aka ‘struct __Sample_Servie’} or an explicit length [-Wsizeof-pointer-memaccess]
  161 |         retval = memcmp(cs, &servie, sizeof(&servie));
      |                                            ^
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c: In function ‘test_static_struct’:
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:212:37: warning: passing argument 1 of ‘ws_xml_create_doc’ from incompatible pointer type [-Wincompatible-pointer-types]
  212 |         doc = ws_xml_create_doc(cntx->soap, NULL, "example");
      |                                 ~~~~^~~~~~
      |                                     |
      |                                     SoapH {aka struct __Soap *}
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include/wsman-xml.h:107:42: note: expected ‘const char *’ but argument is of type ‘SoapH’ {aka ‘struct __Soap *’}
  107 | WsXmlDocH ws_xml_create_doc( const char *rootNsUri, const char *rootName);
      |                              ~~~~~~~~~~~~^~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:212:15: error: too many arguments to function ‘ws_xml_create_doc’
  212 |         doc = ws_xml_create_doc(cntx->soap, NULL, "example");
      |               ^~~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include/wsman-xml.h:107:11: note: declared here
  107 | WsXmlDocH ws_xml_create_doc( const char *rootNsUri, const char *rootName);
      |           ^~~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:216:31: warning: passing argument 1 of ‘ws_serialize’ from incompatible pointer type [-Wincompatible-pointer-types]
  216 |         retval = ws_serialize(cntx, node, &sample, Sample_TypeInfo,
      |                               ^~~~
      |                               |
      |                               WsContextH {aka struct _WS_CONTEXT *}
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include/wsman-xml-serializer.h:662:39: note: expected ‘WsSerializerContextH’ {aka ‘struct __WsSerializerContext *’} but argument is of type ‘WsContextH’ {aka ‘struct _WS_CONTEXT *’}
  662 | int ws_serialize(WsSerializerContextH serctx,
      |                  ~~~~~~~~~~~~~~~~~~~~~^~~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:220:56: warning: passing argument 1 of ‘ws_deserialize’ from incompatible pointer type [-Wincompatible-pointer-types]
  220 |         Sample *sample_out = (Sample *) ws_deserialize(cntx,
      |                                                        ^~~~
      |                                                        |
      |                                                        WsContextH {aka struct _WS_CONTEXT *}
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include/wsman-xml-serializer.h:671:43: note: expected ‘WsSerializerContextH’ {aka ‘struct __WsSerializerContext *’} but argument is of type ‘WsContextH’ {aka ‘struct _WS_CONTEXT *’}
  671 | void *ws_deserialize(WsSerializerContextH serctx,
      |                      ~~~~~~~~~~~~~~~~~~~~~^~~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:208:13: warning: variable ‘retval’ set but not used [-Wunused-but-set-variable]
  208 |         int retval;
      |             ^~~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/tests/serialization/ser1.c:197:23: warning: unused variable ‘Embed_TypeInfo’ [-Wunused-variable]
  197 |         SER_END_ITEMS(Embed);
      |                       ^~~~~
/home/tkloczko/rpmbuild/BUILD/openwsman-2.7.1/include/wsman-xml-serializer.h:631:19: note: in definition of macro ‘SER_END_ITEMS’
  631 | XmlSerializerInfo t##_TypeInfo[] = {\
      |                   ^
make[2]: *** [tests/serialization/CMakeFiles/ser1.dir/build.make:79: tests/serialization/CMakeFiles/ser1.dir/ser1.c.o] Error 1
Openwsman commented 2 years ago

Fixed with #165