Skip to content

Commit

Permalink
Merge pull request #16 from libmir/ShigekiKarita-patch-x86
Browse files Browse the repository at this point in the history
fix x86 test falures
  • Loading branch information
ShigekiKarita authored Sep 29, 2017
2 parents 3a87d4b + aa93d80 commit 5678bc4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ d:
env:
- ARCH="x86_64"

matrix:
include:
- {os: linux, d: ldc, env: ARCH="x86", addons: {apt: {packages: [[gcc-multilib]]}}}
- {os: linux, d: dmd, env: ARCH="x86", addons: {apt: {packages: [[gcc-multilib]]}}}

before_install:
- sudo apt-get install -qq python-numpy
- cd test && python test_npy_fileio.py && cd ..
Expand Down
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: doc test clean
.PHONY: doc test test-ldc clean


clean:
Expand All @@ -20,12 +20,17 @@ hmod:
hmod --exclude numir.old ./source
mv doc docs

test/a1_f4.npy: test/npy_test.py
test/a1_f4.npy: test/test_npy_fileio.py
cd test && python test_npy_fileio.py && cd ..

test:
dub test --build=unittest-cov --compiler=dmd
test: test/a1_f4.npy
dub test --build=unittest-cov --compiler=dmd --arch=x86
tail -n 1 source-numir*.lst
dub test --build=unittest-cov --compiler=dmd --arch=x86
tail -n 1 source-numir*.lst

test-ldc:
test-ldc: test/a1_f4.npy
dub test --build=unittest-cov --compiler=ldc2
tail -n 1 source-numir*.lst
dub test --build=unittest-cov --compiler=dmd --arch=x86
tail -n 1 source-numir*.lst
10 changes: 10 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ environment:
arch: x64
PYTHON_VERSION: 3.6
MINICONDA: C:\Miniconda3
- DC: dmd
DVersion: stable
arch: x86
PYTHON_VERSION: 3.6
MINICONDA: C:\Miniconda3
- DC: ldc
DVersion: stable
arch: x86
PYTHON_VERSION: 3.6
MINICONDA: C:\Miniconda3

skip_tags: false
branches:
Expand Down
2 changes: 1 addition & 1 deletion source/numir/io.d
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ immutable npyfmt = "{'descr': '%s', 'fortran_order': %s, 'shape': (%s), }";
struct NpyHeaderInfo(size_t N)
{
string descr;
long[N] shape;
ptrdiff_t[N] shape;
}


Expand Down
3 changes: 2 additions & 1 deletion source/numir/random.d
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ auto permutation(T...)(T t) {
unittest {
import numir : arange;
import mir.ndslice.sorting : sort;
import numir.testing : approxEqual;
import std.stdio;
auto ps1 = permutation(100);
auto ps2 = permutation(100);
Expand All @@ -129,5 +130,5 @@ unittest {
auto ps3 = permutation(1, 10, 0.1);
auto ps4 = permutation(1, 10, 0.1);
assert(ps3 != ps4);
assert(ps4.sort() == arange(1, 10, 0.1));
assert(ps4.sort.approxEqual(arange(1, 10, 0.1)));
}

0 comments on commit 5678bc4

Please sign in to comment.