mirror of
https://github.com/vlang/v.git
synced 2025-09-18 11:56:57 -04:00
ci: skip file_log_test.v on windows
This commit is contained in:
parent
55cac8841a
commit
8b71639f1f
@ -3,6 +3,10 @@ import log
|
|||||||
import rand
|
import rand
|
||||||
|
|
||||||
fn test_reopen() {
|
fn test_reopen() {
|
||||||
|
if os.user_os() == 'windows' && os.getenv('SKIP_TEST_REOPEN') == '' {
|
||||||
|
eprintln('skip renaming and reopening a log file on windows')
|
||||||
|
exit(0)
|
||||||
|
}
|
||||||
lfolder := os.join_path(os.vtmp_dir(), rand.ulid())
|
lfolder := os.join_path(os.vtmp_dir(), rand.ulid())
|
||||||
lpath1 := os.join_path(lfolder, 'current.log')
|
lpath1 := os.join_path(lfolder, 'current.log')
|
||||||
lpath2 := os.join_path(lfolder, 'current.log.2')
|
lpath2 := os.join_path(lfolder, 'current.log.2')
|
||||||
@ -14,7 +18,7 @@ fn test_reopen() {
|
|||||||
l.warn('one warning')
|
l.warn('one warning')
|
||||||
l.error('one error')
|
l.error('one error')
|
||||||
// simulate a log rotation, by moving the log file
|
// simulate a log rotation, by moving the log file
|
||||||
os.mv(lpath1, lpath2)!
|
os.rename(lpath1, lpath2)!
|
||||||
l.warn('another warning')
|
l.warn('another warning')
|
||||||
// call reopen, note that the message from above, should be in the new file lpath2:
|
// call reopen, note that the message from above, should be in the new file lpath2:
|
||||||
l.reopen()!
|
l.reopen()!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user