Skip to content

Commit d966aa4

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 d966aa4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/sapi.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern crate ext_php_rs;
1010

1111
use ext_php_rs::builders::SapiBuilder;
1212
use ext_php_rs::embed::{
13-
Embed, ext_php_rs_sapi_per_thread_init, ext_php_rs_sapi_shutdown, ext_php_rs_sapi_startup,
13+
Embed, ext_php_rs_sapi_shutdown, ext_php_rs_sapi_startup,
1414
};
1515
use ext_php_rs::ffi::{
1616
ZEND_RESULT_CODE_SUCCESS, php_module_shutdown, php_module_startup, php_request_shutdown,
@@ -19,7 +19,13 @@ 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+
24+
#[cfg(php_zts)]
25+
use ext_php_rs::embed::ext_php_rs_sapi_per_thread_init;
26+
#[cfg(php_zts)]
27+
use std::sync::Arc;
28+
#[cfg(php_zts)]
2329
use std::thread;
2430

2531
static mut LAST_OUTPUT: String = String::new();
@@ -119,6 +125,7 @@ pub fn module(module: ModuleBuilder) -> ModuleBuilder {
119125
}
120126

121127
#[test]
128+
#[cfg(php_zts)]
122129
fn test_sapi_multithread() {
123130
let _guard = SAPI_TEST_MUTEX.lock().unwrap();
124131

0 commit comments

Comments
 (0)