File: fix-test-load-path.patch

package info (click to toggle)
ruby-systemu 2.6.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 164 kB
  • sloc: ruby: 525; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 920 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: Fix loading of systemu in tests
 This is required in order to allow execution of tests in ci.d.n
 The first fragment of this patch is required for execution with gem2deb-test-runner,
 as lib/ is moved away by the runner.
Origin: vendor
Forwarded: not-needed
--- a/test/systemu_test.rb
+++ b/test/systemu_test.rb
@@ -6,7 +6,7 @@ Testing SystemU do
   testing 'that simple usage works' do
     status, stdout, stderr = assert{ systemu :bin/:ls }
     assert{ status == 0 }
-    assert{ stdout['lib'] }
+    assert{ stdout['samples'] }
     assert{ stderr.strip.empty? }
   end
 
@@ -70,7 +70,8 @@ BEGIN {
   testdir = File.dirname(File.expand_path(__FILE__))
   rootdir = File.dirname(testdir)
   libdir = File.join(rootdir, 'lib')
-  require File.join(libdir, 'systemu')
+  $: << File.join(File.expand_path(File.dirname(__FILE__)), '../lib')
+  require 'systemu'
   require File.join(testdir, 'testing')