[Bizgres-general] Enhancements to mbregress [regressions tests for
multi-byte character sets and client encoding types]
Ayush Parashar
aparashar at greenplum.com
Thu Jul 21 21:49:06 GMT 2005
Hi,
I have made some additions & enhancements to multi-byte regression tests
(.postgresql/src/test/mb), to include regression tests for copy command.
This can be used to test multi-byte extensions of postgresql and client
character encoding, for copy command. The test uses the following complete
character sets: "big5 gbk uhc gb18030 euc_cn latin8 euc_kr euc_jp".
I have committed these enhancements to bizgres code-base.
I have re-verified that the extensions work by checking out the latest code
of bizgres and testing the mbregress. These tests were done on Linux[RHEL
GNU/Linux 2.6.10-1.741_FC3.rootsmp], Solaris[SunOS 5.10] and Mac[Darwin
Kernel Version 8.1.0].
The README of the tests and a dry run is included in the message.
Thanks,
Ayush
===============================================
README
==============================================
[aparashar at server]$ cat README
README for multibyte regression test.
CREATED BY Tatsuo Ishii 1998/7/22
CONTAINS: Set of tests for multibyte supporting extentions for PostgreSQL.
LAST UPDATE BY Ayush Parashar 2005/July/7
ENHANCEMENTS 2005/July/7:
1. - Include extensive multi-byte regression tests for copy command.
- Uses following complete character sets and encoding types for
testing:
"big5 gbk uhc gb18030 euc_cn latin8 euc_kr euc_jp"
2. Include help and usage for various tests.
3. Include cleanup function, to remove the log files and database objects
that
have been created.
REQUIREMENTS:
- Installed PostgreSQL
- The location of bin directory of PostgreSQL should be included in "PATH"
variable.
TESTED ON:
- 2.6.10-1.741_FC3.rootsmp GNU/Linux &
- 5.10 Generic SunOS
USAGE:
./mbregress.sh --help
./mbregress.sh test
./mbregress.sh clean
MULTI-BYTE CHARACTER SET & CLIENT ENCODING TESTS FOR COPY COMMAND:
HIGHLIGHT:
- Uses complete character sets for: big5 gbk uhc gb18030 euc_cn latin8
euc_kr euc_jp
- Expected output produced using "iconv" command.
1. Creates tables in database with unicode encoding.
2. Sets client encoding to a particular type.
3. Uploads complete character sets to database using "copy from" command.
4. Sets client encoding to unicode.
5. Download complete character sets from database using "copy to" command.
6. Compares this result to expected output.
HELP:
1. ./mbregress.sh test
- Creates database and tables required for the tests.
* Databases created: euc_cn, euc_jp, euc_kr, euc_tw, mule_internal,
unicode, unitest
* Tables created: big5_ce_copy, euc_cn_ce_copy, euc_jp_ce_copy,
euc_kr_ce_copy, gb18030_ce_copy, gbk_ce_copy,
latin8_ce_copy, uhc_ce_copy [these tables created
in unitest database]
- Uses scripts and data in ./sql directory, to produce output that is
thrown
in ./results and compared with files in ./expected
- Differences are thrown in regression.diffs file
- Logs related to database and table creation present in
file ./results/db_command.log
2. ./mbregress.sh clean
- Cleans up the log files
- Cleans up the database and tables created during the run
of "./mbregress.sh test"
===============================================
DRY RUN
===============================================
[aparashar at server]$ ./mbregress.sh
Usage:
./mbregress.sh --help
./mbregress.sh test
./mbregress.sh clean
[aparashar at server]$ ./mbregress.sh test
---------------------------------------------
Starting multi-byte tests for create table, create index, insert, and select
statements
euc_jp .. ok
sjis .. ok
euc_kr .. ok
euc_cn .. ok
euc_tw .. ok
big5 .. ok
mule_internal .. ok
---------------------------------------------
Starting multi-byte character encoding tests for copy command
big5 .. ok
gbk .. ok
uhc .. ok
gb18030 .. ok
euc_cn .. ok
latin8 .. ok
euc_kr .. ok
euc_jp .. ok
---------------------------------------------
[aparashar at server]$ ./mbregress.sh clean
Cleaning up..
done.
[aparashar at server]$ ./mbregress.sh --help
mbregress.sh HELP:
./mbregress.sh --help
- Help for mbregress.sh
./mbregress.sh test
- Creates necessary database and tables
- Tests multi-byte character sets & client encoding for create table,
insert & select statements
- Tests multi-byte character sets & client encoding for copy command using
complete character sets
- If some test fails, output thrown in regression.diffs
./mbregress.sh clean
- Cleans up the log files
- Cleans up the database and tables created during the run of
"./mbregress.sh test"
mbregress.sh REQUIREMENTS:
- PostgreSQL installation (with database cluster already initialized using
initdb)
- The location of bin directory of PostgreSQL should be included in "PATH"
variable.
------------------------------------------------------------------
More information about the Bizgres-general
mailing list