| Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 1 | Thrift D Software Library | 
 | 2 | ========================= | 
 | 3 |  | 
 | 4 | License | 
 | 5 | ------- | 
 | 6 |  | 
 | 7 | Licensed to the Apache Software Foundation (ASF) under one | 
 | 8 | or more contributor license agreements. See the NOTICE file | 
 | 9 | distributed with this work for additional information | 
 | 10 | regarding copyright ownership. The ASF licenses this file | 
 | 11 | to you under the Apache License, Version 2.0 (the | 
 | 12 | "License"); you may not use this file except in compliance | 
 | 13 | with the License. You may obtain a copy of the License at | 
 | 14 |  | 
 | 15 |   http://www.apache.org/licenses/LICENSE-2.0 | 
 | 16 |  | 
 | 17 | Unless required by applicable law or agreed to in writing, | 
 | 18 | software distributed under the License is distributed on an | 
 | 19 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | 
 | 20 | KIND, either express or implied. See the License for the | 
 | 21 | specific language governing permissions and limitations | 
 | 22 | under the License. | 
 | 23 |  | 
 | 24 | Testing | 
 | 25 | ------- | 
 | 26 |  | 
 | 27 | D support in Thrift is covered by two sets of tests: first, | 
 | 28 | the unit test blocks contained in the D source files, and | 
 | 29 | second, the more extensive testing applications in the test/ | 
 | 30 | subdirectory, which also make use of the Thrift compiler. | 
 | 31 | Both are built when running "make check", but only the | 
 | 32 | unit tests are immediately run, however – the separate test | 
 | 33 | cases typically run longer or require manual intervention. | 
 | 34 | It might also be prudent to run the independent tests, | 
 | 35 | which typically consist of a server and a client part, | 
 | 36 | against the other language implementations. | 
 | 37 |  | 
 | 38 | To build the unit tests on Windows, the easiest way might | 
 | 39 | be to manually create a file containing an empty main() and | 
 | 40 | invoke the compiler by running the following in the src/ | 
 | 41 | directory (PowerShell syntax): | 
 | 42 |  | 
 | 43 | dmd -ofunittest -unittest -w $(dir -r -filter '*.d' -name) | 
 | 44 |  | 
 | 45 | If you want to run the test clients/servers in OpenSSL | 
 | 46 | mode, you have to provide »server-private-key.pem« and | 
 | 47 | »server-certificate.pem« files in the directory the server | 
 | 48 | executable resides in, and a »trusted-ca-certificate.pem« | 
 | 49 | file for the client. The easiest way is to generate a new | 
 | 50 | self signed certificate using the provided config file | 
 | 51 | (openssl.test.cnf): | 
 | 52 |  | 
 | 53 | openssl req -new -x509 -nodes -config openssl.test.cnf \ | 
 | 54 |   -out server-certificate.pem | 
 | 55 | cat server-certificate.pem > trusted-ca-certificate.pem | 
 | 56 |  | 
 | 57 | This steps are also performed automatically by the | 
 | 58 | Autotools build system if the files are not present. |