summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2025-02-17Fix build in c23 modeSamuel Thibault
as enabled by default in gcc-15
2024-07-04Make the MiG test suite compatible with GCC 14.Flavio Cruz
We need to expose the function declarations in mig_support.h. Also fix test setup to work well in cases the build directory is not inside the source directory. Message-ID: <jjbpmhtxy4nybcmhlzueeenyv5taj4zygmsx6w336ggzcbr5yx@tnkp2ycfkf3t>
2022-12-21Fix make checkv1.8+git20221221Samuel Thibault
c7654756ee19 ("Provide intptr_t and uintptr_t as default types") added intptr_t and uintptr_t, but missed updating the testsuite.
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.
2020-01-28Make MIG recognize the basic C integral types.Flavio Cruz
Also removed itMakeIntType which was not used anymore. Users can use char, int, and short types without having to define them. These types are defined using the builtin MACH_MSG_TYPE_* types and are architecture independent since they have the same size as the C char, short and int. If these basic types are redefined, MIG will still produce stub code but will produce a warning. * cpu.sym: Define sizeof_int, char, short. * tests/base_types.defs: Remove int. * tests/good/complex-types.defs: Use byte instead of char. * tests/good/directions: Remove char and int. * tests/good/types.defs: Remove char and also use short as a parameter in 'alltypes'. * type.c: Define itCIntTypeDecl. Remove itMakeIntType. Call itInsert for char, short and int. Message-Id: <20160419070513.GA12642@debian>
2016-05-03Add missing EXTRA_DISTSamuel Thibault
* tests/Makefile.am (EXTRA_DIST): Add base_types.defs test_lib.sh includes/all.h includes/mach/mig_support.h includes/server.h includes/types.h includes/user.h. * tests/bad/Makefile.am (EXTRA_DIST): Add $(TESTS) run_bad_test.sh. * tests/generate-only/Makefile.am (EXTRA_DIST): Add $(TESTS) run_generate_only_test.sh. * tests/good/Makefile.am (EXTRA_DIST): Add $(TESTS) run_good_test.sh.
2016-04-20Use the target platform compiler in the test scriptsDavid Michael
* tests/Makeconf.am (AM_TESTS_ENVIRONMENT): Set CC to $(TARGET_CC).
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.