r7059: Use namespaces for pidl and the build system, so we can later on
authorJelmer Vernooij <jelmer@samba.org>
Sat, 28 May 2005 23:38:52 +0000 (23:38 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:10 +0000 (13:17 -0500)
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)

21 files changed:
source4/build/pidl/com_header.pm
source4/build/pidl/dcom_proxy.pm
source4/build/pidl/eth_header.pm
source4/build/pidl/eth_parser.pm
source4/build/pidl/idl.pm
source4/build/pidl/idl.yp
source4/build/pidl/ndr.pm
source4/build/pidl/ndr_header.pm
source4/build/pidl/ndr_parser.pm
source4/build/pidl/pidl.pl
source4/build/pidl/test.pm
source4/build/pidl/tests/ndr_align.pl
source4/build/pidl/tests/ndr_alloc.pl
source4/build/pidl/tests/ndr_array.pl [new file with mode: 0755]
source4/build/pidl/tests/ndr_refptr.pl
source4/build/pidl/tests/ndr_simple.pl
source4/build/pidl/tests/ndr_string.pl
source4/build/smb_build/config_mk.pm
source4/build/smb_build/core.m4
source4/build/smb_build/main.pm
source4/script/tests/test_pidl.sh

index 1e5f338828efa38957750dddbfbf074f48c95fc3..1e178eed850083e3fd844a4e3a949c6803de5c16 100644 (file)
@@ -3,7 +3,7 @@
 
 package COMHeader;
 
-use typelist;
+use pidl::typelist;
 
 use strict;
 
index 3d460645484a0ae7919621d08252085f9cac1e4e..bb45f774ef7fdaf734aafc910819929c510011be 100644 (file)
@@ -6,7 +6,7 @@
 
 package DCOMProxy;
 
-use com_header;
+use pidl::com_header;
 
 use strict;
 
index 2e0397df37a95933ee1201f9baa3e761a46d013f..229b4f8051061fd8089c8b18b84133dc589c775c 100644 (file)
@@ -7,7 +7,6 @@
 package EthHeader;
 
 use strict;
-use typelist;
 
 my($res);
 my($tab_depth);
index d0a4ae7c66f8e0d62d1a5c5f48446fc735d5dea5..43ed8b841a2fa7c9122aaaf9a002663585cba325 100644 (file)
@@ -8,8 +8,8 @@
 package EthParser;
 
 use strict;
-use typelist;
-use ndr;
+use pidl::typelist;
+use pidl::ndr;
 
 # the list of needed functions
 
index 21c06ab200505f6206ac8a626fe51c5b36f5faf1..156a3435e60ae4c718f61b6ad32642b8f2285f94 100644 (file)
@@ -2390,7 +2390,7 @@ sub
 #line 305 "build/pidl/idl.yp"
 
 
-use util;
+use pidl::util;
 
 sub _Error {
     if (exists $_[0]->YYData->{ERRMSG}) {
index 2b839b0e21aa7860f09c14c4111f09627cdda892..e28323762760b896d4bededadfe9e4eecf2e3214 100644 (file)
@@ -304,7 +304,7 @@ optional_semicolon:
 # start code
 %%
 
-use util;
+use pidl::util;
 
 sub _Error {
     if (exists $_[0]->YYData->{ERRMSG}) {
index a7c10d4906b1c9dceb95d36f1ebf754bfdcd5b12..98e3d2b4bc6ec52630cc837da56089acf89cb90b 100644 (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
index 05265bbf5bd12b91433b223ec62b788fdaaf371a..576361260f1c3e1429ae869ad3cb4bd4a75ebfdd 100644 (file)
@@ -7,7 +7,7 @@
 package NdrHeader;
 
 use strict;
-use typelist;
+use pidl::typelist;
 
 my($res);
 my($tab_depth);
index f94de5e2be33b28e8b93be849423938fa8dd95a0..be663269f86937dcce8c03ab8dcc3479e407b86f 100644 (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;
index c7b98a0d34e37dc032e94456965a74b99ab4a3d2..478c7a273a912aeb19d6e4f8428497f497ab32bd 100755 (executable)
 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
-
-       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";
+print "perl IDL parser and code generator
+Copyright (C) tridge\@samba.org
+
+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";
     exit(0);
 }
 
index 5f25d4195c1ed9bb6f3c87a9f210c7e20fc8405b..ba102aab128b95a8654a2f03744759b1f42db9bd 100644 (file)
@@ -5,7 +5,7 @@
 package Test;
 
 use strict;
-use util;
+use pidl::util;
 use Getopt::Long;
 
 my $cc = $ENV{CC};
index 03b09e875887ca0e97afed761776872b365d6027..1796c045f56a3ca8dd72f017fbfd39ec44df56f6 100755 (executable)
@@ -4,7 +4,7 @@
 use strict;
 
 use FindBin qw($RealBin);
-use lib "$RealBin/..";
+use lib "$RealBin/../..";
 use test;
 
 my %settings = Test::GetSettings(@ARGV);
index 7918f312d49a3c3c24d22a69c35bca67d6902fc0..d3827599306cdaf0a6aa687d410fc37aee82649a 100755 (executable)
@@ -4,7 +4,7 @@
 use strict;
 
 use FindBin qw($RealBin);
-use lib "$RealBin/..";
+use lib "$RealBin/../..";
 use test;
 
 my %settings = Test::GetSettings(@ARGV);
diff --git a/source4/build/pidl/tests/ndr_array.pl b/source4/build/pidl/tests/ndr_array.pl
new file mode 100755 (executable)
index 0000000..bd78f34
--- /dev/null
@@ -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;
+       }
+');
index 59ebd295f6913142fe7b1099f27a06a7826e2187..d42a34d1b0ecbfab6cef430101a02564b8a7a4e5 100755 (executable)
@@ -6,7 +6,7 @@
 use strict;
 
 use FindBin qw($RealBin);
-use lib "$RealBin/..";
+use lib "$RealBin/../..";
 use test;
 
 my %settings = Test::GetSettings(@ARGV);
index 7049dfa68d64cf63343400490be32902b973e78b..de2f34383ed2e256d96be02a47d39aef209a5a73 100755 (executable)
@@ -5,7 +5,7 @@
 use strict;
 
 use FindBin qw($RealBin);
-use lib "$RealBin/..";
+use lib "$RealBin/../..";
 use test;
 
 my %settings = Test::GetSettings(@ARGV);
index 9ea4ca42b64442bb9ee0e716fc3e2a9f40eb90f9..1c75eb90ccd52b9557b581d4df8bc49cf6284445 100755 (executable)
@@ -5,7 +5,7 @@
 use strict;
 
 use FindBin qw($RealBin);
-use lib "$RealBin/..";
+use lib "$RealBin/../..";
 use test;
 
 my %settings = Test::GetSettings(@ARGV);
index 36ce80a8ebbb17b575a36b336682fb20440ecb5e..f6e2e4bdcde1f52e4af00955d707846704326539 100644 (file)
@@ -7,7 +7,7 @@
 ###########################################################
 
 package config_mk;
-use input;
+use smb_build::input;
 
 use strict;
 
index 1ef6eea3adfdd3d3c84bf15bb4c52cbfd32e84b4..215ca5195e70fa9ab054355cb93ca117d8a2b8dd 100644 (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              ###
index 620812a457d8aca34933da7033fa27011c06a7c6..dd0487110aaf6930efd5e8cf166348737e6f57b6 100644 (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($)
index 07c144a65fe39822079382e317e8d6767e643a53..0fd2eb8998554f6a435b0717aa336a53cd7a258c 100755 (executable)
@@ -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