summaryrefslogtreecommitdiff
path: root/tests/includes/types.h
AgeCommit message (Collapse)Author
2022-11-05Add support to define structures in mig.v1.8+git20221111Flavio Cruz
Basic syntax is presented below and allows users to define nested structured types by using simpler or structure types as members. Mig will use the C padding and alignment rules to produce the same size as the corresponding C structures. type timespec_t = struct { uint32_t tv_sec; uint32_t tv_nsec; }; This allows us to build stubs that are more easily adaptable to other architectures. Message-Id: <Y2SjQSMOINY8I5Dy@viriathus>
2022-01-21Add _Static_assert when compiling server and user stubs.Flavio Cruz
This is only done when data is inlined with a concrete size. It ensures the C and Mig types have the same size in the target arch. Tested by building the hurd package. No assertions were triggered. Message-Id: <YekIQaxvs+4FrHyw@viriathus>
2020-11-30Make string_t always use const_string_tSamuel Thibault
This will allow to relieve constraints in callers, e.g. dir_lookup("") would otherwise produce a warning with gcc-11 since char[1024] would mean that dir_lookup would read all 1024 characters while it is not. * utils.c (UserVarQualifier): Also use const_ qualifier when type is string_t. * tests/includes/types.h (const_string_t): New type.
2016-04-19Simple testsuite for MIG.Flavio Cruz
This includes a set of valid and invalid definition files that MIG will try to process. For valid definitions, GCC will compile the stubs to check if valid C code was generated. * configure.ac: Add new test Makefiles. * Makefile.am: Add SUBDIRS. * tests/Makeconf.am: Automake definitions shared by all test subdirectories. * tests/test_lib.sh: Library of functions shared by all test drivers. * tests/good/run_good_test.sh: Script to run valid definition files. * tests/good/Makefile.am: New file. * tests/bad/Makefile.am: New file. * tests/generate-only/Makefile.am: New file. * tests/bad/run_bad_test.sh: Script to run invalid definition files. * tests/generate-only/run_generate_only.sh: Script to run valid definition files that should be generated only. * tests/includes/*.h: Test header files that are included by test stubs. * tests/good/*.defs: Valid definition files where generated stubs can be compiled. * tests/generate_only/*.defs: Valid definition files that can be generated but no compilation should be attempted. * tests/bad/*.defs: Definition files with problems that should be detected by MIG.