File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 5050 run : cargo test -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools"
5151
5252 - name : workspace test (excluding examples & difftest)
53- run : cargo test --release --workspace --exclude "example-runner-*" --exclude "difftest*" --no-default-features --features use-installed-tools,include_str
53+ run : cargo test --release --workspace --exclude "example-runner-*" --exclude "difftest*" --no-default-features --features use-installed-tools,include_str,clap
5454
5555 # Examples
5656 - name : cargo check examples
Original file line number Diff line number Diff line change 7272#![ doc = include_str ! ( "../README.md" ) ]
7373
7474mod depfile;
75+ #[ cfg( test) ]
76+ mod tests;
7577#[ cfg( feature = "watch" ) ]
7678mod watch;
7779
Original file line number Diff line number Diff line change 1+ #[ cfg( feature = "clap" ) ]
2+ mod clap {
3+ pub use crate :: * ;
4+ use clap:: Parser ;
5+
6+ /// look at the output of this test to see what `--help` prints
7+ #[ test]
8+ fn test_clap_help ( ) {
9+ match SpirvBuilder :: try_parse_from ( [ "" , "--help" ] ) {
10+ Ok ( _) => panic ! ( "help must fail to parse" ) ,
11+ Err ( e) => {
12+ let e = e. to_string ( ) ;
13+ println ! ( "{}" , e) ;
14+ assert ! ( e. contains( "--target" ) ) ;
15+ }
16+ } ;
17+ }
18+
19+ #[ test]
20+ fn test_clap_target ( ) {
21+ let env = SpirvTargetEnv :: OpenGL_4_2 ;
22+ let builder = SpirvBuilder :: try_parse_from ( [ "" , "--target" , & env. target_triple ( ) ] )
23+ . map_err ( |e| e. to_string ( ) )
24+ . unwrap ( ) ;
25+ assert_eq ! ( builder. target, Some ( env) ) ;
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments