diff libpam-sys/libpam-sys-test/build.rs @ 125:2b255c92417b

Introduce base PAM functions; use the real X/SSO PAM header for tests.
author Paul Fisher <paul@pfish.zone>
date Mon, 30 Jun 2025 17:47:32 -0400
parents f469b8d9ad78
children c77846f3a979
line wrap: on
line diff
--- a/libpam-sys/libpam-sys-test/build.rs	Mon Jun 30 04:54:38 2025 -0400
+++ b/libpam-sys/libpam-sys-test/build.rs	Mon Jun 30 17:47:32 2025 -0400
@@ -1,10 +1,13 @@
 use bindgen::MacroTypeVariation;
-use libpam_sys::PamImpl;
+use libpam_sys_impls::__pam_impl_enum__;
 use quote::{format_ident, ToTokens};
 use std::path::PathBuf;
 use std::{env, fs};
 use syn::{Item, ItemConst, Type, TypePath};
 
+// We're using the macro directly so we can match exhaustively.
+__pam_impl_enum__!();
+
 fn main() {
     let config = match PamImpl::CURRENT {
         PamImpl::LinuxPam => TestConfig {
@@ -37,11 +40,10 @@
             ..Default::default()
         },
         PamImpl::XSso => TestConfig {
-            headers: vec!["\"xsso_constants.h\""],
+            headers: vec!["\"xsso_pam_appl.h\""],
             ignore_consts: vec!["PAM_CRED_PRELIM_CHECK"],
             ..Default::default()
         },
-        other => panic!("Unknown PAM implementation {other:?}"),
     };
     generate_const_test(&config);
 }