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"""
8Verify that "else-if" conditions work.
9"""
10
11import TestGyp
12
13test = TestGyp.TestGyp()
14
15test.run_gyp('elseif.gyp')
16test.build('elseif.gyp', test.ALL)
17test.run_built_executable(
18    'program0', stdout='first_if\n')
19test.run_built_executable(
20    'program1', stdout='first_else_if\n')
21test.run_built_executable(
22    'program2', stdout='second_else_if\n')
23test.run_built_executable(
24    'program3', stdout='third_else_if\n')
25test.run_built_executable(
26    'program4', stdout='last_else\n')
27
28# Verify that bad condition blocks fail at gyp time.
29test.run_gyp('elseif_bad1.gyp', status=1, stderr=None)
30test.run_gyp('elseif_bad2.gyp', status=1, stderr=None)
31test.run_gyp('elseif_bad3.gyp', status=1, stderr=None)
32
33test.pass_test()
34