Commit Graph

214 Commits

Author SHA1 Message Date
Jeffrey Altman
091b6e19d1 Windows: Cleanup build scripts; no include\afs or include\rx
As part of the build system cleanup, minimize the number of
directories in which include\afs and include\rx paths are included
by default.  To acheive this goal the windows openafs dirent.h is
moved from include\afs to include, references whenever possible to
openafs headers included in include\afs or include\rx are prefixed
with afs\ or rx\ as appropriate.

Some source files or directories have a broad range of interdependencies
that make separation quite challenging.  For those directories or files
the inclusion of the path is added at the smallest possible level.
At some point in the future the WINNT\afsd\ headers should be moved
from include\afs to include\WINNT and should be installed there first
and then referenced internally from that location instead of from the
WINNT\afsd directory.  That will permit further cleanup to be performed.

Change-Id: I5e3a9623071c71db2f4445dc43266fdb3dad2c91
Reviewed-on: http://gerrit.openafs.org/2961
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-10-12 08:07:00 -07:00
Simon Wilkinson
f22ae5f7d8 Unix: Rework build system
Rework the unix build system so that we support taking CFLAGS and
LDFLAGS from the command line, and don't replace them with our own
settings. Also, take the opportunity to bring some sanity and
consistency into our Makefiles.

The standard Makefile.config  now defines rules for LWP, pthreaded
and shared library builds. The CFLAGS settings for these are
called LWP_CFLAGS, PTH_CFLAGS and SHD_CFLAGS, respectively.
Similarly named variables are provided for LDFLAGS.

A module may select to use a particular build type for its suffix
rule by including either Makefile.lwp, Makefile.pthread or
Makefile.shared from src/config. This creates an appropriate .c.o
suffix rule, defines AFS_CFLAGS and AFS_LDFLAGS as appropriate, and
creates two rules AFS_CCRULE and AFS_LDRULE, which can be used to
build, and link objects. For example:

foo.o: foo.c
	$(AFS_CCRULE) foo.c

foo: foo.o
	$(AFS_LDRULE) foo.o

If a you wish to override the CFLAGS or LDFLAGS for an object build
using these rules (or through the .c.o suffix rule) you can do so,
by defining CFLAGS_<object> or LDFLAGS_<object>. For example:

CFLAGS_foo.o= -DDEBUG
LDFLAGS_foo = -ldebugging

A module may also alter the behaviour of the compile and link steps
module wide by defining MODULE_CFLAGS or MODULE_LDFLAGS.

This functionality is now used throughout the tree:
    *) Suffix rules are used wherever possible, removing a number of
       unecessary build rules.
    *) All link steps are replaced with AFS_LDRULE
    *) All standard compile steps are replaced with AFS_CCRULE
    *) Unusal compile steps are defined, as far as possible, int
       terms of the LWP_ PTH_ and SHD_ variables.
    *) The use of $? has been removed entirely, as it makes it
       impossible to provide build rules with dependency information

Change-Id: If76207e45da402a0ed9d7c1bdbe83c58c911a4f2
Reviewed-on: http://gerrit.openafs.org/2896
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-10-11 08:00:29 -07:00
Simon Wilkinson
259cca4050 tests: Fix objdir builds
Fix the tests so that they work when we have a separate build
directory.

Change-Id: I1329a4186b126c84f611c9751fd228b80c80c82c
Reviewed-on: http://gerrit.openafs.org/2828
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-09-23 02:32:01 -07:00
Andrew Deason
a5bcd61a16 util: add afs_exec_alt
Add the function afs_exec_alt to help programs easily execute an
"alternate" version of themselves. For example, for programs that are
built with/without DAFS support, or are built for 32-bit/64-bit
structures, etc.

Change-Id: Ibb2b7105d58476f84bd9f15987f8b7df37314b6b
Reviewed-on: http://gerrit.openafs.org/2483
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-04 05:24:04 -07:00
Russ Allbery
a1351d4841 Fix ktime test on 64-bit systems
0xffffffff is a bad representation for -1 when the size of the data
type may vary.  Rather than forcing everything to 32 bits and losing
later on platforms with 64-bit time_t, change the table to use time_t
and try to add a cast that will do the right thing.

Change-Id: Id532c9b7a1fc215dc9fd532592fecb2ea45597a0
Reviewed-on: http://gerrit.openafs.org/2420
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-14 10:32:41 -07:00
Matt Benjamin
262a678d9b An RPC test dispatch library for vice
A library framework for remote testing against file servers,
with the ability to establish multiple call/callback channel
pairs within a single test process and dispatch requests
arbitrarily on each.  Thanks to Derrick for design and debugging
help.  Additional callback processing intelligence will follow
in a future changeset.  This version builds on Windows NT (but
might need further adjustment).

Change-Id: Ibea39e912b2a23ebf58e9e0931114572eccf6e78
Reviewed-on: http://gerrit.openafs.org/2229
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-12 11:24:14 -07:00
Russ Allbery
9e2aba9912 Fix ktime test for errors
The variable passed into ktime_DateToLong must be initialized to 0
or, on error, we get the previous value and the tests fail.

Change-Id: I5528a830981a85fb6737bb8cb5931ab95faffb13
Reviewed-on: http://gerrit.openafs.org/2379
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-10 06:35:53 -07:00
Derrick Brashear
19869b100c test suite warning safety
make test suite compile without warning

Change-Id: I4e4b63d6ce2ae73e5458913aa81308b2691044a9
Reviewed-on: http://gerrit.openafs.org/2223
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-22 08:47:58 -07:00
Russ Allbery
a62de61855 Build util tests properly with make check
If one runs make check without previously running make at the top
level first, it didn't build the util test programs properly.
Recurse into subdirectories for make check as well, and add the
check, test, and tests targets to tests/util/Makefile.in

Change-Id: Idc2caf4cf83a48da350e724aba2ac1228795085d
Reviewed-on: http://gerrit.openafs.org/2162
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-14 18:06:42 -07:00
Russ Allbery
52ffc6a152 Add additional documentation for the new test suite
Add a copy of docs/writing-tests from C TAP Harness as HOWTO and add
a README with some additional explanations more specific to OpenAFS.

Change-Id: Ic5b04805db6b00bcb82862ad8d2ebe466f2c266b
Reviewed-on: http://gerrit.openafs.org/2109
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-06-09 23:18:09 -07:00
Russ Allbery
6ee6125f71 Fix the trailing #endif comment in tests/tap/basic.h
Change-Id: I3a7dbda8d2792229365df4266ca43cbb4bc815bf
Reviewed-on: http://gerrit.openafs.org/2099
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-09 10:40:29 -07:00
Russ Allbery
74a332e7ee Add okv function to the TAP test library
Add an okv() varient of the ok() function that takes the arguments as
a va_list instead of as a variable argument list.  This makes it easier
to reuse ok() when writing other tests.

Change-Id: Icaeaaf9d6bd9d54bfd886a75961d98367ee0fb9a
Reviewed-on: http://gerrit.openafs.org/2098
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-09 10:39:29 -07:00
Russ Allbery
2e2494d6db Add a sample test program to the new test suite
Add a modified version of src/util/test_ktime to the new test suite
as an example of how to write a test program with the new harness.

Change-Id: Ifbceff1905f9f0dd686c2a2d2edc2f8796e7918f
Reviewed-on: http://gerrit.openafs.org/2063
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-29 21:48:40 -07:00
Russ Allbery
194c3f10d4 Import C TAP Harness 1.2 as a testing harness
Creates a new top-level tests directory that will be used for all
future automated test code eventually.  Import runtests and the
basic TAP library from C TAP Harness 1.2.  Add top-level check and
test targets that build the full source tree and then the new tests
directory, and then runs runtests on the test list.

Change-Id: I896f8ae488cd1dfa8529a10b4b479e45e7c67afe
Reviewed-on: http://gerrit.openafs.org/2062
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-05-29 21:48:19 -07:00