Skip to content

Commit

Permalink
Basic integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Null Cating-Subramanian committed Jun 3, 2016
1 parent 3ac7658 commit b57f4ca
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .kitchen.yml
Expand Up @@ -22,3 +22,6 @@ suites:
- name: tools64
run_list:
- recipe[mingw_tdm_install::install64]
- name: msys2_tools64
run_list:
- recipe[mingw_msys2_install::default]
1 change: 1 addition & 0 deletions Berksfile
Expand Up @@ -8,4 +8,5 @@ metadata

group :integration do
fixture 'tdm_install'
fixture 'msys2_install'
end
5 changes: 5 additions & 0 deletions test/fixtures/cookbooks/mingw_msys2_install/metadata.rb
@@ -0,0 +1,5 @@
name 'mingw_msys2_install'
version '0.1.0'

supports 'windows'
depends 'mingw'
29 changes: 29 additions & 0 deletions test/fixtures/cookbooks/mingw_msys2_install/recipes/default.rb
@@ -0,0 +1,29 @@
#
# Cookbook Name:: mingw_msys2_install
# Recipe:: default
#
# Copyright 2016 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

include_recipe 'mingw::default'

root_path = "#{ENV['SYSTEMDRIVE']}\\msys2"

msys2_package 'base-devel' do
root root_path
end

msys2_package 'mingw-w64-x86_64-toolchain' do
root root_path
end
25 changes: 25 additions & 0 deletions test/integration/msys2_tools64/serverspec/msys2_spec.rb
@@ -0,0 +1,25 @@
require 'spec_helper'

set :path, "C:\\msys2\\bin;C:\\msys2\\mingw64\\bin;C:\\msys2\\usr\\bin;#{ENV['PATH']}"

describe command('gcc --version') do
its(:exit_status) { should eq 0 }
its(:stdout) { should include 'gcc.exe (Rev1, Built by MSYS2 project)' }
end

describe command('gcc -dumpmachine') do
its(:exit_status) { should eq 0 }
its(:stdout) { should eq "x86_64-w64-mingw32\n" }
end

describe command('as --version') do
its(:exit_status) { should eq 0 }
its(:stdout) { should include '2.25' }
its(:stdout) { should include 'x86_64-w64-mingw32' }
end

describe command('make --version') do
its(:exit_status) { should eq 0 }
its(:stdout) { should include 'GNU Make 4.1' }
its(:stdout) { should include 'x86_64-pc-msys' }
end

0 comments on commit b57f4ca

Please sign in to comment.