From 89c46179cdeb28b2ae48c8802e02a0555f11a240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Sun, 24 May 2020 16:14:15 +0800 Subject: [PATCH] update test readme (#3345) --- tests/README.md | 4 ++-- tests/new | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/README.md b/tests/README.md index db8e5b072a3..f24f7e9e6c5 100644 --- a/tests/README.md +++ b/tests/README.md @@ -45,8 +45,8 @@ Run `./clean` to remove all of the tests log files. ## Contribute the test script Run `./new [test-script-filename]` -E.g. : `./new ./swoole-coroutine/co_sleep.phpt` +E.g. : `./new ./swoole_coroutine/co_sleep.phpt` It will generate the test script file and auto open on your ide (MacOS only). -![](https://ws1.sinaimg.cn/large/006DQdzWly1frvn56azn9g30rs0m8b29.gif) +![](https://cdn.jsdelivr.net/gh/sy-records/staticfile/images/swoole/generate-example.gif) diff --git a/tests/new b/tests/new index 6c217625621..5e8e9c75559 100755 --- a/tests/new +++ b/tests/new @@ -48,9 +48,9 @@ if (!pathinfo($filename, PATHINFO_EXTENSION)) { $path['dirname'] = trim($path['dirname'], './'); // i know arg2 is a list but it's no problem $replacement = []; -$tip = swoole_color("[Test name]: ", SWOOLE_COLOR_BLUE); +$tip = swoole_color("[Test name]", SWOOLE_COLOR_BLUE); $path['filename'] = fgetsin($tip, false);// use test name to be filename -$tip = swoole_color("[Test intro]: ", SWOOLE_COLOR_BLUE); +$tip = swoole_color("[Test intro]", SWOOLE_COLOR_BLUE); $replacement['test_intro'] = fgetsin($tip, false); $this_dir_name = explode('/', $path['dirname']); $replacement['test_name'] = end($this_dir_name); // use dir name to be test name @@ -100,14 +100,14 @@ if (file_put_contents($filename, $template)) { @shell_exec('/usr/bin/env git add ' . __DIR__ . "/$filename"); if (\stripos(PHP_OS, 'Darwin') !== false) { //MacOS - $pstorm = '/usr/local/bin/pstorm'; + $pstorm = '/usr/local/bin/phpstorm'; if (file_exists($pstorm) || ( file_exists('/Applications/PhpStorm.app') && file_put_contents($pstorm, file_get_contents(__DIR__ . '/include/macos/phpstorm.py')) && chmod($pstorm, 0744) ) ) { - @shell_exec("/usr/local/bin/phpstorm {$filename}"); + @shell_exec("{$pstorm} {$filename}"); } } } else {