Skip to content

Commit 97b19bc

Browse files
Qardptondereau
andcommitted
test: only run multi-threaded sapi test when ZTS enabled
Co-authored-by: Pierre Tondereau <[email protected]>
1 parent e0ce1cc commit 97b19bc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/sapi.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,21 @@
99
extern crate ext_php_rs;
1010

1111
use ext_php_rs::builders::SapiBuilder;
12-
use ext_php_rs::embed::{
13-
Embed, ext_php_rs_sapi_per_thread_init, ext_php_rs_sapi_shutdown, ext_php_rs_sapi_startup,
14-
};
12+
use ext_php_rs::embed::{Embed, ext_php_rs_sapi_shutdown, ext_php_rs_sapi_startup};
1513
use ext_php_rs::ffi::{
1614
ZEND_RESULT_CODE_SUCCESS, php_module_shutdown, php_module_startup, php_request_shutdown,
1715
php_request_startup, sapi_shutdown, sapi_startup,
1816
};
1917
use ext_php_rs::prelude::*;
2018
use ext_php_rs::zend::try_catch_first;
2119
use std::ffi::c_char;
22-
use std::sync::{Arc, Mutex};
20+
use std::sync::Mutex;
21+
22+
#[cfg(php_zts)]
23+
use ext_php_rs::embed::ext_php_rs_sapi_per_thread_init;
24+
#[cfg(php_zts)]
25+
use std::sync::Arc;
26+
#[cfg(php_zts)]
2327
use std::thread;
2428

2529
static mut LAST_OUTPUT: String = String::new();
@@ -119,6 +123,7 @@ pub fn module(module: ModuleBuilder) -> ModuleBuilder {
119123
}
120124

121125
#[test]
126+
#[cfg(php_zts)]
122127
fn test_sapi_multithread() {
123128
let _guard = SAPI_TEST_MUTEX.lock().unwrap();
124129

0 commit comments

Comments
 (0)