From 327981e72e016a556d193b20fda96d8e57b56ff1 Mon Sep 17 00:00:00 2001 From: Sky Johnson Date: Wed, 11 Sep 2024 07:31:14 -0500 Subject: [PATCH] Move flag logic to test tools script --- tests/segment.php | 8 ++------ tests/simple.php | 5 ----- tests/tools.php | 9 +++++++++ tests/trie.php | 5 ----- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/tests/segment.php b/tests/segment.php index b367d89..af48700 100644 --- a/tests/segment.php +++ b/tests/segment.php @@ -8,11 +8,6 @@ The requests are randomly picked from the array of routes. */ -// if there's a flag, reset the opcache -if (in_array('-f', $argv)) { - opcache_reset(); -} - require_once 'tools.php'; $r = new SegmentRouter(); @@ -20,7 +15,8 @@ $r = new SegmentRouter(); // Blog lookups $blog = readAndAddRoutes('blog.txt', $r); writeRoutesToFile($r->routes, 'storage/segment/blog.txt'); -echoTitle("Starting github lookups"); +echoTitle("Starting blog lookups"); +runIterations(10000, $r, $blog); runIterations(100000, $r, $blog); runIterations(1000000, $r, $blog); unset($blog); diff --git a/tests/simple.php b/tests/simple.php index 72f3aa8..2930430 100644 --- a/tests/simple.php +++ b/tests/simple.php @@ -8,11 +8,6 @@ The requests are randomly picked from the array of routes. */ -// if there's a flag, reset the opcache -if (in_array('-f', $argv)) { - opcache_reset(); -} - require_once 'tools.php'; require_once __DIR__ . '/../SimpleRouter.php'; diff --git a/tests/tools.php b/tests/tools.php index e9d27f0..b2ad00e 100644 --- a/tests/tools.php +++ b/tests/tools.php @@ -1,5 +1,11 @@ lookup($method, $uri); if ($res === 404 || $res === 405) { diff --git a/tests/trie.php b/tests/trie.php index 3c257d2..a7b30c3 100644 --- a/tests/trie.php +++ b/tests/trie.php @@ -8,11 +8,6 @@ The requests are randomly picked from the array of routes. */ -// if there's a flag, reset the opcache -if (in_array('-f', $argv)) { - opcache_reset(); -} - require_once 'tools.php'; $r = new TrieRouter();