forked from howardjones/network-weathermap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaudit-tests.php
More file actions
25 lines (20 loc) · 809 Bytes
/
audit-tests.php
File metadata and controls
25 lines (20 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/**
* Scan through all the .conf files in test-suite/tests and make sure there's a reference image for each.
* If there isn't, output the appropriate weathermap cli command to generate one.
*/
$testdir = "test-suite/tests/";
$referencedir = "test-suite/references/";
$dh = opendir($testdir);
if ($dh) {
while (false !== ($file = readdir($dh))) {
$realfile = $testdir . DIRECTORY_SEPARATOR . $file;
if (substr($realfile, -5, 5) == ".conf") {
$referencefile = $referencedir . DIRECTORY_SEPARATOR . $file . ".png";
if (!file_exists($referencefile)) {
print "# No reference for $realfile\n";
printf("./weathermap --config test-suite/tests/$file --output test-suite/references/$file.png\n");
}
}
}
}