/
testbranch.sh
executable file
·39 lines (28 loc) · 1.23 KB
/
testbranch.sh
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
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
## This script makes a copy of the Symata source and runs the test suite.
## This script must be run from the ./dev directory.
## To use this script, you must have "./" first in LOAD_PATH,
## so that Julia finds the copy of the Symata package first.
## Get the first 9 characters of the HEAD commit
cd ../ && COMMIT_HASH=$(git rev-parse --short=9 HEAD) && cd ./dev/
copycode=false
## Make a commit-unique test directory
TEST_PACKAGE_DIR=./testsrc/Symata-${COMMIT_HASH}
if [ ! -d $TEST_PACKAGE_DIR/ ]; then
mkdir $TEST_PACKAGE_DIR/
copycode=true
fi
if [ "$copycode" = true ]; then
## Clean the test directory if it exists and add a package directory, Symata
rm -rf $TEST_PACKAGE_DIR/*
mkdir $TEST_PACKAGE_DIR/Symata/
## Copy the source files to the test package directory
## Project.toml must be present (15 Jul 2018) for loading modules correctly.
cp -a ../src ../symata_test ../pysrc ../symsrc ../Project.toml $TEST_PACKAGE_DIR/Symata/
fi
cd $TEST_PACKAGE_DIR/
# Important to not use "-i" here.
julia -e '@time using Symata; @sym(Tests())' > >(tee -a stdout.log) 2> >(tee -a stderr.log >&2)
## This buffers all output till the end.
#julia -e '@time using Symata; @sym(Tests())' &> tests.log
# exit 1