Finalize arch specific defines + tests

This commit is contained in:
mratsim 2018-03-28 12:56:26 +02:00
parent 6f1368f1bd
commit 89618eeff2
6 changed files with 34 additions and 18 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
nimcache/ nimcache/
build/

View File

@ -8,3 +8,16 @@ license = "Apache License 2.0"
skipDirs = @["tests"] skipDirs = @["tests"]
requires "nim >= 0.18.0" requires "nim >= 0.18.0"
proc test(name: string, lang: string = "c") =
if not dirExists "build":
mkDir "build"
if not dirExists "nimcache":
mkDir "nimcache"
--run
--nimcache: "nimcache"
switch("out", ("./build/" & name))
setCommand lang, "tests/" & name & ".nim"
task test, "Run Proof-of-Work tests (without mining)":
test "test1"

View File

@ -9,7 +9,7 @@ git submodule update
## Arch specific defines ## Arch specific defines
You can get a list of arch specific defines via `clang -dM -E -x c /dev/null` You can get a list of arch specific defines with clang via `clang -dM -E -x c /dev/null`
On a Mac with 10.13.3 (High Sierra) this gives On a Mac with 10.13.3 (High Sierra) this gives

View File

@ -59,8 +59,25 @@
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1 #define HAVE_UNISTD_H 1
#if defined(__x86_64)||defined(__x86_64__)||defined(_WIN64)
/* Define this symbol to enable x86_64 assembly optimizations */
#define USE_ASM_X86_64 1
#endif
#if defined(_LP64)||defined(__LP64__)||defined(__64BIT__)||defined(__LLP64__)
/* Define to 1 if the system has the type `__int128'. */ /* Define to 1 if the system has the type `__int128'. */
#define HAVE___INT128 1 #define HAVE___INT128 1
/* Define this symbol to use the 4x64 scalar implementation */
#define USE_SCALAR_4X64 1
/* Define this symbol to use the FIELD_5X52 implementation */
#define USE_FIELD_5X52 1
#else
/* Define this symbol to use the 8x32 scalar implementation */
#define USE_SCALAR_8X32 1
/* Define this symbol to use the FIELD_10X26 implementation */
#define USE_FIELD_10X26 1
#endif
/* Define to the sub-directory where libtool stores uninstalled libraries. */ /* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/" #define LT_OBJDIR ".libs/"
@ -89,9 +106,6 @@
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Define this symbol to enable x86_64 assembly optimizations */
#define USE_ASM_X86_64 1
/* Define this symbol to use a statically generated ecmult table */ /* Define this symbol to use a statically generated ecmult table */
#define USE_ECMULT_STATIC_PRECOMPUTATION 1 #define USE_ECMULT_STATIC_PRECOMPUTATION 1
@ -102,12 +116,6 @@
used */ used */
/* #undef USE_EXTERNAL_ASM */ /* #undef USE_EXTERNAL_ASM */
/* Define this symbol to use the FIELD_10X26 implementation */
/* #undef USE_FIELD_10X26 */
/* Define this symbol to use the FIELD_5X52 implementation */
#define USE_FIELD_5X52 1
/* Define this symbol to use the native field inverse implementation */ /* Define this symbol to use the native field inverse implementation */
#define USE_FIELD_INV_BUILTIN 1 #define USE_FIELD_INV_BUILTIN 1
@ -120,12 +128,6 @@
/* Define this symbol to use no num implementation */ /* Define this symbol to use no num implementation */
#define USE_NUM_NONE 1 #define USE_NUM_NONE 1
/* Define this symbol to use the 4x64 scalar implementation */
#define USE_SCALAR_4X64 1
/* Define this symbol to use the 8x32 scalar implementation */
/* #undef USE_SCALAR_8X32 */
/* Define this symbol to use the native scalar inverse implementation */ /* Define this symbol to use the native scalar inverse implementation */
#define USE_SCALAR_INV_BUILTIN 1 #define USE_SCALAR_INV_BUILTIN 1

View File

@ -1,4 +1,4 @@
import secp256k1, unittest import ../secp256k1, unittest
suite "Test1": suite "Test1":
test "Context should be created and destroyed": test "Context should be created and destroyed":

View File

@ -1 +0,0 @@
switch("path", "$projectDir/..")