1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00
pgbackrest/test
David Steele 45a4e801ed
Replace getopt_long() with custom implementation.
getopt_long() requires an exhaustive list of all possible options that may be found on the command line. Because of the way options are indexed (e.g. repo1-4, pg1-8) optionList[] has 827 entries and we have kept it small by curtailing the maximum indexes very severely. Another issue is that getopt_long() scans the array sequentially so parsing gets slower as the index maximums increase.

Replace getopt_long() with a custom implementation that behaves the same but allows options to be parsed with a function instead of using optionList[]. This commit leaves the list in place in order to focus on the getopt_long() replacement, but cfgParseOption() could be replaced with a more efficient implementation that removes the need for optionList[].

This implementation also fixes an issue where invalid options were misreported in the error message if they only had one dash, e.g. -config. This seems to have been some kind of problem in getopt_long(), but no investigation was done since the new implementation fixes it.

Tests were added at 0825428, 2b8d2da, 34dd663, and 384f247 to check that previously untested getopt_long() behavior doesn't change.
2021-05-20 16:02:31 -04:00
..
certificate New test containers with static test certificates. 2018-11-21 18:13:37 -05:00
code-count v2.33: Multi-Repository and GCS Support 2021-04-05 09:18:20 -04:00
data Automate generation of WAL and pg_control test files. 2017-11-18 20:02:54 -05:00
expect Remove stanza archive spool path on restore. 2021-05-18 15:49:22 -04:00
lib/pgBackRestTest Move PostgreSQL version interface test functions to a test harness. 2021-05-17 07:20:28 -04:00
src Replace getopt_long() with custom implementation. 2021-05-20 16:02:31 -04:00
.gitignore Move coverage results to test/result. 2020-03-14 15:29:42 -04:00
ci.pl Change CentOS 7 documentation test to CentOS 8. 2021-05-11 16:54:42 -04:00
container.yaml Basic multi-architecture support for test containers. 2021-05-03 16:31:27 -04:00
define.yaml Move PostgreSQL version interface test functions to a test harness. 2021-05-17 07:20:28 -04:00
Dockerfile Basic multi-architecture support for test containers. 2021-05-03 16:31:27 -04:00
test.pl Remove default VM for test.pl --coverage-only option. 2021-05-17 11:35:22 -04:00
Vagrantfile Add instructions to install lcov for MacOS. 2021-05-04 15:51:46 -04:00