diff options
author | Adam Langley <agl@google.com> | 2015-06-11 03:32:25 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-06-16 21:07:42 +0300 |
commit | 117da41b7f4d9f2379a54bcf793c6c204c9432c5 (patch) | |
tree | 7844649cb3b22f99d92d128b067a7148a8c4c9ea /util | |
parent | a89fac585fbe1e61e457ffc8623826f873f57fc9 (diff) |
Move test configuration into a separate file.
Change-Id: I4e84a5fa1c73ed3da06d5a277df4eb2a85a6534a
Reviewed-on: https://boringssl-review.googlesource.com/5100
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/all_tests.go | 92 | ||||
-rw-r--r-- | util/all_tests.json | 56 |
2 files changed, 91 insertions, 57 deletions
diff --git a/util/all_tests.go b/util/all_tests.go index 49954dfb..ded692ed 100644 --- a/util/all_tests.go +++ b/util/all_tests.go @@ -41,63 +41,6 @@ var ( type test []string -var tests = []test{ - {"crypto/base64/base64_test"}, - {"crypto/bio/bio_test"}, - {"crypto/bn/bn_test"}, - {"crypto/bytestring/bytestring_test"}, - {"crypto/cipher/aead_test", "aes-128-gcm", "crypto/cipher/test/aes_128_gcm_tests.txt"}, - {"crypto/cipher/aead_test", "aes-128-key-wrap", "crypto/cipher/test/aes_128_key_wrap_tests.txt"}, - {"crypto/cipher/aead_test", "aes-256-gcm", "crypto/cipher/test/aes_256_gcm_tests.txt"}, - {"crypto/cipher/aead_test", "aes-256-key-wrap", "crypto/cipher/test/aes_256_key_wrap_tests.txt"}, - {"crypto/cipher/aead_test", "chacha20-poly1305", "crypto/cipher/test/chacha20_poly1305_tests.txt"}, - {"crypto/cipher/aead_test", "rc4-md5-tls", "crypto/cipher/test/rc4_md5_tls_tests.txt"}, - {"crypto/cipher/aead_test", "rc4-sha1-tls", "crypto/cipher/test/rc4_sha1_tls_tests.txt"}, - {"crypto/cipher/aead_test", "aes-128-cbc-sha1-tls", "crypto/cipher/test/aes_128_cbc_sha1_tls_tests.txt"}, - {"crypto/cipher/aead_test", "aes-128-cbc-sha1-tls-implicit-iv", "crypto/cipher/test/aes_128_cbc_sha1_tls_implicit_iv_tests.txt"}, - {"crypto/cipher/aead_test", "aes-128-cbc-sha256-tls", "crypto/cipher/test/aes_128_cbc_sha256_tls_tests.txt"}, - {"crypto/cipher/aead_test", "aes-256-cbc-sha1-tls", "crypto/cipher/test/aes_256_cbc_sha1_tls_tests.txt"}, - {"crypto/cipher/aead_test", "aes-256-cbc-sha1-tls-implicit-iv", "crypto/cipher/test/aes_256_cbc_sha1_tls_implicit_iv_tests.txt"}, - {"crypto/cipher/aead_test", "aes-256-cbc-sha256-tls", "crypto/cipher/test/aes_256_cbc_sha256_tls_tests.txt"}, - {"crypto/cipher/aead_test", "aes-256-cbc-sha384-tls", "crypto/cipher/test/aes_256_cbc_sha384_tls_tests.txt"}, - {"crypto/cipher/aead_test", "des-ede3-cbc-sha1-tls", "crypto/cipher/test/des_ede3_cbc_sha1_tls_tests.txt"}, - {"crypto/cipher/aead_test", "des-ede3-cbc-sha1-tls-implicit-iv", "crypto/cipher/test/des_ede3_cbc_sha1_tls_implicit_iv_tests.txt"}, - {"crypto/cipher/aead_test", "rc4-md5-ssl3", "crypto/cipher/test/rc4_md5_ssl3_tests.txt"}, - {"crypto/cipher/aead_test", "rc4-sha1-ssl3", "crypto/cipher/test/rc4_sha1_ssl3_tests.txt"}, - {"crypto/cipher/aead_test", "aes-128-cbc-sha1-ssl3", "crypto/cipher/test/aes_128_cbc_sha1_ssl3_tests.txt"}, - {"crypto/cipher/aead_test", "aes-256-cbc-sha1-ssl3", "crypto/cipher/test/aes_256_cbc_sha1_ssl3_tests.txt"}, - {"crypto/cipher/aead_test", "des-ede3-cbc-sha1-ssl3", "crypto/cipher/test/des_ede3_cbc_sha1_ssl3_tests.txt"}, - {"crypto/cipher/aead_test", "aes-128-ctr-hmac-sha256", "crypto/cipher/test/aes_128_ctr_hmac_sha256.txt"}, - {"crypto/cipher/aead_test", "aes-256-ctr-hmac-sha256", "crypto/cipher/test/aes_256_ctr_hmac_sha256.txt"}, - {"crypto/cipher/cipher_test", "crypto/cipher/test/cipher_test.txt"}, - {"crypto/cmac/cmac_test"}, - {"crypto/constant_time_test"}, - {"crypto/dh/dh_test"}, - {"crypto/digest/digest_test"}, - {"crypto/dsa/dsa_test"}, - {"crypto/ec/ec_test"}, - {"crypto/ec/example_mul"}, - {"crypto/ecdsa/ecdsa_test"}, - {"crypto/err/err_test"}, - {"crypto/evp/evp_extra_test"}, - {"crypto/evp/evp_test", "crypto/evp/evp_tests.txt"}, - {"crypto/evp/evp_test", "crypto/hmac/hmac_tests.txt"}, - {"crypto/evp/pbkdf_test"}, - {"crypto/hkdf/hkdf_test"}, - {"crypto/hmac/hmac_test", "crypto/hmac/hmac_tests.txt"}, - {"crypto/lhash/lhash_test"}, - {"crypto/modes/gcm_test"}, - {"crypto/pkcs8/pkcs12_test"}, - {"crypto/refcount_test"}, - {"crypto/rsa/rsa_test"}, - {"crypto/thread_test"}, - {"crypto/x509/pkcs7_test"}, - {"crypto/x509v3/tab_test"}, - {"crypto/x509v3/v3name_test"}, - {"ssl/pqueue/pqueue_test"}, - {"ssl/ssl_test"}, -} - // testOutput is a representation of Chromium's JSON test result format. See // https://www.chromium.org/developers/the-json-test-results-format type testOutput struct { @@ -254,8 +197,43 @@ func shortTestName(test test) string { return strings.Join(args, " ") } +// setWorkingDirectory walks up directories as needed until the current working +// directory is the top of a BoringSSL checkout. +func setWorkingDirectory() { + for i := 0; i < 64; i++ { + if _, err := os.Stat("BUILDING"); err == nil { + return + } + os.Chdir("..") + } + + panic("Couldn't find BUILDING in a parent directory!") +} + +func parseTestConfig(filename string) ([]test, error) { + in, err := os.Open(filename) + if err != nil { + return nil, err + } + defer in.Close() + + decoder := json.NewDecoder(in) + var result []test + if err := decoder.Decode(&result); err != nil { + return nil, err + } + return result, nil +} + func main() { flag.Parse() + setWorkingDirectory() + + tests, err := parseTestConfig("util/all_tests.json") + if err != nil { + fmt.Printf("Failed to parse input: %s\n", err) + os.Exit(1) + } testOutput := newTestOutput() var failed []test diff --git a/util/all_tests.json b/util/all_tests.json new file mode 100644 index 00000000..e7f0745d --- /dev/null +++ b/util/all_tests.json @@ -0,0 +1,56 @@ +[ + ["crypto/base64/base64_test"], + ["crypto/bio/bio_test"], + ["crypto/bn/bn_test"], + ["crypto/bytestring/bytestring_test"], + ["crypto/cipher/aead_test", "aes-128-gcm", "crypto/cipher/test/aes_128_gcm_tests.txt"], + ["crypto/cipher/aead_test", "aes-128-key-wrap", "crypto/cipher/test/aes_128_key_wrap_tests.txt"], + ["crypto/cipher/aead_test", "aes-256-gcm", "crypto/cipher/test/aes_256_gcm_tests.txt"], + ["crypto/cipher/aead_test", "aes-256-key-wrap", "crypto/cipher/test/aes_256_key_wrap_tests.txt"], + ["crypto/cipher/aead_test", "chacha20-poly1305", "crypto/cipher/test/chacha20_poly1305_tests.txt"], + ["crypto/cipher/aead_test", "rc4-md5-tls", "crypto/cipher/test/rc4_md5_tls_tests.txt"], + ["crypto/cipher/aead_test", "rc4-sha1-tls", "crypto/cipher/test/rc4_sha1_tls_tests.txt"], + ["crypto/cipher/aead_test", "aes-128-cbc-sha1-tls", "crypto/cipher/test/aes_128_cbc_sha1_tls_tests.txt"], + ["crypto/cipher/aead_test", "aes-128-cbc-sha1-tls-implicit-iv", "crypto/cipher/test/aes_128_cbc_sha1_tls_implicit_iv_tests.txt"], + ["crypto/cipher/aead_test", "aes-128-cbc-sha256-tls", "crypto/cipher/test/aes_128_cbc_sha256_tls_tests.txt"], + ["crypto/cipher/aead_test", "aes-256-cbc-sha1-tls", "crypto/cipher/test/aes_256_cbc_sha1_tls_tests.txt"], + ["crypto/cipher/aead_test", "aes-256-cbc-sha1-tls-implicit-iv", "crypto/cipher/test/aes_256_cbc_sha1_tls_implicit_iv_tests.txt"], + ["crypto/cipher/aead_test", "aes-256-cbc-sha256-tls", "crypto/cipher/test/aes_256_cbc_sha256_tls_tests.txt"], + ["crypto/cipher/aead_test", "aes-256-cbc-sha384-tls", "crypto/cipher/test/aes_256_cbc_sha384_tls_tests.txt"], + ["crypto/cipher/aead_test", "des-ede3-cbc-sha1-tls", "crypto/cipher/test/des_ede3_cbc_sha1_tls_tests.txt"], + ["crypto/cipher/aead_test", "des-ede3-cbc-sha1-tls-implicit-iv", "crypto/cipher/test/des_ede3_cbc_sha1_tls_implicit_iv_tests.txt"], + ["crypto/cipher/aead_test", "rc4-md5-ssl3", "crypto/cipher/test/rc4_md5_ssl3_tests.txt"], + ["crypto/cipher/aead_test", "rc4-sha1-ssl3", "crypto/cipher/test/rc4_sha1_ssl3_tests.txt"], + ["crypto/cipher/aead_test", "aes-128-cbc-sha1-ssl3", "crypto/cipher/test/aes_128_cbc_sha1_ssl3_tests.txt"], + ["crypto/cipher/aead_test", "aes-256-cbc-sha1-ssl3", "crypto/cipher/test/aes_256_cbc_sha1_ssl3_tests.txt"], + ["crypto/cipher/aead_test", "des-ede3-cbc-sha1-ssl3", "crypto/cipher/test/des_ede3_cbc_sha1_ssl3_tests.txt"], + ["crypto/cipher/aead_test", "aes-128-ctr-hmac-sha256", "crypto/cipher/test/aes_128_ctr_hmac_sha256.txt"], + ["crypto/cipher/aead_test", "aes-256-ctr-hmac-sha256", "crypto/cipher/test/aes_256_ctr_hmac_sha256.txt"], + ["crypto/cipher/cipher_test", "crypto/cipher/test/cipher_test.txt"], + ["crypto/cmac/cmac_test"], + ["crypto/constant_time_test"], + ["crypto/dh/dh_test"], + ["crypto/digest/digest_test"], + ["crypto/dsa/dsa_test"], + ["crypto/ec/ec_test"], + ["crypto/ec/example_mul"], + ["crypto/ecdsa/ecdsa_test"], + ["crypto/err/err_test"], + ["crypto/evp/evp_extra_test"], + ["crypto/evp/evp_test", "crypto/evp/evp_tests.txt"], + ["crypto/evp/evp_test", "crypto/hmac/hmac_tests.txt"], + ["crypto/evp/pbkdf_test"], + ["crypto/hkdf/hkdf_test"], + ["crypto/hmac/hmac_test", "crypto/hmac/hmac_tests.txt"], + ["crypto/lhash/lhash_test"], + ["crypto/modes/gcm_test"], + ["crypto/pkcs8/pkcs12_test"], + ["crypto/refcount_test"], + ["crypto/rsa/rsa_test"], + ["crypto/thread_test"], + ["crypto/x509/pkcs7_test"], + ["crypto/x509v3/tab_test"], + ["crypto/x509v3/v3name_test"], + ["ssl/pqueue/pqueue_test"], + ["ssl/ssl_test"] +] |