-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·34 lines (29 loc) · 1.17 KB
/
test.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
#!/bin/bash
set -e
if [ "$1" == "no-container" ]; then
mkdir -p test-run
cd test-run
wget --no-clobber https://hcink.org/x/ci-test-sets/imgc-test-set-20200619.zip
unzip -o imgc-test-set-20200619.zip
rm -rf test_files results
mkdir -p test_files/one test_files/two test_files/three test_files/four test_files/five test_files/six test_files/seven
../build/imgc-tests
if [ "$2" == "generate" ]; then
mkdir ../results
node ../assets/test.js -a generate -f ../results/test-solutions.json -r test_files
else
node ../assets/test.js -f ../assets/test-solutions.json -r test_files
fi
else
docker build --build-arg build_hash="$(date)" -t hcink/imgc-tests:latest -f .ci/Dockerfiles/Local .
# rm -rf .ci/docker-wd
if [ "$1" == "generate" ]; then
echo "Generating solutions..."
docker run --rm -i hcink/imgc-tests:latest sh -c './test.sh no-container generate > /dev/stderr && cat results/test-solutions.json' > assets/test-solutions.json
echo "Generation of solutions finished."
else
echo "Testing..."
docker run --rm -i hcink/imgc-tests:latest sh -c './test.sh no-container > /dev/stderr && cat test-run/results/result.xml' > test-result.xml
echo "Testing finished."
fi
fi