Add some testing scripts

This commit is contained in:
Isaac Shoebottom 2023-09-16 01:32:53 -03:00
parent c997a29967
commit 07116018ec
11 changed files with 70 additions and 3 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
# CLion Shit # CLion Shit
cmake-build-* build

View File

@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build on Lab" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="" />
<option name="INDEPENDENT_SCRIPT_PATH" value="false" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/tests/build.ps1" />
<option name="SCRIPT_OPTIONS" value="Assignment1" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="true" />
<envs />
<method v="2" />
</configuration>
</component>

View File

@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run on Lab" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="" />
<option name="INDEPENDENT_SCRIPT_PATH" value="false" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/tests/run.ps1" />
<option name="SCRIPT_OPTIONS" value="Assignment1" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="true" />
<envs />
<method v="2" />
</configuration>
</component>

View File

@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test on Lab" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="" />
<option name="INDEPENDENT_SCRIPT_PATH" value="false" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/tests/test.ps1" />
<option name="SCRIPT_OPTIONS" value="Assignment1" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="true" />
<envs />
<method v="2" />
</configuration>
</component>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.22) cmake_minimum_required(VERSION 3.20)
project(Assignment1 C) project(Assignment1 C)
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)

View File

@ -0,0 +1,3 @@
ssh ishoebot@remotelabm35.cs.unb.ca "cd ~/build/; rm -rf $($args[0]); mkdir $($args[0])"
scp -r $(Get-Location) ishoebot@remotelabm35.cs.unb.ca:~/build/
ssh ishoebot@remotelabm35.cs.unb.ca "cd ~/build/$($args[0])/; rm -rf build/; chmod +x ./tests/build.sh; ./tests/build.sh $($args[0])"

View File

@ -0,0 +1,5 @@
cd ~/build/"$1"/ || exit
mkdir build
cd build || exit
cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" ../
make

View File

@ -0,0 +1 @@
ssh -t ishoebot@remotelabm35.cs.unb.ca "~/build/$($args[0])/build/$($args[0])"

View File

@ -0,0 +1 @@
ssh ishoebot@remotelabm35.cs.unb.ca "cd ~/build/$($args[0])/tests/; chmod +x test.sh; ./test.sh $($args[0])"

View File

@ -19,7 +19,7 @@ function test() {
# Check if the files exist and if not, create them # Check if the files exist and if not, create them
files "$1" files "$1"
../cmake-build-debug-wsl/Assignment1 < "$1.txt" > "$1_Result.txt" "$(pwd)"/../build/Assignment1 < "$1.txt" > "$1_Result.txt"
if diff -u "$1_Result.txt" "$1_Expected.txt"; if diff -u "$1_Result.txt" "$1_Expected.txt";
then then
echo "$1 test passed" echo "$1 test passed"