Explorar o código

Add thing for installing cargo-kcov

Benjamin Sago %!s(int64=8) %!d(string=hai) anos
pai
achega
d2b1499fb1
Modificáronse 1 ficheiros con 25 adicións e 1 borrados
  1. 25 1
      Vagrantfile

+ 25 - 1
Vagrantfile

@@ -19,8 +19,9 @@ Vagrant.configure(2) do |config|
     # Install the dependencies needed for exa to build, as quietly as
     # Install the dependencies needed for exa to build, as quietly as
     # apt can do.
     # apt can do.
     config.vm.provision :shell, privileged: true, inline: <<-EOF
     config.vm.provision :shell, privileged: true, inline: <<-EOF
+        set -xe
         apt-get install -qq -o=Dpkg::Use-Pty=0 -y \
         apt-get install -qq -o=Dpkg::Use-Pty=0 -y \
-          git cmake curl attr pkg-config libgit2-dev \
+          git cmake curl attr libgit2-dev \
           fish zsh bash bash-completion
           fish zsh bash bash-completion
     EOF
     EOF
 
 
@@ -49,12 +50,15 @@ Vagrant.configure(2) do |config|
         }
         }
 
 
         put_line ~/.bashrc 'export CARGO_TARGET_DIR=/home/#{developer}/target'
         put_line ~/.bashrc 'export CARGO_TARGET_DIR=/home/#{developer}/target'
+        put_line ~/.bashrc 'export PATH=$PATH:/home/#{developer}/.cargo/bin'
     EOF
     EOF
 
 
 
 
     # Create "dexa" and "rexa" scripts that run the debug and release
     # Create "dexa" and "rexa" scripts that run the debug and release
     # compiled versions of exa.
     # compiled versions of exa.
     config.vm.provision :shell, privileged: true, inline: <<-EOF
     config.vm.provision :shell, privileged: true, inline: <<-EOF
+        set -xe
+
         echo -e "#!/bin/sh\n/home/#{developer}/target/debug/exa \\$*" > /usr/bin/exa
         echo -e "#!/bin/sh\n/home/#{developer}/target/debug/exa \\$*" > /usr/bin/exa
         echo -e "#!/bin/sh\n/home/#{developer}/target/release/exa \\$*" > /usr/bin/rexa
         echo -e "#!/bin/sh\n/home/#{developer}/target/release/exa \\$*" > /usr/bin/rexa
         chmod +x /usr/bin/{exa,rexa}
         chmod +x /usr/bin/{exa,rexa}
@@ -63,6 +67,8 @@ Vagrant.configure(2) do |config|
 
 
     # Link the completion files so they’re “installed”.
     # Link the completion files so they’re “installed”.
     config.vm.provision :shell, privileged: true, inline: <<-EOF
     config.vm.provision :shell, privileged: true, inline: <<-EOF
+        set -xe
+
         test -h /etc/bash_completion.d/exa \
         test -h /etc/bash_completion.d/exa \
           || ln -s /vagrant/contrib/completions.bash /etc/bash_completion.d/exa
           || ln -s /vagrant/contrib/completions.bash /etc/bash_completion.d/exa
 
 
@@ -331,4 +337,22 @@ Vagrant.configure(2) do |config|
 
 
         sudo chown #{user}:#{user} -R "#{test_dir}/attributes"
         sudo chown #{user}:#{user} -R "#{test_dir}/attributes"
     EOF
     EOF
+
+
+    # Install kcov for test coverage
+    # This doesn’t run coverage over the xtests so it’s less useful for now
+    if ENV.key?('INSTALL_KCOV')
+        config.vm.provision :shell, privileged: false, inline: <<-EOF
+            set -xe
+
+            test -e ~/.cargo/bin/cargo-kcov \
+              || cargo install cargo-kcov
+
+            sudo apt-get install -qq -o=Dpkg::Use-Pty=0 -y \
+              cmake g++ pkg-config \
+              libcurl4-openssl-dev libdw-dev binutils-dev libiberty-dev
+
+            cargo kcov --print-install-kcov-sh | sudo sh
+        EOF
+    end
 end
 end