Skip to content

Commit

Permalink
Merge 16ce841 into 8a2567e
Browse files Browse the repository at this point in the history
  • Loading branch information
hlolli committed Oct 22, 2019
2 parents 8a2567e + 16ce841 commit 2778eab
Show file tree
Hide file tree
Showing 2,276 changed files with 26,552 additions and 26,091 deletions.
18 changes: 8 additions & 10 deletions .travis.yml
@@ -1,14 +1,15 @@
language: cpp
sudo: required
matrix:
include:
- os: linux
dist: trusty
sudo: false
compiler: gcc
- os: linux
dist: xenial
dist: xenial
sudo: false
compiler: clang
compiler: clang
- os: osx
compiler: clang
env:
Expand All @@ -19,15 +20,10 @@ env:
before_script:
- mkdir -p build
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then (git clone git://github.com/erikd/libsndfile.git && cd libsndfile && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME .. && make && make install); fi
- sudo pip install --upgrade pip
script:
- "[ ${COVERITY_SCAN_BRANCH} == 1 ] || (cd $TRAVIS_BUILD_DIR/build && cmake .. -DCMAKE_INCLUDE_PATH=$HOME/include -DCMAKE_LIBRARY_PATH=$HOME/lib -DBUILD_STATIC_LIBRARY=ON -DBUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=$HOME && make && make test && make regression && make csdtests)"
# - echo -en "building tar package"
# - make install
# - cd $HOME
# - export PACKAGE_NAME=csound-$TRAVIS_OS_NAME-build
# - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cp -r $HOME/Library/Frameworks/ $HOME/lib; fi
# - tar czf $PACKAGE_NAME.tgz ./bin ./lib ./include
###
- cd tests/soak && sudo pip install -r requirements.txt && python3 test_prepare.py && python3 -m unittest -v test_checksum

addons:
coverity_scan:
Expand All @@ -50,6 +46,7 @@ addons:
- swig
- liblua5.1-0-dev
- python-dev
- python3-dev
- puredata-dev
- default-jdk
- libfltk1.1-dev
Expand All @@ -67,6 +64,7 @@ addons:
- libeigen3-dev
- libcunit1-dev
- python-tk
- libssl1.0.0

notifications:
email:
Expand All @@ -78,7 +76,7 @@ notifications:
# skip_cleanup: true
# provider: releases
# api_key:
# secure:
# secure:
# file: $HOME/csound-$TRAVIS_OS_NAME-build.tgz
# on:
# repo: csound/csound
Expand Down
28 changes: 0 additions & 28 deletions tests/regression/bugname.csd

This file was deleted.

35 changes: 35 additions & 0 deletions tests/regression/testTable.tab
@@ -0,0 +1,35 @@
======= TABLE 101 size: 8 values ======
flen: 8
lenmask: 7
lobits: 27
lomask: 134217727
lodiv: 0.000000
cvtbas: 0.000000
cpscvt: 0.000000
loopmode1: 0
loopmode2: 0
begin1: 0
end1: 0
begin2: 0
end2: 0
soundend: 0
flenfrms: 8
nchnls: 1
fno: 101
gen01args.gen01: 0.000000
gen01args.ifilno: 0.000000
gen01args.iskptim: 0.000000
gen01args.iformat: 0.000000
gen01args.channel: 0.000000
gen01args.sample_rate: 44100.000000
---------END OF HEADER--------------
0.000000
0.707107
1.000000
0.707107
0.000000
-0.707107
-1.000000
-0.707107
0.000000
---------END OF TABLE---------------
9 changes: 9 additions & 0 deletions tests/soak/.gitignore
@@ -0,0 +1,9 @@
tmp
generate.js
__pycache__
*.pyc
*.ftsave
!include/*
include/*.pvx
opcodes/pvsfwrite/mypvs.pvx
opcodes/monitor/fout_aif.aiff
43 changes: 43 additions & 0 deletions tests/soak/MIDI2cs.sco
@@ -0,0 +1,43 @@
i1 0.000023 0.000023 192 1 0 0
i1 0.000023 0.000023 192 4 0 0
i1 0.000045 0.000023 176 1 7 100
i1 0.000045 0.000023 176 4 7 100
i1 0.000068 0.000023 176 1 10 64
i1 0.000068 0.000023 176 4 10 64
i1 0.000091 0.000023 176 1 93 0
i1 0.000091 0.000023 176 4 93 0
i1 0.000113 0.000023 176 1 91 0
i1 0.000113 0.000023 176 4 91 0
i1 0.000136 0.000023 144 1 60 127
i1 0.000136 0.000023 192 2 0 0
i1 0.000159 0.000023 192 4 0 0
i1 0.000159 0.000023 176 2 7 100
i1 0.000181 0.000023 176 4 7 100
i1 0.000181 0.000023 176 2 10 64
i1 0.000204 0.000023 176 4 10 64
i1 0.000204 0.000023 176 2 93 0
i1 0.000227 0.000023 176 4 93 0
i1 0.000227 0.000023 176 2 91 0
i1 0.000249 0.000023 176 4 91 0
i1 0.000249 0.000023 192 3 0 0
i1 0.000272 0.000023 192 2 0 0
i1 0.000272 0.000023 176 3 7 100
i1 0.000295 0.000023 176 2 7 100
i1 0.000295 0.000023 176 3 10 64
i1 0.000317 0.000023 176 2 10 64
i1 0.000317 0.000023 176 3 93 0
i1 0.000340 0.000023 176 2 93 0
i1 0.000340 0.000023 176 3 91 0
i1 0.000363 0.000023 176 2 91 0
i1 0.000385 0.000023 192 3 0 0
i1 0.000408 0.000023 176 3 7 100
i1 0.000431 0.000023 176 3 10 64
i1 0.000454 0.000023 176 3 93 0
i1 0.000476 0.000023 176 3 91 0
i1 0.400023 0.000023 128 1 60 127
i1 2.000023 0.000023 144 4 62 127
i1 2.400023 0.000023 128 4 62 127
i1 3.000023 0.000023 144 2 55 127
i1 3.400023 0.000023 128 2 55 127
i1 5.000023 0.000023 144 3 72 127
i1 5.400023 0.000023 128 3 72 127
48 changes: 48 additions & 0 deletions tests/soak/README.md
@@ -0,0 +1,48 @@
# Soak tests

The soak tests are a series of reproduceable tests for a continuous integration coverting (hopefully) of all core opcodes and operators.


## opcodes

The opcodes directory is organized by opcode name (with the exception on operators and statements) and test. For a test to be included in the test-coverage, the directory name needs to match with the name of the opcode being tested.

The tests are based on the manual examples, but many have been modified for reproduceability and for brevity (test should preferable not exceed 5-10 seconds). A test in the opcodes directory must produce audio to make sense, since these tests are based on checksum match of the .wav output and an expected checksum.

To add or modify a test, make sure to include a foo.csd file and a matching foo.csd.json, where foo.csd.json is a json map containing 3 keys `"sha256"` for the expected checksum, `"os"` for the operating system the expected sha was generated from and `"git_commit"` for the git revision of the csound build used to produce the audio binary.

## dryruns [wip]

Dryruns is a collection of opcodes organized in the same way as the opcodes directory but containing opcodes and operators that are better tested in other ways than the audio they may or may nor manipulate. A good example of these are array and disk i/o operators.


## resources and include

The include directory contains all binary artifacts needed to run the test suite except for .pvx binaries. They need to be generated each time csound is changed. To do this, open the include directory in the terminal and run the following:

```
csound -U pvanal flute.aiff flute.pvx
csound -U pvanal mary.wav mary.pvx
csound -U pvanal beats.wav beats.pvx
```

And make sure to reference this directory when running a soak test which includes an include. For example:

```
SSDIR=../../include INCDIR=../../include SADIR=../../include csound loscil.csd -o loscil.wav
```


## helpful commands(dev)

- replace the sha256sum with bash and npm's json package quickly (install json with `npm i json -g`)

```bash
file=vbap8move && sha256sum $(echo $file.wav) | cut -d " " -f 1 | cat | { read sha256 ; json -I -f $file.csd.json -e "this.sha256="'"'$sha256'"';}
```

- quickly test the sha256sum and see if multiple invocations produce the same sha

```bash
file=0dbfs && SSDIR=../../include INCDIR=../../include SADIR=../../include csound $file.csd -o $file.wav --logfile=null -W -m0 && sha256sum $(echo $file.wav) | cut -d " " -f 1
```
42 changes: 0 additions & 42 deletions tests/soak/a.csd

This file was deleted.

31 changes: 0 additions & 31 deletions tests/soak/abs.csd

This file was deleted.

56 changes: 0 additions & 56 deletions tests/soak/active.csd

This file was deleted.

37 changes: 0 additions & 37 deletions tests/soak/active_scale.csd

This file was deleted.

0 comments on commit 2778eab

Please sign in to comment.