Skip to content

Commit

Permalink
Overhaul run-tests.py.
Browse files Browse the repository at this point in the history
 * Eliminate the global variables.
 * More thorough error detection in the HTTP(S) server.
 * Test directive comments must start with //! and the parser is more robust.
 * Handle child process stderr separately from stdout
   (this will make it possible to test more things).
 * Execute tests within each directory in alphabetical order. (ariya#12439)
 * Support and use multi-level wildcards in TESTS.  This means we don't
   have to touch run-tests.py every time we add a subdirectory to
   module/ or standards/.
 * Handle HTTP server errors during a test more gracefully.  Errors caused by
   the client disconnecting in the middle of a query-response transaction are
   ignored.  Other errors are reported and the test suite exits cleanly.
 * Add HTTPS and POST support to test server.
 * Add ability to run PhantomJS under a debugger on a test case.
 * Use argparse for command line parsing.
 * Accept -v as short for --verbose.
 * Repeating -v means more verbosity; at -vvv, phantomjs command lines are
   printed.  (-vv is reserved for printing individual subtests, which will
   happen later.)
 * Fix bug where, with one or more -v, the pjs version number was printed
   twice.
  • Loading branch information
zackw committed Aug 13, 2015
1 parent 9ad726e commit 3ddce2a
Show file tree
Hide file tree
Showing 8 changed files with 422 additions and 212 deletions.
18 changes: 18 additions & 0 deletions test/certs/https-snakeoil.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----BEGIN CERTIFICATE-----
MIIC+zCCAeOgAwIBAgIJAJ7HwZBrgnLwMA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV
BAMMCWxvY2FsaG9zdDAeFw0xNTA4MTEyMjU4MTZaFw0yNTA4MTAyMjU4MTZaMBQx
EjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBANFha8c5JKjYrHc7BTqmuFSAxYsSKbUUa0k+0PFpjhj7Io/NOeHhxfdLJX/B
LVQXEDhvOlSTDBgC3RQkxCZJmMzKZjMDlj0cxY0esZtcqt0sRpwRvT+EBE9SlFu4
TWM2BQ6k5E4OIX/9aUk9HQ99pSjqmhu/7n76n/5DfqxGwkfVZengI1KwfezaB5+Q
wAvoS7tadROqTyynV1kd+OF9BJZwO1eR9lAiGc139J/BHegVcqdrI043oR+1vyTw
BFpodw4HYdJHNgo7DKAtmXoDAws5myqx2GcnVng1wyzu6LdM65nMV4/p5Y/Y6Ziy
RqeV1gVbtpxTcrLmWFnI8BRwFBUCAwEAAaNQME4wHQYDVR0OBBYEFPP1YOkZpJmE
x/W48Kwv2N1QC1oDMB8GA1UdIwQYMBaAFPP1YOkZpJmEx/W48Kwv2N1QC1oDMAwG
A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAA1NxsrmKxGecAS6TEHNBqFZ
9NhV23kXY5sdv8zl7HUmzR+vIBumd9lkSZdOwAy5/hmj6ACReSJ9f2xpyi0fOtx5
WZ8Vcrg9Qjuy17qmGi66yL860yr0h6hltzCWCi7e26Eybawm3/9PmbNV3Hcwgxug
D+gv4LZLlyj4JI4lg/8RVXaNXqGBZ39YhRH0LFVjbYiFWUGqzfAT9YBoC67Ov8Yv
Bl1PoV3sJcagx67X6y8ru+gecc/OOXKJHxSidhjRqhKB6WOWIPfugsMOl1g2FMPv
tuPFsIQNSaln7V+ECeDOipJOSp9KAyM5fNcVjldd/e4V+qwcyoOijFywNfSK10M=
-----END CERTIFICATE-----
28 changes: 28 additions & 0 deletions test/certs/https-snakeoil.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDRYWvHOSSo2Kx3
OwU6prhUgMWLEim1FGtJPtDxaY4Y+yKPzTnh4cX3SyV/wS1UFxA4bzpUkwwYAt0U
JMQmSZjMymYzA5Y9HMWNHrGbXKrdLEacEb0/hARPUpRbuE1jNgUOpORODiF//WlJ
PR0PfaUo6pobv+5++p/+Q36sRsJH1WXp4CNSsH3s2gefkMAL6Eu7WnUTqk8sp1dZ
HfjhfQSWcDtXkfZQIhnNd/SfwR3oFXKnayNON6Eftb8k8ARaaHcOB2HSRzYKOwyg
LZl6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Wm02ZFcKb7WADZ3yb9wKr5yq
2b/AsAqckO21vsUnWMGgHlzHCNy8j+0O0IsMJX8CgYAORhyGaU7x5t4kEvqBNIan
mOzuB0b5nYV9mHxmyFhOsa8LeM25SA4n1rFpTb8h6vmZF1y9+4Zy4uNfCR2wXg0v
I51qtZ8npbIksYvNqvHaTPg8ZBcFK5mHr3TDxXJCcc0ylzM98ze08D+qKr0joX4w
KlqN6KjGmYfb+RHehLk9sw==
-----END PRIVATE KEY-----
2 changes: 1 addition & 1 deletion test/module/webpage/local-urls-disabled-iframe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// phantomjs: --web-security=no --local-url-access=no
//! phantomjs: --web-security=no --local-url-access=no

var assert = require("../../assert");
var p = require("webpage").create();
Expand Down
2 changes: 1 addition & 1 deletion test/module/webpage/local-urls-disabled.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// phantomjs: --local-url-access=no
//! phantomjs: --local-url-access=no

var assert = require("../../assert");
var p = require("webpage").create();
Expand Down
2 changes: 1 addition & 1 deletion test/module/webpage/local-urls-enabled-iframe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// phantomjs: --web-security=no --local-url-access=yes
//! phantomjs: --web-security=no --local-url-access=yes

var assert = require("../../assert");
var p = require("webpage").create();
Expand Down
2 changes: 1 addition & 1 deletion test/module/webpage/local-urls-enabled.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// phantomjs: --local-url-access=yes
//! phantomjs: --local-url-access=yes

var assert = require("../../assert");
var p = require("webpage").create();
Expand Down
Loading

0 comments on commit 3ddce2a

Please sign in to comment.