summaryrefslogtreecommitdiff
path: root/t (follow)
Commit message (Collapse)AuthorAge
* test: Change suffix of test scripts to .bash.Andre Noll2026-07-03
| | | | All of these are bash scripts, after all.
* test: Rename makefile.test.Andre Noll2026-07-03
| | | | | The lopsub and the bison makefiles which are included from Makefile.real are simply called "makefile", so let's be consistent.
* test: Use bash case modification.Andre Noll2026-07-03
| | | | This saves a tr(1) invocation per executable.
* test: Simplify color output.Andre Noll2026-07-03
| | | | | | | Use ANSI escape sequences instead of running tput(1) many times. We now set and reset the color in one step, so colors are no longer messed up when running tests in parallel. This allows us to remove the .NOTPARALLEL: target in makefile.test.
* test: Replace echo by printf.Andre Noll2026-07-03
| | | | | In view of the "irreconcilable differences in the various versions of echo" (see the POSIX(1) man page of printf), printf should be preferred over echo.
* test: Remove unused --immediate and --long.Andre Noll2026-07-03
|
* test: Trivial coding style cleanups.Andre Noll2026-07-03
| | | | | Remove superfluous quotes, replace double quotes by single quotes where possible, and prevent double expansion in arithmetic evaluation.
* test-lib: Don't run tests in parallel.Andre Noll2026-05-29
| | | | | | | | Doing so does not save much time, and it causes messages to be printed in incorrect colors because terminal access is not serialized. We still want to run the recipes of the regular build in parallel, though. Fixes: 2114be1d4f21e2a851b4d0d60c47fa505250d85b
* server: Replace the init subcommand by --init.Andre Noll2026-03-13
| | | | | This simplifies the code, and we may now assume that the database is always open, which paves the way for further simplifications.
* Remove dccp.Andre Noll2026-01-26
| | | | | | | | | | | This removes all traces of dccp, specifically dccp_recv.c and dccp_send.c. The flowops related functions of net.c can go away as well, as flowops were only needed for the dccp transport. A few other functions are simplified by dropping the flowops or protocol parameter. Further cleanups are possible, but are deferred to subsequent commits. In particular, some functions of send_common.c are only called by the http transport now. These can be moved to http_send.c and then be made static.
* t0004: Use openssl RFC4716 keys.Andre Noll2025-12-18
| | | | PEM keys are deprecated for quite some time now.
* Let the mp3 audio format handler depend on libid3tag.Andre Noll2025-08-28
| | | | | | | | | | | | | | | If the library is not installed we currently build the audio format handler anyway, but only support id3v1 tags and do not implement ->rewrite_tags() to modify the id3 tags. Since id3v1 tags are rather limited and long superseded by id3v2, let's drop the code from mp3_afh.c which is only compiled in if libid3tag is not installed, and disable server side mp3 support instead in this case. This requires a few additions to the build system to make the audio format handler optional, but thanks to the removals in mp3_afh.c, this still results in a negative diffstat. Removed code is debugged code, after all. The manual and the test suite need small adjustments as well.
* server: Deprecate setatt in favor of touch.Andre Noll2025-05-19
| | | | | | | | | | | | | | This adds --set-attribute and --unset-attribute to the touch subcommand, re-implementing the features of the setatt command with a saner syntax. We augment the change_atts_data structure using pre-computed values for verbose and dry-run mode and pass a pointer to this structure rather than the general callback arg pointer. The existing setatt subcommand neither sets nor consults the two new booleans. The touch completer of para_client is updated to complete the two new options, executing the lsatt subcommand to get the attribute names. The manual and the test suite also need minor adjustments.
* Merge topic branch t/play into masterAndre Noll2024-09-04
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This small series contains a few minor tweaks for para_play. The most obvious change is that para_play is no longer built on systems which lack libreadline. The merge conflicted badly in configure.ac due to the changes introduced by the earlier merge of the "built" topic branch. The resolution needs to modify the non-conflicting Makefile.real to exclude para_play from the list of executables if libreadline is not present while the corresponding commit of the "play" topic branch implemented the logic in configure.ac. Cooking for a month. * refs/heads/t/play: play: Shut down alsa on input EOF. play: Simplify and improve get_key_map_seq(). play: Remove pointless goto in play_post_monitor(). Return from filter_setup() so callers can reset the terminal. Let para_play depend on libreadline.
| * Let para_play depend on libreadline.Andre Noll2024-05-26
| | | | | | | | | | | | | | | | | | While para_client and para_audioc are suitable for non-interactive use, e.g. in scripts, para_play can only be used interactively, and its non-readline version is barely usable. Rather than building a crippled version, teach the build and test systems to skip para_play if the readline library is not installed.
* | build: Rename all_objs -> dep_objs.Andre Noll2024-03-18
|/ | | | | | | | The old name is misleading since there are additional objects which correspond to the C files generated by lopsub. Those use different dependency tracking. Simplify the code a bit by creating the list in one step.
* test-lib: Write error output to stderr.Andre Noll2023-06-14
| | | | | | | | This way one can run make test > /dev/null to suppress normal output but still see test failures, if any.
* test-lib: Fix typo in comment.Andre Noll2023-05-10
|
* Add two new tests for para_server.Andre Noll2023-03-11
| | | | | | | | | | | In a (non-public) development branch the add subcommand was broken although t0004-server exercises this subcommand and reported no error. The bug went unnoticed because it would only bite when the subcommand was given a directory to add, but the test specifies a pathname which refers to a regular file. To detect such breakage early, add a test which tries to add a directory and another which exercises the rm command.
* Add test to check whether empty mood arguments are rejected.Andre Noll2022-05-18
| | | | | | | | | | | | | To make sure a recent bug won't be re-introduced. The test succeeds but fails with commit 2c2d3a6ec34d983cb698b245facb8d6240aec1b3 reverted. We have to add at least one mood to trigger the bug. Since addmood is a stdin command we must redirect stdin for the para_client command. It does not hurt to do this for all commands, not just the new one.
* build: Use .ONESHELL.Andre Noll2018-12-23
| | | | | | | | | | | | | | | | | | | This instructs "make" to pass all the lines in the recipe to a single invocation of the shell. This has no disadvantage and improves performance slightly. Best out of five "make -j 4" runs: Before: 0m3.510s After: 0m3.280s Speedup: 6.55% With .ONESHELL given, only the first line of each recipe will be checked for the special '@' prefix character. This made it necessary to modify the "Q" macro slightly. Rename it to "SAY" while at it. The second issue with .ONESHELL is that a failure of any but the final recipe line will not be noticed by make. To work around this, we set .SHELLFLAGS to '-ec'. The '-e' flag instructs the shell to exit at any failure anywhere in the command line.
* t0004: Always create PEM keys.Andre Noll2018-08-28
| | | | | | New versions of ssh-keygen create RFC4716 keys by default, which breakes the test suite. Fortunately, the fix is easy and works also for old versions of openssh/ssh-keygen.
* Introduce lsu.{c,h}, implement help --long for para_server.Andre Noll2018-04-22
| | | | | | | | | | | | | | This adds the --long option to the server help subcommand. The former help output becomes the long help while the short help text is shown if --long is not given. Although only the help command of para_server is converted in this patch, the new functionality is implemented in a generic way so that the help commands of para_audiod and para_play can use the same implementation. Those will be converted in subsequent patches. t0004 parses the help output and thus needs to be changed to include --long.
* Shorten copyright notice.Andre Noll2017-09-22
| | | | | | | | | | | | | | | | | | | | | The GPLv2 line does not add any additional information, so drop it. This leaves a single line of legalese text for most files, which is about the amount of screen real estate it deserves. This patch was created with the following script (plus some manual fixups): awk '{ if (NR <= 5) { gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g") if (gs != $0) year = gs next } if (NR == 6 && year != "") printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year) print }'
* server: Remove -F option to ls.Andre Noll2017-08-03
| | | | | | | | | | Quoting the current help text of the option: This option is the default, so it does nothing. Deprecated as of v0.6.0, scheduled for removal in v0.6.1. This patch gets rid of the option and also adjusts the test suite, which still used it.
* Merge branch 'refs/heads/t/lopsub'Andre Noll2017-04-27
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of the changes in this release is the conversion of all command line parsers from gengetopt to lopsub. The series also contains a few cleanups that have become possible due to the switch from gengetopt to lopsub. The patches towards the end of the series rename para_fade to para_mixer. Naturally, the merge conflicted rather heavily against the other topic branches that have been merged since the lopsub branch was started. Conflicting files: Makefile.real afh.c afh_recv.c configure.ac osx_write.c write.c The resolutions for these conflicts were recorded with git rerere and have been tested for quite some time. Cooking for three weeks. * refs/heads/t/lopsub: (74 commits) audioc: Avoid double free in audioc_i9e_line_handler(). audiod: Avoid uninitialized memory access. Simplify mixer setup. mixer: Implement non-linear time scale for fading. mixer: Allow arbitrary relative time for sleep subcommand. Convert para_fade to subcommands, rename it to para_mixer. build: Create .dep files only during compilation. build: Simplify definition of $m4_lls_deps. build: Rename command list variables. build: Combine $(CFLAGS) and $(STRICT_CFLAGS). build: Let .d files depend only on .c. build: Don't create phony targets for dependencies. build: Remove duplicate dependency. build: Remove cmdline_dir and friends. build: Remove some unused variables from Makefile.real. build: Remove m4/gengetopt. Remove gengetopt and help2man checks from configure.ac. Remove man_util.bash. Remove ggo.c and ggo.h. manual: Do not mention gengetopt and help2man any more. ...
| * Convert para_fade to subcommands, rename it to para_mixer.Andre Noll2017-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | para_fade operates in one of several modes, but the command line options are shared. So most of the options are ignored for any particular mode. With lopsub we can do better and define one subcommand per mode so that options which are only relevant to one subcommand can be made local to that subcommand. With subcommands the syntax of the command changes, which breaks existing scripts. So it seems to be prudent to rename the executable from para_fade to para_mixer. The old name was a bit misleading anyway since the command can do much more than just fade the volume.
| * Convert writers to lopsub.Andre Noll2017-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to the previous commits for receivers and filters, this commit replaces the five gengetopt parsers for the alsa, ao, file, oss, osx writers by a lopsub suite and links para_write with -llopsub. This allows to get rid of the WRITER_ENUM and the writers array as a reference to each writer structure are stored in the lopsub user_data pointer. Moreover, ->init(), ->parse_config(), ->free_config() and ->ggo_help() of struct writer are not needed any more and can be removed. The patch also removes write_common.h and moves the few prototypes write.h. Now that receivers, filters and writers have all been converted, we may also stop to include ggo.h from audiod_command.c and play.c. As for the receivers and filters, t0005 needs slight adjustments due to the new section header in the man page.
| * Convert filters to lopsub.Andre Noll2017-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the *_filter.m4 gengetopt files by the filter_cmd lopsub suite, where each filter is realized as a subcommand. Due to this change, para_filter needs to be linked with -llopsub. The filter structure is now stored in the user_data pointer provided by lopsub, allowing to get rid of the global filters[] array, the FILTER_ENUM macro and the corresponding enumeration constants. The removal of the ->goo_help member of struct filter makes this structure constant. Hence ->init() of struct filter can also go away. We still can tell whether a filter is supported by checking the user_data pointer: if it is NULL, the filter is unsupported. The new filter_supported() helper in filter_common.c is provided for convenience. Parsing of the filter command line options is now performed generically, and the ->parse_config() method is renamed to ->setup(), an optional function which is supposed to perform semantic checks and the one-time setup of the filter, if any. It is accompanied by ->teardown() which replaces ->free_config(). The conversion of the individual filters is easy since most filters have a simple syntax or take no arguments at all. The resample_filter, however, needs a different way to copy the wav parameters from the lopsub parse result to the wav parms structure. A suitable macro, LLS_COPY_WAV_PARMS is added to check_wav.h for this purpose. The old COPY_WAV_PARMS needs to stay until para_write, the only other user of the macro, has been converted as well. The section heading of the manual page has changed slightly, causing t0005 to fail. Hence this test needs a slight adjustment.
| * Convert receivers to lopsub.Andre Noll2017-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts the four receivers (afh, http, dccp, udp) to use the lopsub library instead of gengetopt. The command line options of the receivers are implemented as subcommands of the new recv_cmd lopsub suite. Hence the four gengetopt command line parsers and ->ggo_help of struct receiver can be removed. This change allows to get rid of the receiver array which was defined through the DEFINE_RECEIVER_ARRAY macro. We now store each receiver structure in the user_data pointer provided by lopsub. Since this structure is initialized at compile time (and constant since ->ggo_help is gone), ->init() of struct receiver is no longer needed to initialize the various function pointers. The function is now optional and does not take an argument any more. At the moment, only the afh receiver needs ->init() to initialize all supported audio format handlers. t0005 needs slight adjustment since the section headers of the help text have changed a bit.
| * server: Convert non-afs commands to lopsub.Andre Noll2017-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the server commands are divided into two group: those commands which are handled by the server process and those which communicate with the afs process. This commit converts the commands of the former group and the corresponding completers for para_client to the lopsub suite format while the afs commands will be converted in subsequent commits. After this change para_server needs to be linked with -llopsub. To this aim the options and help texts of of the server commands are transferred from server.cmd to the new server_cmd.suite.m4, enabling long-style options in the progress. Moreover, an introduction is added at the beginning of the list of server commands which describes how server commands are executed. Command permissions are now handled by making use of the aux_info feature of lopsub. To keep those commands working which do not have any permission bit set, we need to add a new identifier NO_PERMISSION_REQUIRED to enum server_command_permissions of user_list.h. The value of this identifier is zero of course. Naturally the bulk of the change takes place in command.c where all server commands are implemented. The command handlers are modified to take a pointer to a struct lls_parse result as an additional argument. A new helper, send_errctx(), is introduced to avoid code duplication. Since command.h now refers to a lopsub parse result, all files which include command.h, including those which implement only afs commands, need to include the system header lopsub.h. To keep afs commands working, some compatibility code in run_command() is added. This will go away after all commands have been converted. A couple of macros in command.h ease the handling of the long symbolic constants exposed by the generated lopsub header file. Although only the non-afs commands are converted, the change allows for a couple of cleanups: * The E_BAD_COMMAND error code is no longer needed and has been removed. * cmd_perms_itohuman() has become unused and is removed. * The server_cmds[] array is empty and can be removed, along with the loop in send_list_of_commands() which iterated over the array. The patch also adjusts tests t0004 and t0005 since the help output format changed slightly, breaking the expectations of these tests.
* | Merge branch 'refs/heads/t/makefile_conventions'Andre Noll2017-04-19
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | A bunch of changes which strive to make the paraslash build system more standard. Cooking for three months. * refs/heads/t/makefile_conventions: build: Add target "check" as a synonym for "test". build: Rename target "tarball" to "dist". build: Do not strip installed executables by default. build: Support $(DESTDIR). build: Rename clean targets.
| * build: Add target "check" as a synonym for "test".Andre Noll2017-01-08
| | | | | | | | | | | | | | make check seems to be more common than make test, and "check" is the recommended name according to the GNU standards. This patch teaches the build system to support both targets. It also marks the test-clean, check and test targets as phony.
* | t0001: Prefer shasum over sha1sum.Andre Noll2017-03-25
|/ | | | | Both programs reliably find mismatches, and the latter is not installed on FreeBSD.
* t0004: Specify proper options for ls commands.Andre Noll2016-12-28
| | | | | | | | The -p option is deprecated, and the default behaviour (if none of -p, -F and -b is given) will change in v0.6.0. Although the tests succeed at the moment, it seems prudent to switch to the modern syntax to make sure the tests won't break when -p is removed and the default behaviour is changed.
* test-lib: Fix a bash-4.4 issue.Andre Noll2016-10-04
| | | | | | | Apparently bash-4.4 changed how unquoted here strings are treated. We want to process only the first line of the output, so the right thing to do is to ask awk to exit after processing the first line. This works regardless of the bash version.
* test suite: Fail test if para_server could not be started.Andre Noll2016-07-17
| | | | | | | | In t0004-server.sh, we start the server in daemon mode without checking the exit code. If it fails to start, there is no point in trying to run the tests of this file. This commit adds the missing check.
* Add test that exercises attribute code.Andre Noll2016-02-21
| | | | | This test would fail without the previous fix that changed the shifted integers to 64 bit.
* test-lib: Canonicalize test_dir.Andre Noll2016-02-21
| | | | | This makes it easier to write tests. The realpath command is available at least on Linux and *BSD.
* t0005: Split audiod man page tests.Andre Noll2016-01-10
| | | | | This makes it easier to diagnose potential problems due to missing man page sections.
* Deactivate implicit make rules.Andre Noll2016-01-10
| | | | | | | | Without this, make might execute commands defined by implicit rules. This can cause subtle build errors that are hard to debug. To make this work we need to define CC though, and RM must not be defined through the =? operator.
* t0004: Switch to new syntax for ls command.Andre Noll2016-01-10
| | | | | The old way of specifying ls options is deprecated and should no longer be used.
* t0005: Remove pointless assignment to regex,Andre Noll2015-12-13
| | | | This assignment at the end of the script has no effect.
* aft: Store resolved paths when adding files.Andre Noll2015-03-30
| | | | | | | | | | | | | | | | | | | Currently the add command performs some sanity checks on the given paths, but stores them unmodified in the audio file table if they pass the checks. This commit removes the checks in favor of a call to realpath(3) to get the canonicalized absolute pathname to be stored in the audio file table. The new code relies on POSIX.1-2008 semantics. That is, it calls realpath() with second argument NULL to let the function allocate a suitably sized buffer. This should not be a problem, since the old POSIX.1-2001 version is broken by design, and all moderately recent systems support the new semantics. This change breaks t0004 which expects the ls -p command to print the same paths that were used earlier to add audio files, which is no longer true. We fix the test by simply running ls without the -p option.
* test-lib: Make colors work on FreeBSD.Andre Noll2014-02-08
| | | | | | | Some implementations of tput don't accept capnames (bold, setaf, sgr0) but only the older termcap capability names (md, AF, me). This patch teaches test-lib.sh to try both variants and succeed if either variant works.
* test suite: Add sanity check for generated man pages.Andre Noll2014-01-17
| | | | | | The build system of v0.5.0 and v0.5.1 missed to include options for receivers, filters and writers. The new test makes sure this never happens again.
* build: Introduce $prefixed_executables.Andre Noll2013-12-01
| | | | | | | | Currently $executables contains the full basename of all executables (para_server, para_client, ...), while the autoconf variable @executables@ is used for the variants without the "para_" prefix. This is rather confusing, so introduce $prefixed_executables and stop using the @executables@ variant in Make recipes.
* test suite: Change underscores to dashes also in tests script options.Andre Noll2013-08-23
| | | | The previous commit broke t0004. Fix is trivial.
* Put dependency files to a separate directory.Andre Noll2012-08-27
| | | | | | | | | | | Currently the dependency files are stored in the same directory as the object files. This moves these files to the new build/deps directory instead, and makes "make clean" remove the objects directory while "make clean2" now removes the whole build directory. As a side effect of this change, the $(all_objs) variable now contains only the non-directory part of the objects, so we may get rid of the directory-stripping in the test makefile.
* Fix typo in t0003.Andre Noll2012-07-22
|