Skip to content

Commit

Permalink
regenerate bash scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
reschandreas committed Jan 2, 2024
1 parent 05acda3 commit d6b19a5
Show file tree
Hide file tree
Showing 16 changed files with 231 additions and 239 deletions.
46 changes: 23 additions & 23 deletions src/main/resources/templates/aeolus/assembler/default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,41 @@ export AEOLUS_INITIAL_DIRECTORY=${PWD}
provide_environment_information () {
echo '⚙️ executing provide_environment_information'
#!/bin/bash
echo "--------------------Python versions--------------------"
python3 --version
pip3 --version
echo "--------------------Contents of tests repository--------------------"
ls -la tests
echo "---------------------------------------------"
echo "--------------------Contents of assignment repository--------------------"
ls -la assignment
echo "---------------------------------------------"
#Fallback in case Docker does not work as intended
REQ_FILE=tests/requirements.txt
if [ -f "$REQ_FILE" ]; then
pip3 install --user -r tests/requirements.txt
else
echo "$REQ_FILE does not exist"
fi
echo "--------------------Python versions--------------------"
python3 --version
pip3 --version
echo "--------------------Contents of tests repository--------------------"
ls -la tests
echo "---------------------------------------------"
echo "--------------------Contents of assignment repository--------------------"
ls -la assignment
echo "---------------------------------------------"
#Fallback in case Docker does not work as intended
REQ_FILE=tests/requirements.txt
if [ -f "$REQ_FILE" ]; then
pip3 install --user -r tests/requirements.txt
else
echo "$REQ_FILE does not exist"
fi

}

prepare_makefile () {
echo '⚙️ executing prepare_makefile'
#!/usr/bin/env bash
rm -f assignment/{GNUmakefile, Makefile, makefile}
rm -f assignment/io.inc
cp -f tests/Makefile assignment/Makefile || exit 2
cp -f tests/io.inc assignment/io.inc || exit 2
rm -f assignment/{GNUmakefile, Makefile, makefile}
rm -f assignment/io.inc
cp -f tests/Makefile assignment/Makefile || exit 2
cp -f tests/io.inc assignment/io.inc || exit 2

}

run_and_compile () {
echo '⚙️ executing run_and_compile'
cd tests
python3 compileTest.py ../assignment/
rm compileTest.py
cp result.xml ../assignment/result.xml
python3 compileTest.py ../assignment/
rm compileTest.py
cp result.xml ../assignment/result.xml

}

Expand Down
42 changes: 21 additions & 21 deletions src/main/resources/templates/aeolus/c/fact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,40 @@ export AEOLUS_INITIAL_DIRECTORY=${PWD}
setup_the_build_environment () {
echo '⚙️ executing setup_the_build_environment'
#!/usr/bin/env bash
# ------------------------------
# Task Description:
# Build and run all tests
# ------------------------------
# Updating assignment and test-reports ownership...
sudo chown artemis_user:artemis_user assignment/ -R || true
sudo rm -rf test-reports
sudo mkdir test-reports
sudo chown artemis_user:artemis_user test-reports/ -R || true
# ------------------------------
# Task Description:
# Build and run all tests
# ------------------------------
# Updating assignment and test-reports ownership...
sudo chown artemis_user:artemis_user assignment/ -R || true
sudo rm -rf test-reports
sudo mkdir test-reports
sudo chown artemis_user:artemis_user test-reports/ -R || true

}

build_and_run_all_tests () {
echo '⚙️ executing build_and_run_all_tests'
#!/usr/bin/env bash
# ------------------------------
# Task Description:
# Build and run all tests
# ------------------------------
# ------------------------------
# Task Description:
# Build and run all tests
# ------------------------------

rm -f assignment/GNUmakefile
rm -f assignment/Makefile
cp -f tests/Makefile assignment/Makefile || exit 2
cd tests
python3 Tests.py
rm Tests.py
rm -rf ./tests || true
rm -f assignment/GNUmakefile
rm -f assignment/Makefile
cp -f tests/Makefile assignment/Makefile || exit 2
cd tests
python3 Tests.py
rm Tests.py
rm -rf ./tests || true

}

cleanup () {
echo '⚙️ executing cleanup'
sudo rm -rf tests/ assignment/ test-reports/ || true
chmod -R 777 .
chmod -R 777 .
}

main () {
Expand Down
88 changes: 44 additions & 44 deletions src/main/resources/templates/aeolus/c/gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,74 @@ setup_the_build_environment () {
echo '⚙️ executing setup_the_build_environment'
#!/usr/bin/env bash

# ------------------------------
# Task Description:
# Build and run all tests
# ------------------------------

# Updating assignment and test-reports ownership...
sudo chown artemis_user:artemis_user assignment/ -R
sudo rm -rf test-reports
mkdir test-reports
chown artemis_user:artemis_user test-reports/ -R

# assignment
cd tests
REQ_FILE=requirements.txt
if [ -f "$REQ_FILE" ]; then
pip3 install --user -r requirements.txt || true
else
echo "$REQ_FILE does not exist"
fi
cd ..
# ------------------------------
# Task Description:
# Build and run all tests
# ------------------------------

# Updating assignment and test-reports ownership...
sudo chown artemis_user:artemis_user assignment/ -R
sudo rm -rf test-reports
mkdir test-reports
chown artemis_user:artemis_user test-reports/ -R

# assignment
cd tests
REQ_FILE=requirements.txt
if [ -f "$REQ_FILE" ]; then
pip3 install --user -r requirements.txt || true
else
echo "$REQ_FILE does not exist"
fi
cd ..

}

setup_makefile () {
echo '⚙️ executing setup_makefile'
#!/usr/bin/env bash

# ------------------------------
# Task Description:
# Setup makefile
# ------------------------------
# ------------------------------
# Task Description:
# Setup makefile
# ------------------------------

shadowFilePath="../tests/testUtils/c/shadow_exec.c"
shadowFilePath="../tests/testUtils/c/shadow_exec.c"

foundIncludeDirs=`grep -m 1 'INCLUDEDIRS\s*=' assignment/Makefile`
foundIncludeDirs=`grep -m 1 'INCLUDEDIRS\s*=' assignment/Makefile`

foundSource=`grep -m 1 'SOURCE\s*=' assignment/Makefile`
foundSource="$foundSource $shadowFilePath"
foundSource=`grep -m 1 'SOURCE\s*=' assignment/Makefile`
foundSource="$foundSource $shadowFilePath"

rm -f assignment/GNUmakefile
rm -f assignment/makefile
rm -f assignment/GNUmakefile
rm -f assignment/makefile

cp -f tests/Makefile assignment/Makefile || exit 2
sed -i "s~\bINCLUDEDIRS\s*=.*~${foundIncludeDirs}~; s~\bSOURCE\s*=.*~${foundSource}~" assignment/Makefile
cp -f tests/Makefile assignment/Makefile || exit 2
sed -i "s~\bINCLUDEDIRS\s*=.*~${foundIncludeDirs}~; s~\bSOURCE\s*=.*~${foundSource}~" assignment/Makefile
}

build_and_run_all_tests () {
echo '⚙️ executing build_and_run_all_tests'
#!/usr/bin/env bash

# ------------------------------
# Task Description:
# Build and run all tests if the compilation succeeds
# ------------------------------
sudo chown artemis_user:artemis_user .
gcc -c -Wall assignment/*.c || error=true
if [ ! $error ]
then
cd tests || exit 0
python3 Tests.py || true
fi
# ------------------------------
# Task Description:
# Build and run all tests if the compilation succeeds
# ------------------------------
sudo chown artemis_user:artemis_user .
gcc -c -Wall assignment/*.c || error=true
if [ ! $error ]
then
cd tests || exit 0
python3 Tests.py || true
fi

}

cleanup () {
echo '⚙️ executing cleanup'
sudo rm -rf tests/ assignment/ test-reports/ || true
chmod -R 777 .
chmod -R 777 .
}

main () {
Expand Down
92 changes: 46 additions & 46 deletions src/main/resources/templates/aeolus/c/gcc_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,76 +5,76 @@ setup_the_build_environment () {
echo '⚙️ executing setup_the_build_environment'
#!/usr/bin/env bash

# ------------------------------
# Task Description:
# Build and run all tests
# ------------------------------

# Updating assignment and test-reports ownership...
sudo chown artemis_user:artemis_user assignment/ -R
sudo rm -rf test-reports
mkdir test-reports
chown artemis_user:artemis_user test-reports/ -R

# assignment
cd tests
REQ_FILE=requirements.txt
if [ -f "$REQ_FILE" ]; then
pip3 install --user -r requirements.txt || true
else
echo "$REQ_FILE does not exist"
fi
cd ..
# ------------------------------
# Task Description:
# Build and run all tests
# ------------------------------

# Updating assignment and test-reports ownership...
sudo chown artemis_user:artemis_user assignment/ -R
sudo rm -rf test-reports
mkdir test-reports
chown artemis_user:artemis_user test-reports/ -R

# assignment
cd tests
REQ_FILE=requirements.txt
if [ -f "$REQ_FILE" ]; then
pip3 install --user -r requirements.txt || true
else
echo "$REQ_FILE does not exist"
fi
cd ..

}

setup_makefile () {
echo '⚙️ executing setup_makefile'
#!/usr/bin/env bash

# ------------------------------
# Task Description:
# Setup makefile
# ------------------------------
# ------------------------------
# Task Description:
# Setup makefile
# ------------------------------

shadowFilePath="../tests/testUtils/c/shadow_exec.c"
shadowFilePath="../tests/testUtils/c/shadow_exec.c"

foundIncludeDirs=`grep -m 1 'INCLUDEDIRS\s*=' assignment/Makefile`
foundIncludeDirs=`grep -m 1 'INCLUDEDIRS\s*=' assignment/Makefile`

foundSource=`grep -m 1 'SOURCE\s*=' assignment/Makefile`
foundSource="$foundSource $shadowFilePath"
foundSource=`grep -m 1 'SOURCE\s*=' assignment/Makefile`
foundSource="$foundSource $shadowFilePath"

rm -f assignment/GNUmakefile
rm -f assignment/makefile
rm -f assignment/GNUmakefile
rm -f assignment/makefile

cp -f tests/Makefile assignment/Makefile || exit 2
sed -i "s~\bINCLUDEDIRS\s*=.*~${foundIncludeDirs}~; s~\bSOURCE\s*=.*~${foundSource}~" assignment/Makefile
cp -f tests/Makefile assignment/Makefile || exit 2
sed -i "s~\bINCLUDEDIRS\s*=.*~${foundIncludeDirs}~; s~\bSOURCE\s*=.*~${foundSource}~" assignment/Makefile
}

build_and_run_all_tests () {
echo '⚙️ executing build_and_run_all_tests'
#!/usr/bin/env bash

# ------------------------------
# Task Description:
# Build and run all tests if the compilation succeeds
# ------------------------------
sudo chown artemis_user:artemis_user .
gcc -c -Wall assignment/*.c || error=true
if [ ! $error ]
then
cd tests || exit 0
python3 Tests.py || true
else
exit 1
fi
# ------------------------------
# Task Description:
# Build and run all tests if the compilation succeeds
# ------------------------------
sudo chown artemis_user:artemis_user .
gcc -c -Wall assignment/*.c || error=true
if [ ! $error ]
then
cd tests || exit 0
python3 Tests.py || true
else
exit 1
fi

}

cleanup () {
echo '⚙️ executing cleanup'
sudo rm -rf tests/ assignment/ test-reports/ || true
chmod -R 777 .
chmod -R 777 .
}

main () {
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/templates/aeolus/haskell/default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export AEOLUS_INITIAL_DIRECTORY=${PWD}
build_and_test_the_code () {
echo '⚙️ executing build_and_test_the_code'
# the build process is specified in `run.sh` in the test repository
# -s enables the safe testing mode
chmod +x run.sh
./run.sh -s
# -s enables the safe testing mode
chmod +x run.sh
./run.sh -s

}

Expand Down
Loading

0 comments on commit d6b19a5

Please sign in to comment.