Edit

kc3-lang/automake/tests/cond.test

Branch :

  • Show log

    Commit

  • Author : Akim Demaille
    Date : 2001-02-25 18:42:41
    Hash : 1b09f1d2
    Message : Internally just store the conditionals as space separated lists of CONDITIONS (instead of @CONDITIONS@). * automake.in (&conditional_true_when, &variable_conditions_sub): Split conditions at spaces. (&handle_dependencies, &variable_conditions_permutations): Don't put @ around conditions. (&variable_conditions_cmp): There are no @ to strip. (&make_condition): New. (&define_pretty_variable, &read_main_am_file, &read_am_file): Use it. (&read_main_am_file, &read_am_file): Stop playing with @ by hand. Join @conditional_stack with spaces. (&read_main_am_file): Adjust the output of variables. Output `TRUE = true' under the condition `TEST' as `@TEST@TRUE = true' and no longer `@TEST@TRUE = @TEST@true'. (&variable_conditions_cmp): Rename as... (&by_condition): this. Sort in a human pleasant order. Use it everywhere a human can see conditions. (&variable_conditions_reduce): Don't sort conditions, that's pointless. * tests/cond.test, ctarget1.test, pluseq3.test: Strengthen.

  • tests/cond.test
  • #! /bin/sh
    
    # Check basic use of conditionals.
    
    . $srcdir/defs || exit 1
    
    cat > configure.in << 'END'
    AM_INIT_AUTOMAKE(nonesuch, nonesuch)
    AM_CONDITIONAL(TEST, true)
    AC_OUTPUT(Makefile)
    END
    
    cat > Makefile.am << 'END'
    if TEST
    VAR = true
    else
    VAR = false
    endif
    END
    
    set -e
    $AUTOMAKE
    
    grep '^@TEST_TRUE@VAR = true$' Makefile.in
    grep '^@TEST_FALSE@VAR = false$' Makefile.in
    
    exit 0