@@ -3,15 +3,16 @@ import { it as test } from "vitest";
33
44import { formatHelpText , parseArgs } from "./build-llama-cpp-dflash.mjs" ;
55
6- test ( "help advertises linux aarch64 CUDA fused but not mobile fused targets" , ( ) => {
6+ test ( "help advertises linux aarch64 CUDA and iOS fused but not Android fused targets" , ( ) => {
77 const helpText = formatHelpText ( ) ;
88 assert . match ( helpText , / l i n u x - a a r c h 6 4 - c u d a - f u s e d / ) ;
9+ assert . match ( helpText , / i o s - a r m 6 4 - m e t a l - f u s e d / ) ;
10+ assert . match ( helpText , / i o s - a r m 6 4 - s i m u l a t o r - m e t a l - f u s e d / ) ;
911 assert . doesNotMatch ( helpText , / a n d r o i d - a r m 6 4 - c p u - f u s e d / ) ;
1012 assert . doesNotMatch ( helpText , / a n d r o i d - x 8 6 _ 6 4 - c p u - f u s e d / ) ;
11- assert . doesNotMatch ( helpText , / i o s - a r m 6 4 - m e t a l - f u s e d / ) ;
1213} ) ;
1314
14- test ( "mobile fused targets fail closed with explicit diagnostics" , ( ) => {
15+ test ( "Android fused targets fail closed with explicit diagnostics while iOS fused is accepted " , ( ) => {
1516 const cases = [
1617 [ "android-arm64-cpu-fused" , / A n d r o i d f u s e d F F I i s n o t w i r e d / ] ,
1718 [ "android-arm64-vulkan-fused" , / A n d r o i d f u s e d F F I i s n o t w i r e d / ] ,
@@ -23,15 +24,24 @@ test("mobile fused targets fail closed with explicit diagnostics", () => {
2324 "android-x86_64-vulkan-fused" ,
2425 / A n d r o i d x 8 6 _ 6 4 f u s e d F F I i s n o t a d f l a s h t a r g e t / ,
2526 ] ,
26- [ "ios-arm64-metal-fused" , / i O S f u s e d F F I i s n o t w i r e d o r v e r i f i e r - c o v e r e d / ] ,
2727 ] ;
2828
2929 for ( const [ target , pattern ] of cases ) {
30- assert . throws ( ( ) => parseArgs ( [ "--target" , target , "--dry-run" ] ) , ( err ) => {
31- const message = err instanceof Error ? err . message : String ( err ) ;
32- assert . match ( message , pattern , message ) ;
33- assert . match ( message , new RegExp ( target ) , message ) ;
34- return true ;
35- } ) ;
30+ assert . throws (
31+ ( ) => parseArgs ( [ "--target" , target , "--dry-run" ] ) ,
32+ ( err ) => {
33+ const message = err instanceof Error ? err . message : String ( err ) ;
34+ assert . match ( message , pattern , message ) ;
35+ assert . match ( message , new RegExp ( target ) , message ) ;
36+ return true ;
37+ } ,
38+ ) ;
3639 }
40+
41+ assert . doesNotThrow ( ( ) =>
42+ parseArgs ( [ "--target" , "ios-arm64-metal-fused" , "--dry-run" ] ) ,
43+ ) ;
44+ assert . doesNotThrow ( ( ) =>
45+ parseArgs ( [ "--target" , "ios-arm64-simulator-metal-fused" , "--dry-run" ] ) ,
46+ ) ;
3747} ) ;
0 commit comments