@@ -446,8 +446,8 @@ def test_SetProgramOptionsCMake_test_STRING_value_surrounded_by_double_quotes(se
446446 print ("Section : {}" .format (section ))
447447
448448 option_list_expect = [
449- '-DPanzer_FADTYPE :STRING="Sacado::Fad::DFad<RealType >"' ,
450- '-DDART_TESTING_TIMEOUT :STRING="600"' ,
449+ '-DFOO :STRING="foo::bar::baz<Type >"' ,
450+ '-DBAR :STRING="600"'
451451 ]
452452 option_list_actual = parser .gen_option_list (section , generator = "bash" )
453453
@@ -467,6 +467,32 @@ def test_SetProgramOptionsCMake_test_STRING_value_surrounded_by_double_quotes(se
467467 print ("OK" )
468468 return 0
469469
470+ def test_SetProgramOptionsCMake_opt_remove (self ):
471+ """
472+ This test validates that `opt-remove` will correctly remove a CMake var
473+ that was created using `opt-set-cmake-var`
474+ """
475+ parser = self ._create_standard_parser ()
476+
477+ print ("-----[ TEST BEGIN ]----------------------------------------" )
478+ section = "TEST_CMAKE_VAR_REMOVE"
479+ print ("Section : {}" .format (section ))
480+ option_list_bash_actual = parser .gen_option_list ('TEST_CMAKE_VAR_REMOVE' , 'bash' )
481+ option_list_bash_expect = [ '-DBAR_TEST=BAR' , '-DFOO=BAZ' ]
482+ self .assertListEqual (option_list_bash_expect , option_list_bash_actual )
483+ print ("-----[ TEST END ]------------------------------------------" )
484+
485+ print ("-----[ TEST BEGIN ]----------------------------------------" )
486+ section = "TEST_CMAKE_VAR_REMOVE"
487+ print ("Section : {}" .format (section ))
488+ option_list_cmake_fragment_actual = parser .gen_option_list ('TEST_CMAKE_VAR_REMOVE' , 'cmake_fragment' )
489+ option_list_cmake_fragment_expect = [ 'set(BAR_TEST BAR)' , 'set(FOO BAZ)' ]
490+ self .assertListEqual (option_list_cmake_fragment_expect , option_list_cmake_fragment_actual )
491+ print ("-----[ TEST END ]------------------------------------------" )
492+
493+ print ("OK" )
494+ return 0
495+
470496 def _create_standard_parser (
471497 self , filename = DEFAULT_VALUE (), debug_level = 5 , ece_level = 4 , ece_compact = False
472498 ):
0 commit comments