From 6547b1608d38d5b4c7cf6b2a1cdebe8e1168d034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20R=C3=BCger?= Date: Sun, 18 Aug 2019 15:30:52 +0300 Subject: [PATCH] Ok, any fail makes it go red, now i know also making command configurable as they seem different on ubuntu (16?) than fedora 30 (and who knows where else) --- .travis.yml | 2 -- test/mains/test_arm.rb | 22 ++++++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 593ba35c..850ea3b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,6 @@ before_install: - gem install bundler --version '2.0.1' language: ruby script: - - qemu-arm -version - - arm-linux-gnu-ld -v - ruby test/test_all.rb - bundle exec codeclimate-test-reporter rvm: diff --git a/test/mains/test_arm.rb b/test/mains/test_arm.rb index 16446395..79464b42 100644 --- a/test/mains/test_arm.rb +++ b/test/mains/test_arm.rb @@ -4,7 +4,14 @@ require 'net/scp' module Mains class TestArm < MiniTest::Test - + @Qemu = "qemu-arm" + @Linker = "arm-linux-gnuabi-ld" + def self.Linker + @Linker + end + def self.Qemu + @Qemu + end DEBUG = false # runnable_methods is called by minitest to determine which tests to run @@ -23,21 +30,20 @@ module Mains assert_equal stdout , out , "Wrong stdout #{name}" assert_equal exit_code , code.to_s , "Wrong exit code #{name}" end + break end tests end def self.has_qemu - qemu = "qemu-arm" - linker = "arm-linux-gnuabi-ld" if `uname -a`.include?("torsten") qemu = "qemu-arm" - linker = "arm-linux-gnu-ld" + @Linker = "arm-linux-gnu-ld" #return false end begin - `#{qemu} -version` - `#{linker} -v` + `#{@Qemu} -version` + `#{@Linker} -v` rescue => e puts e return false @@ -55,11 +61,11 @@ module Mains puts "Linking #{name}" if DEBUG - `arm-linux-gnu-ld -N mains.o` + `#{TestArm.Linker} -N mains.o` assert_equal 0 , $?.exitstatus , "Linking #{name} failed #{$?}" puts "Running #{name}" if DEBUG - stdout = `qemu-arm ./a.out` + stdout = `#{TestArm.Qemu} ./a.out` exit_code = $?.exitstatus puts "Result #{stdout} #{exit_code}" if DEBUG return stdout , exit_code