Skip to content

Commit edbe06f

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

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/sapi.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ use ext_php_rs::ffi::{
1919
use ext_php_rs::prelude::*;
2020
use ext_php_rs::zend::try_catch_first;
2121
use std::ffi::c_char;
22-
use std::sync::{Arc, Mutex};
22+
use std::sync::Mutex;
23+
use std::thread;
24+
25+
#[cfg(php_zts)]
26+
use ext_php_rs::embed::ext_php_rs_sapi_per_thread_init;
27+
#[cfg(php_zts)]
28+
use std::sync::Arc;
29+
#[cfg(php_zts)]
2330
use std::thread;
2431

2532
static mut LAST_OUTPUT: String = String::new();
@@ -119,6 +126,7 @@ pub fn module(module: ModuleBuilder) -> ModuleBuilder {
119126
}
120127

121128
#[test]
129+
#[cfg(php_zts)]
122130
fn test_sapi_multithread() {
123131
let _guard = SAPI_TEST_MUTEX.lock().unwrap();
124132

0 commit comments

Comments
 (0)