Does not cover scattered navigate and march, RAILWAYS 0, enemy action
while sitting at the prompt, and interdiction.
The test exposes bugs. They're marked "BUG:" in the test input.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Travis CI and OS X system make on 10.9.x at least don't have GNU make
>=3.82 which contains a parser enhancement that allows multiple
directives.
Signed-off-by: Gerd Flaig <gefla@pond.sub.org>
Here's why removing override is a good idea. The variable assignment
should already override anything Make may find in its environment.
All "override" does is protect against unwise make arguments.
"info make" says:
The `override' directive was not invented for escalation in the war
between makefiles and command arguments. It was invented so you can
alter and add to values that the user specifies with command
arguments.
Thus, override is ill-advised here.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Does not cover land unit retreat after a failed morale check.
The test exposes bugs. They're marked "BUG:" in the test input.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Stuff sitting on bridges isn't covered, yet. tests/fire has some. To
be moved here eventually.
The test exposes bugs. They're marked "BUG:" in the test input.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
drnuke_const is not covered, yet.
Random rounding causes some complications: sometimes build succeeds
without materials. Troublesome spots are clearly marked in the test
input.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Info pages in $(datadir)/empire/info.html/ and the directory
$(datadir)/empire/ aren't removed. Fix that.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Blow away $(einfodir) and $(ehtmldir). Without this, formatted pages
can linger after page removal. Matters, because info.c searches
$(einfodir) rather than the index $(einfodir)/all. Same for web
servers and $(ehtmldir).
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Expected to work only with thread package LWP, just like the smoke
test. Commit 7a91041 carelessly enabled it for all thread packages.
Revert, except with LWP.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This is a fairly comprehensive test of the deity commands to edit game
state: edit, setresource, setsector, give, swapsector.
The test makes edit screw up game state, triggering oopses. The
server refuses to start without -F then, and empdump -x warns "export
has errors, not importable as is". Until these bugs are fixed, skip
this test in "make check".
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Tests can't run in parallel anyway, because they use uses a single
sandbox directory and a single TCP port.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Since subjects were added in Empire 2, we've always picked them up
from .SA requests. If you mistype a subject there, you get a "is a
NEW subject" warning, and incorrect subject pages. When building a
pristine tree, you get bogus "is a NEW subject" warnings for all
subjects. If you somehow delete the generated subjects.mk, but not
the generated subject files, the build breaks.
Declare subjects in Make variable subjects. Drop generated makefile
subject.mk.
Treat unknown topics in .SA arguments as errors. This replaces the
"$subj is a NEW subject" warning.
Treat subjects without member pages as errors. This replaces the "The
subject $subj has been removed" warning.
Safer and simpler.
We used to do all the info indexing work in info.pl: find subjects,
create subjects.mk (to tell make the list of subjects), the subject
pages, and TOP.t. Worked, but touching an info page triggered a full
rebuild of all subject pages and TOP.t.
Commit 2f14064 (v4.3.0) tried to avoid that by splitting info.pl into
findsubj.pl, mksubj.pl, mktop.pl. findsubj.pl puts not just the
subjects into subjects.mk, but also make rules for the subject pages,
to guide their remaking. mksubj.pl creates a single subject page.
mktop.pl creates TOP.t.
Unfortunately, this doesn't work so well. Since subjects.mk doesn't
exist in a virgin tree, we use -include. Unwanted consequence:
findsubj.pl failure doesn't stop make. Moreover, the complex make
machinery breaks down when info sources get removed or subjects get
dropped.
Go back to the old method, except keep mktop.pl separate, as that part
works just fine, and use simpler make rules. mksubj.pl now creates
subjects.mk and all subject pages, like info.pl did.
This effectively reverts most of commit 2f14064. I'll address the
excessive rebuilding of subject pages in a different way shortly.
Remaking config.h and config.h.in updates the target only when its
contents actually changes. This is important, because after updating
config.h we need to recompile everything.
The make rules to do that are straight from the Autoconf manual. But
they don't work: the rules that connect config.h and config.h.in to
stamp-h and stamp-h.in don't have recipes. Since make doesn't have an
implicit rule either, it concludes that the target remains unchanged.
It still updates the prerequisites. The recipe for updating the stamp
files then change the the targetes behind make's back. Make misses
the change of config.h and/or config.h.in, and we get an incomplete
rebuild.
The rules need empty recipes instead. This Autoconf manual was fixed
accordingly in autoconf.git commit 6b42b38.
Just a smoke test so far, extracted from src/scripts/nightly/. This
makes the existing smoke test more easily accessible. Noteworthy
differences:
* Instead of patching the code to make output more stable, postprocess
the output to normalize it.
* Compare actual results to expected results instead of the previous
test run's results.
* Much faster. The old test harness used sleep liberally to "ensure"
things always happen in the same order.
Known shortcomings:
* The smoke test hangs when the server fails to complete startup, or
fails to terminate.
* Normalization of xdump hardcodes columns instead of getting them
from xdump meta.
* Normalization of time values in xdump is an ugly hack.
* xdump meta column type isn't normalized. Actual values can vary
between systems, because the width of enumeration types is
implementation-defined. The smoke test works only when they're
represented as int, which is the case on common systems.
* Currently expected to work only with thread package LWP and a
random() that behaves exactly like the one on my development system,
because:
- Thread scheduling is reliably deterministic only with LWP
- The PRN sequence produced by random() isn't portable
- Shell builtin kill appears not to do the job in MinGW
- The Windows server tries to run as service when -d isn't
specified
Further work is needed to address these shortcomings.
Getting C programs behave exactly the same on all systems is hard.
We'll likely run into system-dependent differences that upset the
smoke test. Floating-point computation seems particularly vulnerable.
Instead of updating src/scripts/nightly/ to use "make check", retire
it. It hasn't been used in quite a while. Investing more into our
homegrown auto-builder doesn't make sense, as canned auto-builders
such as Travis CI and Jenkins are readily available.
The shell scripts src/scripts/nightly/tests/?? become Empire batch
files tests/smoke/. The shell scripts are actually shell boilerplate
around Empire batch files. To make sure git recognizes the move, this
commit moves them unchanged. tests/smoke-test strips the boilerplate
before it feeds the batch files to the client. The next commit will
get rid fo that.
This gets rid of the memory leak mentioned in the previous commit.
To get rid of the buffer overruns for long paths mentioned in the
previous commit, make BestLandPath() fail when path length exceeds
1023 characters.
assemble_dist_paths() and move_ground() pass buffers with a different
size. Eliminate assemble_dist_paths()'s buffer. Update now works
regardless of distribution distance (the distribute command still
limits to 1023, to be fixed in a later commit). Enlarge
move_ground()'s buffers. Doubles the length of paths accepted by
explore, move, and transport.
I use two test cases to benchmark the path finders: "continental" (Hvy
Metal 2 updates) and "island" (Hvy Plastic 2 updates).
The new path finder runs my tests around 3-4 times faster than the old
A* without its caches. That's enough to meet its cached performance
for "island", but it's only half as fast for "continental". Not for
long; big speedups are coming.
Why upgrade? I'm not a lawyer, but here's my take on the differences
to version 2:
* Software patents: better protection against abuse of patents to
prevent users from exercising the rights under the GPL. I doubt
we'll get hit with a patent suit, but it's a good move just on
general principles.
* License compatibility: compatible with more free licenses, i.e. can
"steal" more free software for use in Empire. I don't expect to steal
much, but it's nice to have the option.
* Definition of "source code": modernization of some details for today's
networked world, to make it easier to distribute the software. Not
really relevant to us now, as we normally distribute full source code.
* Tivoization: this is about putting GPL-licensed software in hardware,
then make the hardware refuse to run modified software. "Neat" trick
to effectively deny its users their rights under the GPL. Abuse was
"pioneered" by TiVo (popular digital video recorders). GPLv3 forbids
it. Unlikely to become a problem for us.
* Internationalization: more careful wording, to harden the license
outside the US. The lawyers tell us it better be done that way.
* License violations: friendlier way to deal with license violations.
This has come out of past experience enforcing the GPL.
* Additional permissions: Probably not relevant to us.
Also include myself in the list of principal authors.
Many commands, compiler invocations in particular, are rather long,
and warnings tend to get lost in the noise. Suppress the command
details. Run make with a V=1 parameter for full output.
Move client's w32_connect() to w32sockets.c.
Replace w32_recv() and w32_send() by read() and write().
Replace w32_close() by w32_close_function.
Replace call of WSAStartup() in w32_sysdep_init() by
w32_socket_init().
Remove the identical copies of fd_is_socket(),
w32_set_winsock_errno(), w32_socket().
This reverts commit 3ec807e99a.
Our nightly build test cases rely on the PRN sequence generated by GNU
libc's random(). We used to have such a PRNG in our tree (derived
from an old version of GNU libc's), for use under Windows. Thus we
got the same PRN sequence on both our nightly test systems. Commit
3ec807e9 switched to -liberty under Windows and removed our random().
Now we got a different sequence there, breaking the test cases.
Test cases still don't work on non-Windows systems where random()
doesn't match GNU libc's. We should switch to a PRNG that produces
the same sequence everywhere.
Conflicts:
src/lib/w32/w32misc.h
This is so we can avoid linking utilities with socket libraries (see
commit 8b778634).
When using sockets, we need to replace close(), because Windows'
close() can't cope with socket file descriptors. But replacing it
always would pull in the socket stuff again. Define close() to call
function pointer w32_close_function, which is initially _close.
Rename posix_close() to w32_close_maybe_socket(). Make new
w32_socket_init() put it in w32_close_function.
Same for read() and write(): define read(), write() to call function
pointers w32_read_function, w32_write_function, initially _read(),
_write(); rename posix_read(), posix_write() to
w32_read_maybe_socket(), w32_write_maybe_socket(), and put them into
w32_read_function, w32_write_function in w32_socket_init().
Also call WSAStartup() there, and use that from loc_NTInit().
WSACleanup() now belongs next to w32_socket_init(). Don't bother,
just drop it, along with loc_NTTerm().
Make configure compute three sets of libraries: LIBS_client for the
client, LIBS_server for the server, and LIBS for the rest. This
replaces termlibs.
Unfortunately, LIBS doesn't work with Windows, because
src/lib/w32/posixio.c pulls in socket stuff. Temporary workaround:
use LIBS_server instead.