4c7408ea52
Embed exported C functions and Perl modules directly into the pgBackRest executable.
2018-05-22 12:53:08 -04:00
88a633da17
Divide tests into three types (unit, integration, performance).
...
Many options that were set per test can instead be inferred from the types, i.e. container, c, expect, and individual.
Also finish renaming Perl unit tests with the -perl suffix.
2018-04-24 09:12:25 -04:00
741acfd779
Move test definitions to test/define.yaml.
...
The location is better because it is no longer buried in the Perl test libs. Also, the data can be easily accessed from C.
2018-04-08 10:19:24 -04:00
b77b425096
Allow -DDEBUG_UNIT to be suppressed to test how debug macros behave.
2018-04-07 19:44:00 -04:00
82751b3b51
Split debug and assert code into separate headers.
...
Assert can be used earlier because it only depends on the error-handler and not logging.
2018-04-07 13:12:35 -04:00
e00f2dd4ad
More C type cleanup.
...
* Remove typec.h entirely.
* Order all typdefs above local includes.
2018-04-06 21:46:45 -04:00
f3b56cf8f3
Allow MemContext objects to be copied to a new parent.
...
This makes it easier to create objects and then copy them to another context when they are complete without having to worry about freeing them on error. Update List, StringList, and Buffer to allow moves. Update Ini and Storage to take advantage of moves.
2018-04-06 17:04:52 -04:00
b9f636cab4
Cleanup C types.
...
* Remove pgBackRest defined types included with the C types.
* Remove redefinition of standard C types.
2018-04-05 22:38:11 -04:00
bd25248df0
Abstract Posix storage driver code into a separate module.
2018-04-05 14:48:16 -04:00
93fdb98d15
Storage object improvements.
...
* Convert all functions to variadic functions.
* Enforce read-only storage.
* Add storageLocalWrite() helper function. Add storageExists(), storagePathCreate(), storageRemove(), and storageStat().
* Add StorageFile object and storageOpenRead()/storageOpenWrite().
2018-04-03 12:25:21 -04:00
635caff573
Add ASSERT() that is preserved in production builds.
2018-03-30 19:10:34 -04:00
c1ab7b3c98
Start work on C handle io object and use it to output help.
2018-03-25 11:39:24 -04:00
cced6ec03a
Add ASSERT_DEBUG() macro for debugging.
...
Replace all current assert() calls except in tests that can't use the debug code.
2018-03-12 14:31:22 -04:00
03f1082e86
Improve logging.
...
Move command begin to C except when it must be called after another command in Perl (e.g. expire after backup). Command begin logs correctly for complex data types like hash and list. Specify which commands will log to file immediately and set the default log level for log messages that are common to all commands. File logging is initiated from C.
2018-03-12 11:03:38 -04:00
e331564c90
Add new test for Common::Io::Process.
...
Show that output on stderr will raise an exception on close() even if the exit code is 0.
2018-03-08 12:36:55 -05:00
45ffe37e4f
Add cfgOptionTest().
...
Update cfgOption() calls that are better implemented as cfgOptionTest().
Contributed by Cynthia Shang.
2018-03-05 18:51:48 -05:00
9070325760
Improve performance of HTTPS client.
...
Buffering now takes the pending bytes on the socket into account (when present) rather than relying entirely on select(). In some instances the final bytes would not be flushed until the connection was closed.
2018-02-18 14:53:27 -05:00
72cbb9a9d4
Call Perl with built-in interpreter instead of execvp().
...
Exec'ing Perl worked fine but generated a very large command line in the process list and potentially exposed secrets.
2018-02-14 17:19:54 -05:00
5f2884cb29
Suppress coverage failures for Archive/Push/Async on Travis.
...
The coverage report shows some code as never being run -- but that makes no sense because the tests pass. This may be due to trying to combine the C and Perl coverage reports and overwriting some runs.
Suppress for now with a plan to implement LCOV for the C unit tests.
2018-02-14 16:46:52 -05:00
a907fd7d2d
Build C binary/library for C unit tests that require Perl.
2018-02-14 10:33:21 -05:00
fda62dfc48
Move Perl option JSON generation to a new module.
...
Linking exec.c into LibC will not be an option once the perl exec loads the Perl interpreter.
2018-02-14 09:49:01 -05:00
305a3e1761
Add int64 variant type.
2018-02-09 13:52:02 -05:00
1659598cfe
Create a master list of errors in build/error.yaml.
...
The C and Perl errors lists are created automatically by Build.pm so they stay up to date.
2018-02-08 16:11:47 -05:00
be90028100
Rename db-* options to pg-* and backup-* options to repo-* to improve consistency.
...
* repo-* options are now indexed although only one is allowed.
* List deprecated option names in documentation and command-line help.
2018-02-03 18:27:38 -05:00
a91a648019
Config parsing no longer implemented in Perl.
...
Options are passed to Perl as JSON from the C process.
2018-01-28 21:37:09 -05:00
b58a45e067
Implement help command in C.
2018-01-23 13:34:24 -05:00
404ec30d03
Move Perl help test to real module.
2018-01-23 12:58:35 -05:00
2afb73da1c
Improve String, StringList, and List objects.
...
* Add strCmp*() and strFirst*() to String.
* Add strLstSort() and strLstNewSplitSize() to StringList.
* Add strLstNewSplitZ() to StringList a update calls to strLstNewSplit() as needed.
* Add lstSort to List.
2018-01-23 12:17:30 -05:00
2cc9b2287b
The archive-push command is now partially coded in C.
...
This allows the PostgreSQL archive_command to run significantly faster when processing status messages from the asynchronous archive process.
2018-01-17 15:52:00 -05:00
7c73f4f6c9
Add command and exit modules.
2018-01-17 09:15:51 -05:00
39cb971afb
Add log module.
2018-01-16 13:52:20 -05:00
eb452c8add
Improvements to Storage object.
...
* storagePath() and storageList() commands
* Helper functions for local and spool storag
2018-01-16 13:38:37 -05:00
8f81620b9f
Improve error module.
...
Add functions to convert error codes to C errors and handle system errors.
2018-01-16 13:29:27 -05:00
d633417e5d
Add Wait object and time module.
2018-01-16 13:05:00 -05:00
721d1127a0
Add RegExp object.
2018-01-16 12:57:23 -05:00
83ddd75d82
Improvements to String object.
...
* Add strBeginsWith(), strEndsWith(), strEq(), and strBase().
* Enable compiler type checking for strNewFmt() and strCatFmt().
* Rename strNewSzN() to strNewN().
2018-01-16 12:47:08 -05:00
d992851456
Rename Perl tests so they don't conflict with their C counterparts.
2018-01-16 12:36:22 -05:00
0e9ba98a50
Add stanza-delete command to cleanup unused stanzas.
...
Contributed by Cynthia Shang.
2018-01-03 12:23:33 -05:00
526acca5bd
Config parsing implemented in C.
2017-12-22 23:27:49 -05:00
d8c575801d
Add Ini object.
2017-12-22 22:55:17 -05:00
69488ca8ff
Add Storage object.
2017-12-22 22:36:01 -05:00
b2a64b1f43
Add KeyValue object.
2017-12-22 22:05:37 -05:00
2add6cef95
Add Variant and VariantList objects.
2017-12-22 21:50:27 -05:00
c4b30af645
Add Buffer object.
2017-12-22 19:56:01 -05:00
f89b027dec
Improve String and StringList modules.
2017-12-22 19:30:15 -05:00
5ea1263d8e
Run valgrind on all C unit tests.
...
Also refactor code to make valgrind happy.
2017-12-22 18:36:36 -05:00
8d4674031e
More config parsing in C in preparation for all config parsing in C.
2017-12-05 10:09:07 -05:00
915ae5662a
Implement version command in C.
2017-11-28 21:44:05 -05:00
bd74711ceb
Add unit tests for the Manifest module.
...
Also minor changes to Manifest module, mostly for test reproducibility.
Contributed by Cynthia Shang.
2017-11-28 11:44:24 -05:00
74d6398ad2
The pgbackrest executable is now a C binary instead of Perl.
...
This allows certain time-critical commands (like async archive-push) to run more quickly.
2017-11-26 18:43:51 -05:00