Add github workflow to run RScons tests
Fix up some macOS test cases
This commit is contained in:
parent
18a2a075c1
commit
8d9f19cb34
38
.github/workflows/run-tests.yml
vendored
Normal file
38
.github/workflows/run-tests.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
name: Run RScons Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
ruby-version: ['2.7', '3.0', '3.4']
|
||||
|
||||
steps:
|
||||
- name: Install dependencies (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: sudo apt-get update && sudo apt-get install -y gcc gdc ldc clang flex bison
|
||||
|
||||
- name: Install dependencies (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: brew install gcc ldc flex bison
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: bundle install
|
||||
|
||||
- name: Run tests
|
||||
run: rake all
|
||||
@ -3,5 +3,5 @@ env do |env|
|
||||
env["CFLAGS"] += %w[-S]
|
||||
env.Object("one.ssss", "one.c", "CPPFLAGS" => ["-DONE"])
|
||||
env.Object("two.sss", "two.c")
|
||||
env.Program("two_sources.exe", %w[one.ssss two.sss], "ASFLAGS" => env["ASFLAGS"] + %w[-x assembler])
|
||||
env.Program("two_sources.exe", %w[one.ssss two.sss], "ASFLAGS" => env["ASFLAGS"] + %w[-x assembler-with-cpp])
|
||||
end
|
||||
|
||||
@ -665,7 +665,7 @@ EOF
|
||||
expect(result.stdout).to eq ""
|
||||
end
|
||||
|
||||
unless RUBY_PLATFORM =~ /mingw|msys/
|
||||
unless RUBY_PLATFORM =~ /mingw|msys|darwin/
|
||||
it "supports building D sources with gdc" do
|
||||
test_dir("d")
|
||||
result = run_rscons
|
||||
@ -711,7 +711,7 @@ EOF
|
||||
expect(`./hello-d.exe`.rstrip).to eq "Hello from D, value is 33!"
|
||||
end
|
||||
|
||||
unless RUBY_PLATFORM =~ /mingw|msys/
|
||||
unless RUBY_PLATFORM =~ /mingw|msys|darwin/
|
||||
it "links with the D linker when object files were built from D sources" do
|
||||
test_dir("d")
|
||||
result = run_rscons(args: %w[-f link_objects.rb])
|
||||
@ -761,7 +761,7 @@ EOF
|
||||
result = run_rscons(args: %w[-f disassemble.rb])
|
||||
expect(result.stderr).to eq ""
|
||||
expect(File.exist?("simple.txt")).to be_truthy
|
||||
expect(File.read("simple.txt")).to match /Disassembly of section .text:/
|
||||
expect(File.read("simple.txt")).to match /Disassembly of section/
|
||||
|
||||
result = run_rscons(args: %w[-f disassemble.rb])
|
||||
expect(result.stderr).to eq ""
|
||||
@ -1211,7 +1211,7 @@ EOF
|
||||
%r{Compiling simple.c},
|
||||
%r{My Disassemble simple.txt},
|
||||
])
|
||||
expect(File.read("simple.txt")).to match /Disassembly of section .text:/
|
||||
expect(File.read("simple.txt")).to match /Disassembly of section/
|
||||
end
|
||||
end
|
||||
|
||||
@ -2024,7 +2024,7 @@ EOF
|
||||
{"check_d_compiler.rb" => "when no arguments are given",
|
||||
"check_d_compiler_find_first.rb" => "when arguments are given"}.each_pair do |rsconscript, desc|
|
||||
context desc do
|
||||
unless RUBY_PLATFORM =~ /mingw|msys/
|
||||
unless RUBY_PLATFORM =~ /mingw|msys|darwin/
|
||||
it "finds the first listed D compiler" do
|
||||
test_dir "configure"
|
||||
result = run_rscons(args: %W[-f #{rsconscript} configure])
|
||||
@ -2056,6 +2056,7 @@ EOF
|
||||
end
|
||||
end
|
||||
|
||||
unless RUBY_PLATFORM =~ /mingw|msys|darwin/
|
||||
it "respects use flag" do
|
||||
test_dir "configure"
|
||||
result = run_rscons(args: %w[-f check_d_compiler_use.rb -v])
|
||||
@ -2067,7 +2068,6 @@ EOF
|
||||
expect(result.stdout).to_not match %r{\bgdc .*/t2/}
|
||||
end
|
||||
|
||||
unless RUBY_PLATFORM =~ /mingw|msys/
|
||||
it "successfully tests a compiler with an unknown name that uses gdc-compatible options" do
|
||||
test_dir "configure"
|
||||
create_exe "mycompiler", %[exec gdc "$@"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user