Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #7 Refactoring the criterion tests to libcheck #24

Merged
merged 107 commits into from
May 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
7e98958
refs #2 Define type arch in make test_libc && added test arm in travis
Jan 21, 2019
5f16e70
refs #2 Added qemu in travis
Jan 21, 2019
c20c159
refs #2 Declare GOARCH the arm
Jan 21, 2019
0bcd458
refs #2 Changes rename GOARCH=> ARCHGO in travis
Jan 21, 2019
1b5008f
refs #2 Changes in makefile, to manage the architecture 32 bits.
Jan 21, 2019
754545e
refs #2 Correction in the travis installation script
Jan 21, 2019
85633af
refs #2 Remove CC=gcc-6 the travis.yml
Jan 21, 2019
3f12323
refs #2 Changes package install to gcc and g++
Jan 21, 2019
b8ed913
refs #2 Changes in the travis, to check 32bits
Jan 22, 2019
10b9e13
refs #2 Remove parameter arch
Jan 22, 2019
a764d62
refs #2 Only test i386
Jan 22, 2019
0dff70f
refs #2 Changes this enable 32bits
Jan 22, 2019
f90e411
refs #2 Define by default env CC=i686-linux-gnu-gcc
Jan 22, 2019
9485a26
refs #2 Added new package install build-essential in .sh
Jan 22, 2019
fbd8574
refs #2 Added new package install python-dev in .sh
Jan 22, 2019
372e7c9
refs #2 Changes in the priority of installation of dependencies.
Jan 22, 2019
f9989a9
refs #2 Added i686-linux-gnu-gcc to pack install travis
Jan 22, 2019
3fedea1
refs #2 Change name package i686-linux-gnu-gcc=>gcc-i686-linux-gnu in…
Jan 22, 2019
9f0da6c
refs #2 Change name package gcc-i686-linux-gnu=>gcc-multilib-i686-lin…
Jan 22, 2019
b3923e0
refs #2 Added package install in script gcc-7-plugin-dev-i686-linux-gnu
Jan 22, 2019
bb80ba8
xUnitTest add the simpler struct for start wrapping up tests framewor…
Jan 24, 2019
06ad2b0
Merge branch 'master' into stdevAlDen_t7_refactor_in_tests ref 37
Jan 24, 2019
c662440
Merge remote-tracking branch 'simelo/olemis_t1_skycoin_submod' into s…
Jan 24, 2019
f993c84
refs #2 Restoring compiler default values
Jan 24, 2019
305daaf
refs #2 Changes in the format of the .travis.yml file
Jan 24, 2019
1069a77
refs #2 Changes in the format of the .travis.yml file
Jan 24, 2019
7379f9d
add assert member to xUnitTest struct ref #7
Jan 24, 2019
c9022c4
create_test_framework_wrapper for crterium ref #7
Jan 24, 2019
a5dfd84
moved TestAddressNull to shared test to e usedd in hardware-wallet to…
Jan 24, 2019
0df9271
refs #2 Delete env CC=i686-linux-gnu-gcc in .travis.yml
Jan 24, 2019
c7ee976
refs #2 Delete env CC=i686-linux-gnu-gcc in .travis.yml
Jan 24, 2019
d3c8c67
refs #2 Repair error by https://travis-ci.org/skycoin/libskycoin/buil…
Jan 24, 2019
30fa046
refactor some functions in a seprate file to be ignored in cgo stage,
Jan 25, 2019
2770fe5
refactor lib/cgo/cipher.crypto.hw.go, move import "C" to the top ref #7
Jan 25, 2019
7593435
refs #2 Finish remove crash in check_cipher.address
Jan 26, 2019
6e57151
refs #2 Added function in skytest by copyGoSlice_toGoSlice
Jan 26, 2019
03d18ca
Merge branch 'develop' of https://github.com/skycoin/libskycoin into …
Jan 28, 2019
4a019bb
Merge branch 'stdevHan_t2_support_arch' of https://github.com/simelo/…
Jan 28, 2019
c78274e
refs #2 Added env to cc=gcc-6
Jan 28, 2019
e9fbd12
Merge branch 'develop' of https://github.com/skycoin/libskycoin into …
Jan 31, 2019
a04b48a
Merge branch 'develop' of https://github.com/skycoin/libskycoin into …
Feb 3, 2019
3bbcc2b
refs #2 Update submodule skycoin/skycoin and added in Makefile parame…
Feb 9, 2019
0b8913a
refs #13 - Initial README for libskycoin project
olemis Feb 9, 2019
a9b1ca0
[ci] refs #13 - Remove installed version of gcc before installing gcc@6
olemis Feb 9, 2019
3d8ef40
[ci] refs #13 - brew remove gcc4.9
olemis Feb 10, 2019
df87e09
[ci] refs #13 - Do not overwrite gcc@6 from 42d31bba7772fb01f9ba442d9…
olemis Feb 10, 2019
043dc82
[ci] refs #13 - Travis images based on trusty (rather than xenial)
olemis Feb 10, 2019
3d64a5a
[ci] refs #13 - Restore overwrite gcc@6 from 42d31bba7772fb01f9ba442d…
olemis Feb 10, 2019
be543f0
Merge pull request #14 from simelo/olemis_t13_readme
olemis Feb 10, 2019
e7027b4
refs #15 Update submodule to v0.25.1
Feb 10, 2019
daca6b4
Merge pull request #16 from simelo/stdevHan_t15_update_0.25.1
olemis Feb 10, 2019
4c67594
refs #20 Adding to lib/cgo/cipher.base58.base58.go the function SKY_b…
Feb 13, 2019
59dd2f6
refs #20 Update CHANGELOG, and corrected that travis notifications go…
Feb 13, 2019
d6849aa
refs #20 Adding tests using SKY_base58_Hex2Base58
Feb 13, 2019
0215b6f
refs #20
Feb 14, 2019
80fc2de
refs # Update HANGELOG
Feb 14, 2019
1c6532b
refs #20 - Add function `SKY_cipher_Ripemd160FromBytes`
Feb 15, 2019
782188a
refs #20 - Add function `SKY_wallet_Entry_SkycoinAddress`
Feb 15, 2019
fe16d73
refs #20 - Add function `SKY_wallet_Wallet_GetAddress`
Feb 16, 2019
785df27
Remove header metadata from Github PR template
olemis Feb 16, 2019
6e025d2
refs #20 - Add function `SKY_wallet_Wallet_CreateAndSignTransactionAd…
Feb 16, 2019
d2397d9
Merge branch 'develop' of https://github.com/skycoin/libskycoin into …
Feb 16, 2019
55511a2
refs #20 Repair error in https://travis-ci.org/simelo/libskycoin/jobs…
Feb 17, 2019
0ef8b6d
refs #2 Merge branch 'develop' of https://github.com/skycoin/libskyco…
Feb 17, 2019
c24759b
refs #2 Update submodule
Feb 17, 2019
a4fe7c0
refs #2 Working on conversion of libskycoin tests from criterion to l…
Feb 18, 2019
1724d84
refs #2 Changes in types Makefile
Feb 18, 2019
423dc4b
refs #2 Comment make install-deps-libc in travis && add package in…
Feb 18, 2019
db32a12
refs #2 Changes in ciper.{address, bitcoin,crypto}
Feb 19, 2019
e1fbe6b
refs #2 Finish cipher
Feb 21, 2019
edee7e7
refs #2 Enable make clean-libc
Feb 21, 2019
4efcb88
Merge branch 'stdevHan_t20_export_missing' of https://github.com/sime…
Feb 21, 2019
d3fd33b
refs #2 Finish cipher.address && cipher.crypto
Feb 21, 2019
f73b20a
refs #2 Add ignore qemu
Feb 22, 2019
4698e57
refs #2 Finish cipher
Feb 22, 2019
6881b20
Refs #2 Added test coin.[block,coin.math,outputs]
Feb 22, 2019
8b5b186
refs #2 Separating the signal from the normal
Feb 22, 2019
6a8504c
refs #2 Finish params and coin
Feb 23, 2019
eaf80e5
refs #2 Finish write test by libcheck
Feb 23, 2019
151baf3
refs #2 Changes in the comparison functions, using the default libche…
Feb 24, 2019
1c61eaf
refs #2 Fixed the comparisons for x64
Feb 24, 2019
2104378
refs #2 Change value in skyerror by APPLE
Feb 24, 2019
ac75a56
refs #2 Change value SKY_ABORT by APPLE
Feb 24, 2019
ce2f90c
refs #2 Changing the type of test using the OS
Feb 24, 2019
014d393
refs #7 Refactoring the criterion tests to libcheck
Feb 25, 2019
27e9c74
refs #7 commented function already defined in another cgo.
Feb 25, 2019
ea7d570
[CHANGELOG] refs #7 Putting in the position that corresponds to the d…
Apr 27, 2019
d221c5d
[travis][Makefile] refs #7 Adding in the definition of installation o…
Apr 27, 2019
87ea8e6
[travis] refs #7 Remove the env CC=gcc-6 in the test run by travis, t…
Apr 27, 2019
b154076
[travis] refs #7 Restore the previous configurations in test make tes…
Apr 27, 2019
a4704aa
Merge branch 'v0.25dev' of https://github.com/skycoin/libskycoin into…
Apr 27, 2019
368020e
[travis] refs #7 Comment all definition in install-travis-gcc.sh, and…
Apr 27, 2019
1780f8a
[travis] refs #7 Define CC and CXX to env global
Apr 27, 2019
4cc273e
[travis] refs #7 Remove all test and only `make check`
Apr 27, 2019
7c8d884
[travis] refs #7 Restore install-travis-gcc.sh
Apr 27, 2019
9b5e097
[travis] refs #7 Remove CC and CXX in global env
Apr 27, 2019
d0a1634
[libc] refs #7 Repair error in gcc 4.8 in GNU/Linux https://travis-ci…
Apr 27, 2019
5c5d072
[test] refs #7 Correcting errors reported by travis in https://travis…
Apr 27, 2019
c285530
[test] refs #7 Correcting errors reported by travis in https://travis…
Apr 27, 2019
12087ce
[travis] refs #7 Upgrade dist trusty => xenial
Apr 27, 2019
aaa837b
[include] [cgo] refs #7 - Rename lib/cgo/skycriterion.h => lib/cgo/sk…
olemis May 1, 2019
f89926a
[libc] refs #7 - Remove splitCliArgs
olemis May 1, 2019
cf4f310
[include] refs #7 - Consistent header guard names
olemis May 1, 2019
787daa2
[include] refs #7 Deleting unnecessary comment on `cipher.testsuite.t…
May 1, 2019
ca8ae56
[cgo] refs #7 - Rename lib/cgo/tests/testutils/{libsky_criterion.c =>…
olemis May 5, 2019
6e36dc8
[CHANGELOG] refs #7 Restore to v0.25dev
May 5, 2019
06e7596
[cgo] refs #7 Restoring functions defined in `CGO`, incorporating the…
May 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
---
name: Pull request
about: Contribute with code to this project
title: ''
labels: ''
assignees: ''

---


Fixes #

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,6 @@ addresses.txt
seeds.csv

histogram
# Ignore compilator by qemu
qemu_*
core
19 changes: 8 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,42 @@
sudo: required
dist: xenial
language: go
go:
- "1.11.x"

matrix:
include:
- os: linux
dist: xenial
env: VERSION_UPGRADE_TEST_WAIT_TIMEOUT=45s
- os: osx
# Do not start osx build for PR
osx_image: xcode8
osx_image: xcode8.3
env: VERSION_UPGRADE_TEST_WAIT_TIMEOUT=60s

before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get update -qq; fi
- VERSION=1.10.2 ./ci-scripts/install-golangci-lint.sh
- ./ci-scripts/install-travis-gcc.sh
- eval "CC=gcc-6 && CXX=g++-6"

env:
global:
- BUILD_DIR: build
- BUILDLIB_DIR: $BUILD_DIR/libskycoin
- LIB_DIR: lib
- CGO_ENABLED: 1

install:
# Install gox
- go get github.com/gz-c/gox
- go get -t ./...
- make install-linters
# Install pinned golangci-lint, overriding the latest version install by make install-linters
- VERSION=1.10.2 ./ci-scripts/install-golangci-lint.sh
- ./ci-scripts/install-travis-gcc.sh
# Install pinned golangci-lint, overriding the latest version install by make install-linters
- make install-deps-libc

script:
- make lint
# libskycoin tests
- CC=gcc-6 make test-libc
- make check

notifications:
email:
- false
# https://github.com/kvld/travisci-telegram TravisCI Telegram Bot integration
email: false
webhooks: https://fathomless-fjord-24024.herokuapp.com/notify
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,4 +457,4 @@ Make sure to upgrade to v0.25.0 so that your node will continue to connect once
[0.20.1]: https://github.com/skycoin/skycoin/compare/v0.20.0...v0.20.1
[0.20.0]: https://github.com/skycoin/skycoin/compare/v0.19.1...v0.20.0
[0.19.1]: https://github.com/skycoin/skycoin/compare/v0.19.0...v0.19.1
[0.19.0]: https://github.com/skycoin/skycoin/commit/dd924e1f2de8fab945e05b3245dbeabf267f2910
[0.19.0]: https://github.com/skycoin/skycoin/commit/dd924e1f2de8fab945e05b3245dbeabf267f2910
27 changes: 18 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DEFAULT_GOAL := help
.PHONY: test-libc test-lint build-libc check
.PHONY: install-linters format
.PHONY: install-linters format clean-libc

COIN ?= skycoin

Expand Down Expand Up @@ -37,10 +37,11 @@ LIBDOC_DIR = $(DOC_DIR)/libc
# Compilation flags for libskycoin
CC_VERSION = $(shell $(CC) -dumpversion)
STDC_FLAG = $(python -c "if tuple(map(int, '$(CC_VERSION)'.split('.'))) < (6,): print('-std=C99'")
LIBC_LIBS = -lcriterion
LIBC_LIBS = `pkg-config --cflags --libs check`
LIBC_FLAGS = -I$(LIBSRC_DIR) -I$(INCLUDE_DIR) -I$(BUILD_DIR)/usr/include -L $(BUILDLIB_DIR) -L$(BUILD_DIR)/usr/lib
# Platform specific checks
OSNAME = $(TRAVIS_OS_NAME)
CGO_ENABLED=1

ifeq ($(shell uname -s),Linux)
LDLIBS=$(LIBC_LIBS) -lpthread
Expand Down Expand Up @@ -108,7 +109,7 @@ test-libc: build-libc ## Run tests for libskycoin C client library
$(CC) -o $(BIN_DIR)/test_libskycoin_shared $(LIB_DIR)/cgo/tests/*.c $(LIB_DIR)/cgo/tests/testutils/*.c -lskycoin $(LDLIBS) $(LDFLAGS)
$(CC) -o $(BIN_DIR)/test_libskycoin_static $(LIB_DIR)/cgo/tests/*.c $(LIB_DIR)/cgo/tests/testutils/*.c $(BUILDLIB_DIR)/libskycoin.a $(LDLIBS) $(LDFLAGS)
$(LDPATHVAR)="$(LDPATH):$(BUILD_DIR)/usr/lib:$(BUILDLIB_DIR)" $(BIN_DIR)/test_libskycoin_shared
$(LDPATHVAR)="$(LDPATH):$(BUILD_DIR)/usr/lib" $(BIN_DIR)/test_libskycoin_static
$(LDPATHVAR)="$(LDPATH):$(BUILD_DIR)/usr/lib" $(BIN_DIR)/test_libskycoin_static

docs-libc:
doxygen ./.Doxyfile
Expand All @@ -131,15 +132,23 @@ install-linters: ## Install linters
# However, they suggest `curl ... | bash` which we should not do
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint

install-deps-libc: configure-build ## Install locally dependencies for testing libskycoin
git clone --recursive https://github.com/skycoin/Criterion $(BUILD_DIR)/usr/tmp/Criterion
mkdir $(BUILD_DIR)/usr/tmp/Criterion/build
cd $(BUILD_DIR)/usr/tmp/Criterion/build && cmake .. && cmake --build .
mv $(BUILD_DIR)/usr/tmp/Criterion/build/libcriterion.* $(BUILD_DIR)/usr/lib/
cp -R $(BUILD_DIR)/usr/tmp/Criterion/include/* $(BUILD_DIR)/usr/include/
install-deps-libc: install-deps-libc-$(OSNAME)

install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin
wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz
tar -xzf check-0.12.0.tar.gz
cd check-0.12.0 && ./configure --prefix=/usr --disable-static && make && sudo make install

install-deps-libc-osx: configure-build ## Install locally dependencies for testing libskycoin
brew install check

format: ## Formats the code. Must have goimports installed (use make install-linters).
goimports -w -local github.com/skycoin/skycoin ./lib

clean-libc: ## Clean files generate by library
rm -rfv $(BUILDLIB_DIR)/libskycoin.so
rm -rfv $(BUILDLIB_DIR)/libskycoin.a
rm -rfv qemu_test_libskycoin*

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

[](https://user-images.githubusercontent.com/26845312/32426705-d95cb988-c281-11e7-9463-a3fce8076a72.png)

# Skycoin C library

[![Build Status](https://travis-ci.org/skycoin/libskycoin.svg)](https://travis-ci.org/skycoin/libskycoin)

Skycoin C library (a.k.a `libskycoin`) exports the Skycoin API to DApps using the C programming language.
It is also the foundation to build client libraries for other programming languages.

## Links

* [skycoin.net](https://www.skycoin.net)
* [Skycoin Blog](https://www.skycoin.net/blog)
* [Skycoin Docs](https://www.skycoin.net/docs)
* [Skycoin Blockchain Explorer](https://explorer.skycoin.net)
* [Skycoin Development Telegram Channel](https://t.me/skycoindev)
* [Skycoin Github Wiki](https://github.com/skycoin/skycoin/wiki)

## Subprojects

The Skycoin C library is made of the following components

- `lib/cgo` : C wrappers for the Skycoin core API
- `lib/swig` : SWIG interfaces to generate wrappers around the Skycoin core API for other programming languages

Consult respective `README` files for further details.

5 changes: 3 additions & 2 deletions ci-scripts/install-travis-gcc.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

# Install gcc6 (6.4.0-2 on Mac OS) for Travis builds

if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get install -qq g++-6 && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90;
sudo apt-get install -qq gcc-6 g++-6
m4yk3ldev marked this conversation as resolved.
Show resolved Hide resolved
fi

if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
Expand All @@ -12,7 +13,7 @@ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew list --versions gcc
echo 'Creating gcc@64 formula'
cd "$(brew --repository)/Library/Taps/homebrew/homebrew-core"
git show 42d31bba7772fb01f9ba442d9ee98b33a6e7a055:Formula/gcc\@6.rb > Formula/gcc\@6.rb
git show 42d31bba7772fb01f9ba442d9ee98b33a6e7a055:Formula/gcc\@6.rb | grep -v 'fails_with' > Formula/gcc\@6.rb
echo 'Installing gcc@6 (6.4.0-2)'
brew install gcc\@6 || brew link --overwrite gcc\@6
fi
Expand Down
157 changes: 0 additions & 157 deletions ci-scripts/integration-test-auth.sh

This file was deleted.

Loading