Commit graph

4568 commits

Author SHA1 Message Date
cf942fbf1b tests: Use feed_files for setup scripts
To make setup scripting more similar to test scripting.  Also permits
use of countries other than POGO there, but that isn't necessary right
now.

Setup scripts renamed from init_script to setup-POGO.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 10:09:16 +01:00
c82a481bc3 tests: Name compared files relative to sandbox in output
Instead of relative to build directory.  Shorter, and independent of
the path from build to source directory.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 10:09:16 +01:00
ab913d73f9 tests: Rename final xdump files to final.xdump
The other test output files have fixed names, and having just one with
a name that varies with the test name complicates things with no gain.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 10:09:16 +01:00
d38b685ca3 tests: Disable GODNEWS by default
Only actofgod-test wants it.  Enable it there.  The others either
don't want it (fire-test), or don't care.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 10:09:16 +01:00
ca21354d56 tests: Factor feed_dir out of fire-test and smoke-test
Smoke test's player input files renamed from $cnum to $ordnum-$cname
to keep feed_dir simple.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 10:09:16 +01:00
4f2b8eea10 tests: Move "not expected to work" warning into test-common.sh
Warn the first time a server is started.  Incorrect for info-test with
POSIX threads, so suppress the warning there.

Improve the warning message a bit while we're at it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 10:08:20 +01:00
ab244cbbe7 .gitignore: Ignore sandbox
Missed in commit 49b2b13, v4.3.31.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 08:18:38 +01:00
3697a0a20b tests: Normalize trailing white space in test output completely
Commit 37ff377 stripped trailing white space in test output, except
for journal.log, where it stripped it only from player output.  This
misses the space preceeding player empty output, and doesn't cover
equally annoying trailing white space elsewhere, such as the space
preceeding empty input and trailing white space in prompts.  Testing
the latter could be marginally useful, but let's keep things simple,
and strip all trailing white space for now.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-19 08:14:33 +01:00
4dd38ddfe5 tests/fire: New; exercises fire command
Return fire not covered, yet.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:50:06 +01:00
0f84c009bf update: Set thread stack size to 512 KiB
Empire 2 settled on this formula for the stack size:

	stacksize = 100000 +
    /* finish_sects */ WORLD_X * WORLD_Y * (2 * sizeof(double) +
					    sizeof(char *));

Obviously attempts to provide space for a known configuration-
dependent stack hog.  The hog went away when finish_sects()'s arrays
became dynamically allocated in 4.2.0.

Adjusting for that by dropping the extra term might well do (I observe
only a few KiB of stack used on my system).  But let's set it to 512
KiB instead to be on the safe side.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:50:06 +01:00
030b374db7 accept: Resize thread stack to avoid stack smash for small worlds
I observed a stack overflow in news command on my x86_64 system
running Fedora 18.

Empire 2 settled on this formula for the stack size:

	    stacksize = 100000
    /* budget */  + MAX(WORLD_SZ() * sizeof(int) * 7,
    /* power */ MAXNOC * sizeof(struct powstr));

Obviously attempts to provide space for known configuration-dependent
stack hogs.

The first hog is allegedly budget.  Bogus since day one: its large
arrays were static in Empire 2, and became dynamically allocated in
Empire 3.

The second one makes some sense: powe() has a struct powstr[MAXNOC].
It also has an int[MAXNOC], which isn't accounted for.

Except for ridiculously small worlds, the second term is smaller, and
only the (bogus) first term matters.

Two hogs are missing: head() has a struct histstr[MAXNOC][MAXNOC], and
news() has a short[MAXNOC][MAXNOC].  It also calls head().

I looked for more hogs with "gcc -fstack-usage", and found none.

On my x86_64 system, a news command needs almost 107KiB of stack.
Only slightly less when compiled for 32 bit.  Stack overrun for worlds
with fewer than some 320 sectors, thus unlikely to bite in real games.

Increase player stack size to 1 MiB.  Using MAXNOC to size the stack
isn't worth the trouble.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:50:06 +01:00
90eaf9d9eb tests/info: New; checks info and code agree on commands
Replaces info/checklist.pl, which has been broken since
commit 56d9445, v4.3.0.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:50:06 +01:00
0a702949db info/toc: New; generated machine-readable table of contents
Next commit will put it to use.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:50:06 +01:00
8a94f2a8ae tests: Make helper begin_test accept any number of arguments
Zero arguments mean "read the script from stdin", so you can write
begin_test <<EOF...

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:50:05 +01:00
e0668ff294 info: Nicer remaking of info subject index pages
Give quiet-command a more useful last argument.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:50:05 +01:00
4709c68dad info/show: Update example to current output
White space change only, actually.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:50:03 +01:00
18aa3d0883 order: Trim trailing space from usage string
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:50:00 +01:00
00883256db Trim trailing white space from source code
Normally, git's pre-commit hook protects us from them.  However, when
expected test output contains trailing white space, we have to bypass
commit hooks.  Unwanted space can then slip in if you don't pay
attention.  I obviously didn't; clean up.

The previous commit should reduce the need for such hook suppression.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:49:59 +01:00
37ff3774ec tests: Normalize trailing white space away in test output
We don't really care for it there, and git's pre-commit hook flags it,
which is annoying.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:49:59 +01:00
d28487acac maps: Trim unwanted trailing space from map decoration
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:49:59 +01:00
aafcd97476 resource: Trim unwanted trailing space from output
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:49:59 +01:00
c83cfbe33c edit: Trim unwanted trailing space from output
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:49:59 +01:00
02e00ed53b commands: Trim obvious silly trailing space from output
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:49:59 +01:00
df614a9bdc tests: Document log file normalization a bit better
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:49:59 +01:00
d0d692e415 tests: New helper function feed_input, for comment support
feed_input drops lines starting with a bar character '|', so they can
serve as comments.  Syntax chosen because such lines shouldn't be
needed in tests.  In particular, the server already ignores such lines
when it reads commands, because they get parsed as empty command with
a pipeline, and empty commands get ignored, regardless of
redirections.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:49:56 +01:00
71cb2d8940 tests: Use only files known to git
Filename expansion can pick up junk files.  Use git-ls-files instead.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-06 20:49:45 +01:00
bb467c335d Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:48 +01:00
b4c8a2238c Update known contributors comments
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:48 +01:00
1325bc179b start stop: Don't operate on dead units when used by a deity
Screwed up when start, stop were extended to units in commit eb1512d,
v4.3.6.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:48 +01:00
216470a8d5 edit: Implement edit nuke
Has been "not implemented yet" since the dawn of time.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:48 +01:00
b68b3c4589 edit: Suppress bulletin on no-op unit location change
Screwed up in commit a03d804f, v4.3.32.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:48 +01:00
5dd2cbd423 stockpile: New command, counterpart of fleetadd, wingadd, army
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:48 +01:00
76b5de8343 nukes: Enable group syntax for <NUKES> arguments
Not interesting without way to make stockpiles.  That's next.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:48 +01:00
329da055dd nukes: New selector stockpile
Not interesting without way to make stockpiles.  Coming soon.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:47 +01:00
cf1c2e9f3c start stop: Add missing <NUKES> to usage string
Forgotten in commit eb1512d, v4.3.6.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:47 +01:00
1042d08b94 ndump nuke: Fix usage string: <NUKES> instead of <SECTS>
nuke's usage string was broken in Empire 2.  ndump's usage string has
always been wrong.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:47 +01:00
e010fa5f2f info/ndump: Belatedly update for v4.3.3's nuke storage change
Commit 2e40a4b (v4.3.3) changed ndump, but not its info page.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:47 +01:00
e616af34e3 wingadd: Charge no BTUs, for consistency with fleetadd and army
Chainsaw 3 made fleetadd and army cost no BTUs, but wingadd was
forgotten.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:47 +01:00
6b0b6f174b edit: Add editing of ship, plane and land unit type
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:47 +01:00
3be53fddb3 edit: Factor edit_item() out of edit_ship(), edit_land()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:37 +01:00
2936e07f41 edit: Make unit owner change away from POGO work
Units owned by POGO are not in use.  Giving a unit to POGO destroys
it.  The opposite doesn't work, however: the unit prewrite hooks give
it right back to POGO, because efficiency is below the minimum.  Make
it work by also increasing efficiency to minimum.

Note that you can't use this to create a unit that doesn't already
exist in the respective file.  That's because edit's second argument
selects from existing objects only.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:07:22 +01:00
3404b9ce7f tests: Factor out begin_tests(), end_tests()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:07:22 +01:00
5de1e5ec5f tests: Drop smoke.out, actofgod.out
Uninteresting since commit 9ca3fa9, v4.3.32.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:07:22 +01:00
78d28c90ad uninstall: Fix to remove everything installed under $(datadir)
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>
2014-01-02 14:07:22 +01:00
e1273ae4ca install: Remove stale formatted info pages
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>
2014-01-02 14:07:10 +01:00
ee1f146dd8 Update change log again for 4.3.32
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-25 09:56:58 +02:00
4f6a3c9aae actofgod: Simplify fmtflags()'s error checking
Permit finding length by passing no buffer.  Not currently used.

Oops at most once.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-25 09:51:39 +02:00
1a27107bed server: Grow small thread stacks from 50 KiB to 64 KiB
Affected are threads AcceptPlayers, MarketUpdate, shutdownSeq.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-17 17:57:40 +02:00
8330b6f322 lwp: Increase EventHandler's stack size from 16 KiB to 64 KiB
Stack overflow observed on IBM Power 730 Express running AIX 7.1.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-17 17:57:37 +02:00
41c8033346 src/client/Makefile.in: Avoid :=, it breaks traditional make
Broken in commit c4ffd0a, v4.3.0.  Observed on AIX 7.1.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-17 17:57:37 +02:00