1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

r7059: Use namespaces for pidl and the build system, so we can later on

call out to the build system to compile the various pidl tests
(without having to rely on shared library support).

Initial work on an ndr_array test.
(This used to be commit 2b08c4b92b4f56180c123a502bdcc6c40188c07f)
This commit is contained in:
Jelmer Vernooij 2005-05-28 23:38:52 +00:00 committed by Gerald (Jerry) Carter
parent 26ced62131
commit 1deb402445
21 changed files with 116 additions and 71 deletions

View File

@ -3,7 +3,7 @@
package COMHeader;
use typelist;
use pidl::typelist;
use strict;

View File

@ -6,7 +6,7 @@
package DCOMProxy;
use com_header;
use pidl::com_header;
use strict;

View File

@ -7,7 +7,6 @@
package EthHeader;
use strict;
use typelist;
my($res);
my($tab_depth);

View File

@ -8,8 +8,8 @@
package EthParser;
use strict;
use typelist;
use ndr;
use pidl::typelist;
use pidl::ndr;
# the list of needed functions

View File

@ -2390,7 +2390,7 @@ sub
#line 305 "build/pidl/idl.yp"
use util;
use pidl::util;
sub _Error {
if (exists $_[0]->YYData->{ERRMSG}) {

View File

@ -304,7 +304,7 @@ optional_semicolon:
# start code
%%
use util;
use pidl::util;
sub _Error {
if (exists $_[0]->YYData->{ERRMSG}) {

View File

@ -8,7 +8,7 @@
package Ndr;
use strict;
use typelist;
use pidl::typelist;
#####################################################################
# return a table describing the order in which the parts of an element

View File

@ -7,7 +7,7 @@
package NdrHeader;
use strict;
use typelist;
use pidl::typelist;
my($res);
my($tab_depth);

View File

@ -8,8 +8,8 @@
package NdrParser;
use strict;
use typelist;
use ndr;
use pidl::typelist;
use pidl::ndr;
# list of known types
my %typefamily;

View File

@ -10,28 +10,27 @@
use strict;
use FindBin qw($RealBin);
use lib "$RealBin";
use lib "$RealBin/lib";
use lib "$RealBin/..";
use Getopt::Long;
use File::Basename;
use idl;
use dump;
use ndr_client;
use ndr_header;
use ndr_parser;
use server;
use dcom_proxy;
use dcom_stub;
use com_header;
use odl;
use eth_parser;
use eth_header;
use validator;
use typelist;
use util;
use template;
use swig;
use compat;
use pidl::idl;
use pidl::dump;
use pidl::ndr_client;
use pidl::ndr_header;
use pidl::ndr_parser;
use pidl::server;
use pidl::dcom_proxy;
use pidl::dcom_stub;
use pidl::com_header;
use pidl::odl;
use pidl::eth_parser;
use pidl::eth_header;
use pidl::validator;
use pidl::typelist;
use pidl::util;
use pidl::template;
use pidl::swig;
use pidl::compat;
my($opt_help) = 0;
my($opt_parse) = 0;
@ -59,33 +58,32 @@ my $idl_parser = new idl;
# display help text
sub ShowHelp()
{
print "
perl IDL parser and code generator
Copyright (C) tridge\@samba.org
print "perl IDL parser and code generator
Copyright (C) tridge\@samba.org
Usage: pidl.pl [options] <idlfile>
Usage: pidl.pl [options] <idlfile>
Options:
--help this help page
--output=OUTNAME put output in OUTNAME.*
--parse parse a idl file to a .pidl file
--dump dump a pidl file back to idl
--header[=OUTFILE] create a C NDR header file
--parser[=OUTFILE] create a C NDR parser
--client create a C NDR client
--server create server boilerplate
--template print a template for a pipe
--eth-parser create an ethereal parser
--eth-header create an ethereal header file
--swig create swig wrapper file
--diff run diff on the idl and dumped output
--keep keep the .pidl file
--odl accept ODL input
--dcom-proxy create DCOM proxy (implies --odl)
--com-header create header for COM interfaces (implies --odl)
--warn-compat warn about incompatibility with other compilers
--quiet be quiet
\n";
Options:
--help this help page
--output=OUTNAME put output in OUTNAME.*
--parse parse a idl file to a .pidl file
--dump dump a pidl file back to idl
--header[=OUTFILE] create a C NDR header file
--parser[=OUTFILE] create a C NDR parser
--client create a C NDR client
--server create server boilerplate
--template print a template for a pipe
--eth-parser create an ethereal parser
--eth-header create an ethereal header file
--swig create swig wrapper file
--diff run diff on the idl and dumped output
--keep keep the .pidl file
--odl accept ODL input
--dcom-proxy create DCOM proxy (implies --odl)
--com-header create header for COM interfaces (implies --odl)
--warn-compat warn about incompatibility with other compilers
--quiet be quiet
\n";
exit(0);
}

View File

@ -5,7 +5,7 @@
package Test;
use strict;
use util;
use pidl::util;
use Getopt::Long;
my $cc = $ENV{CC};

View File

@ -4,7 +4,7 @@
use strict;
use FindBin qw($RealBin);
use lib "$RealBin/..";
use lib "$RealBin/../..";
use test;
my %settings = Test::GetSettings(@ARGV);

View File

@ -4,7 +4,7 @@
use strict;
use FindBin qw($RealBin);
use lib "$RealBin/..";
use lib "$RealBin/../..";
use test;
my %settings = Test::GetSettings(@ARGV);

View File

@ -0,0 +1,47 @@
#!/usr/bin/perl
# Array testing
# (C) 2005 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU General Public License
use strict;
use FindBin qw($RealBin);
use lib "$RealBin/../..";
use test;
my %settings = Test::GetSettings(@ARGV);
$settings{'IDL-Arguments'} = ['--quiet', '--parse', '--parser=ndr_test.c', '--header=ndr_test.h'];
$settings{'IncludeFiles'} = ['ndr_test.h'];
$settings{'ExtraFiles'} = ['ndr_test.c'];
Test::test_idl(
# Name
'Fixed-Array',
# Settings
\%settings,
# IDL
'[public] void Test([in] uint8 x[10]);',
# C Test
'
uint8_t data[] = {1,2,3,4,5,6,7,8,9,10};
int i;
DATA_BLOB b;
struct ndr_pull *ndr;
struct Test r;
b.data = data;
b.length = 10;
ndr = ndr_pull_init_blob(&b, mem_ctx);
if (NT_STATUS_IS_ERR(ndr_pull_Test(ndr, NDR_IN, &r)))
return 1;
if (ndr->offset != 10)
return 2;
for (i = 0; i < 10; i++) {
if (r.in.x[i] != i+1) return 3;
}
');

View File

@ -6,7 +6,7 @@
use strict;
use FindBin qw($RealBin);
use lib "$RealBin/..";
use lib "$RealBin/../..";
use test;
my %settings = Test::GetSettings(@ARGV);

View File

@ -5,7 +5,7 @@
use strict;
use FindBin qw($RealBin);
use lib "$RealBin/..";
use lib "$RealBin/../..";
use test;
my %settings = Test::GetSettings(@ARGV);

View File

@ -5,7 +5,7 @@
use strict;
use FindBin qw($RealBin);
use lib "$RealBin/..";
use lib "$RealBin/../..";
use test;
my %settings = Test::GetSettings(@ARGV);

View File

@ -7,7 +7,7 @@
###########################################################
package config_mk;
use input;
use smb_build::input;
use strict;

View File

@ -19,12 +19,12 @@ dnl )
AC_DEFUN([_SMB_BUILD_CORE],
[
$PERL -I$srcdir/build/smb_build <<\_SMB_ACEOF
$PERL -I$srcdir/build <<\_SMB_ACEOF
use strict;
my %INPUT;
use main;
use smb_build::main;
###########################################################
### First we list all info from configure ###

View File

@ -6,12 +6,12 @@
### Released under the GNU GPL ###
###########################################################
use makefile;
use smb_build_h;
use input;
use config_mk;
use output;
use dot;
use smb_build::makefile;
use smb_build::smb_build_h;
use smb_build::input;
use smb_build::config_mk;
use smb_build::output;
use smb_build::dot;
use strict;
sub smb_build_main($)

View File

@ -4,3 +4,4 @@
./build/pidl/tests/ndr_alloc.pl
./build/pidl/tests/ndr_refptr.pl
./build/pidl/tests/ndr_string.pl
./build/pidl/tests/ndr_array.pl