1 #!/usr/bin/env python 2 3 # Copyright (c) 2014 Google Inc. All rights reserved. 4 # Use of this source code is governed by a BSD-style license that can be 5 # found in the LICENSE file. 6 7 """ 8 Verify that "else-if" conditions work. 9 """ 10 11 import TestGyp 12 13 test = TestGyp.TestGyp() 14 15 test.run_gyp('elseif.gyp') 16 test.build('elseif.gyp', test.ALL) 17 test.run_built_executable( 18 'program0', stdout='first_if\n') 19 test.run_built_executable( 20 'program1', stdout='first_else_if\n') 21 test.run_built_executable( 22 'program2', stdout='second_else_if\n') 23 test.run_built_executable( 24 'program3', stdout='third_else_if\n') 25 test.run_built_executable( 26 'program4', stdout='last_else\n') 27 28 # Verify that bad condition blocks fail at gyp time. 29 test.run_gyp('elseif_bad1.gyp', status=1, stderr=None) 30 test.run_gyp('elseif_bad2.gyp', status=1, stderr=None) 31 test.run_gyp('elseif_bad3.gyp', status=1, stderr=None) 32 33 test.pass_test() 34