Add some testing scripts
This commit is contained in:
parent
c997a29967
commit
07116018ec
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
# CLion Shit
|
# CLion Shit
|
||||||
cmake-build-*
|
build
|
||||||
|
17
Assignment1/.idea/runConfigurations/Build_on_Lab.xml
Normal file
17
Assignment1/.idea/runConfigurations/Build_on_Lab.xml
Normal 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>
|
17
Assignment1/.idea/runConfigurations/Run_on_Lab.xml
Normal file
17
Assignment1/.idea/runConfigurations/Run_on_Lab.xml
Normal 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>
|
17
Assignment1/.idea/runConfigurations/Test_on_Lab.xml
Normal file
17
Assignment1/.idea/runConfigurations/Test_on_Lab.xml
Normal 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>
|
6
Assignment1/.idea/vcs.xml
Normal file
6
Assignment1/.idea/vcs.xml
Normal 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>
|
@ -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)
|
||||||
|
3
Assignment1/tests/build.ps1
Normal file
3
Assignment1/tests/build.ps1
Normal 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])"
|
5
Assignment1/tests/build.sh
Normal file
5
Assignment1/tests/build.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
cd ~/build/"$1"/ || exit
|
||||||
|
mkdir build
|
||||||
|
cd build || exit
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" ../
|
||||||
|
make
|
1
Assignment1/tests/run.ps1
Normal file
1
Assignment1/tests/run.ps1
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh -t ishoebot@remotelabm35.cs.unb.ca "~/build/$($args[0])/build/$($args[0])"
|
1
Assignment1/tests/test.ps1
Normal file
1
Assignment1/tests/test.ps1
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh ishoebot@remotelabm35.cs.unb.ca "cd ~/build/$($args[0])/tests/; chmod +x test.sh; ./test.sh $($args[0])"
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user