mirror of
https://github.com/kmc7468/cs220.git
synced 2025-12-12 21:08:45 +00:00
wip
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment01")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment02")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment03")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment04")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment06")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment07")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment08")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment09")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment10")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment11")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment12")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
"cargo_asan"
|
||||
"cargo_asan --release"
|
||||
"cargo_tsan"
|
||||
"cargo_tsan --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 1
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
|
||||
TESTS=("--lib assignment13")
|
||||
if [ $(run_tests) -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -76,17 +76,18 @@ _run_tests_with() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local FAILED=0
|
||||
for TEST in "${TESTS[@]}"; do
|
||||
local TEST_CMD="$CARGO test $* $TEST"
|
||||
timeout ${TIMEOUT:-20s} bash -c "$TEST_CMD 2>/dev/null" 1>&2
|
||||
local PASSED=0
|
||||
for TEST in ${TESTS[@]}; do
|
||||
local TEST_CMD="$CARGO test $* --lib -- --exact $TEST"
|
||||
timeout ${TIMEOUT:-20s} bash -c "$TEST_CMD &> /dev/null"
|
||||
case $? in
|
||||
0) ;;
|
||||
124) echo_err "Test timed out: $TEST_CMD"; FAILED=$((FAILED + 1));;
|
||||
*) echo_err "Test failed: $TEST_CMD"; FAILED=$((FAILED + 1));;
|
||||
0) PASSED="$((PASSED + 1))";;
|
||||
124) echo_err "Test timed out: $TEST_CMD";;
|
||||
*) echo_err "Test failed: $TEST_CMD";;
|
||||
esac
|
||||
done
|
||||
echo $FAILED
|
||||
|
||||
echo $PASSED
|
||||
}
|
||||
|
||||
# example: run_tests
|
||||
|
||||
35
scripts/grade.sh
Executable file
35
scripts/grade.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Imports library.
|
||||
BASEDIR=$(dirname "$0")
|
||||
source $BASEDIR/test_cases.sh
|
||||
source $BASEDIR/grade-utils.sh
|
||||
|
||||
RUNNERS=(
|
||||
"cargo"
|
||||
"cargo --release"
|
||||
)
|
||||
|
||||
# Lints.
|
||||
run_linters || exit 0
|
||||
|
||||
# Executes test for each runner.
|
||||
for RUNNER in "${RUNNERS[@]}"; do
|
||||
echo "Running with $RUNNER..."
|
||||
echo "Below lines will show only failed tests."
|
||||
|
||||
ASSIGNMENT=$(printf "assignment%02d" $1)
|
||||
TEST_NAME=$(printf "TEST%02d" $1)
|
||||
TESTS=$(get_test_cases $TEST_NAME)
|
||||
|
||||
# Runs tests.
|
||||
SCORE=$(run_tests)
|
||||
done
|
||||
|
||||
echo Your score: ${SCORE}
|
||||
|
||||
exit $SCORE
|
||||
193
scripts/test_cases.sh
Normal file
193
scripts/test_cases.sh
Normal file
@@ -0,0 +1,193 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
TEST01=(
|
||||
"assignments::assignment01::small_exercises_grade::test::test_add_7_3"
|
||||
"assignments::assignment01::small_exercises_grade::test::test_add_overflow"
|
||||
"assignments::assignment01::small_exercises_grade::test::test_sub_7_3"
|
||||
"assignments::assignment01::small_exercises_grade::test::test_sub_overflow"
|
||||
)
|
||||
|
||||
TEST02=(
|
||||
"assignments::assignment02::small_exercises_grade::test::test_capitalize"
|
||||
"assignments::assignment02::small_exercises_grade::test::test_chooses"
|
||||
"assignments::assignment02::small_exercises_grade::test::test_fahrenheit"
|
||||
"assignments::assignment02::small_exercises_grade::test::test_gcd"
|
||||
"assignments::assignment02::small_exercises_grade::test::test_sum_array"
|
||||
"assignments::assignment02::small_exercises_grade::test::test_up3"
|
||||
"assignments::assignment02::small_exercises_grade::test::test_zip"
|
||||
"assignments::assignment02::vec_and_mat_grade::test::test_fibonacci"
|
||||
"assignments::assignment02::vec_and_mat_grade::test::test_inverse"
|
||||
)
|
||||
|
||||
TEST03=(
|
||||
"assignments::assignment03::custom_operators_grade::test::test_my_and_then"
|
||||
"assignments::assignment03::custom_operators_grade::test::test_my_map"
|
||||
"assignments::assignment03::custom_operators_grade::test::test_my_option_op_or"
|
||||
"assignments::assignment03::parse_shell_grade::test::test_shell"
|
||||
"assignments::assignment03::small_exercises_grade::test::test_editor"
|
||||
"assignments::assignment03::small_exercises_grade::test::test_median"
|
||||
"assignments::assignment03::small_exercises_grade::test::test_mode"
|
||||
"assignments::assignment03::small_exercises_grade::test::test_next_weekday"
|
||||
"assignments::assignment03::small_exercises_grade::test::test_organize"
|
||||
"assignments::assignment03::small_exercises_grade::test::test_piglatin"
|
||||
)
|
||||
|
||||
TEST04=(
|
||||
"assignments::assignment04::grade::test::test_context_calc_command"
|
||||
"assignments::assignment04::grade::test::test_context_calc_expression"
|
||||
"assignments::assignment04::grade::test::test_parse"
|
||||
)
|
||||
|
||||
TEST06=(
|
||||
"assignments::assignment06::semiring_grade::test::test_123"
|
||||
"assignments::assignment06::semiring_grade::test::test_24x"
|
||||
"assignments::assignment06::semiring_grade::test::test_2x3_3x2_5x_12"
|
||||
"assignments::assignment06::semiring_grade::test::test_2x_3"
|
||||
"assignments::assignment06::semiring_grade::test::test_polynomial_f64"
|
||||
"assignments::assignment06::semiring_grade::test::test_polynomial_p_u64"
|
||||
"assignments::assignment06::semiring_grade::test::test_polynomial_u64"
|
||||
"assignments::assignment06::semiring_grade::test::test_polynomial_xy"
|
||||
"assignments::assignment06::semiring_grade::test::test_x"
|
||||
"assignments::assignment06::semiring_grade::test::test_x3"
|
||||
"assignments::assignment06::semiring_grade::test::test_x5_1"
|
||||
"assignments::assignment06::semiring_grade::test::test_zero_remove"
|
||||
"assignments::assignment06::symbolic_differentiation_grade::test::test_differentiate_complex"
|
||||
"assignments::assignment06::symbolic_differentiation_grade::test::test_differentiate_simple"
|
||||
"assignments::assignment06::symbolic_differentiation_grade::test::test_rational_arithmetic"
|
||||
"assignments::assignment06::symbolic_differentiation_grade::test::test_rational_arithmetic_long"
|
||||
)
|
||||
|
||||
TEST07=(
|
||||
"assignments::assignment07::generator_grade::test::test_generator"
|
||||
"assignments::assignment07::my_itertools_grade::test::test_itertools"
|
||||
"assignments::assignment07::small_exercises_grade::test::test_fib_iter"
|
||||
"assignments::assignment07::small_exercises_grade::test::test_find"
|
||||
"assignments::assignment07::small_exercises_grade::test::test_find_usize"
|
||||
"assignments::assignment07::small_exercises_grade::test::test_large"
|
||||
"assignments::assignment07::small_exercises_grade::test::test_range_iter"
|
||||
"assignments::assignment07::small_exercises_grade::test::test_small"
|
||||
"assignments::assignment07::transform_grade::test::test_transform_identity"
|
||||
"assignments::assignment07::transform_grade::test::test_transform_repeat"
|
||||
"assignments::assignment07::transform_grade::test::test_transform_repeat_until_converge"
|
||||
"assignments::assignment07::transform_grade::test::test_transform_tuple"
|
||||
)
|
||||
|
||||
TEST08=(
|
||||
"assignments::assignment08::church_grade::test::be_honest"
|
||||
"assignments::assignment08::church_grade::test::engineering_isnt_just_mathematics"
|
||||
"assignments::assignment08::church_grade::test::you_must_pass_these_examples"
|
||||
"assignments::assignment08::small_exercises_grade::test::test_count_repeat"
|
||||
"assignments::assignment08::small_exercises_grade::test::test_either2_map"
|
||||
"assignments::assignment08::small_exercises_grade::test::test_funny_map"
|
||||
"assignments::assignment08::small_exercises_grade::test::test_repeat"
|
||||
)
|
||||
|
||||
TEST09=(
|
||||
"assignments::assignment09::bigint_grade::test::test_inf_prec_complex"
|
||||
"assignments::assignment09::bigint_grade::test::test_inf_prec_simple"
|
||||
"assignments::assignment09::matmul_grade::test::dot_product_test"
|
||||
"assignments::assignment09::matmul_grade::test::matmul_test"
|
||||
"assignments::assignment09::matmul_grade::test::vec_add_test"
|
||||
"assignments::assignment09::small_exercises_grade::test::test_calculate_mean"
|
||||
"assignments::assignment09::small_exercises_grade::test::test_find_count_n"
|
||||
"assignments::assignment09::small_exercises_grade::test::test_interleave3"
|
||||
"assignments::assignment09::small_exercises_grade::test::test_interleave_n"
|
||||
"assignments::assignment09::small_exercises_grade::test::test_is_fibonacci"
|
||||
"assignments::assignment09::small_exercises_grade::test::test_is_palindrome"
|
||||
"assignments::assignment09::small_exercises_grade::test::test_k_smallest_man"
|
||||
"assignments::assignment09::small_exercises_grade::test::test_position_median"
|
||||
"assignments::assignment09::small_exercises_grade::test::test_sigma"
|
||||
"assignments::assignment09::small_exercises_grade::test::test_sum_is_n"
|
||||
"assignments::assignment09::small_exercises_grade::test::test_two_dimensional_sum"
|
||||
)
|
||||
|
||||
TEST10=(
|
||||
"assignments::assignment10::labyrinth_grade::test::can_every_husband_rescue_his_wife"
|
||||
"assignments::assignment10::small_exercises_grade::test::test_du_sort"
|
||||
"assignments::assignment10::small_exercises_grade::test::test_inversion"
|
||||
"assignments::assignment10::small_exercises_grade::test::test_natural_join"
|
||||
"assignments::assignment10::small_exercises_grade::test::test_pythagorean"
|
||||
"assignments::assignment10::small_exercises_grade::test::test_remove_duplicate"
|
||||
"assignments::assignment10::small_exercises_grade::test::test_remove_even"
|
||||
"assignments::assignment10::small_exercises_grade::test::test_traverse_preorder"
|
||||
)
|
||||
|
||||
TEST11=(
|
||||
"assignments::assignment11::graph_grade::test_graph::test_graph"
|
||||
"assignments::assignment11::linked_list_grade::test_linked_list::test_chunk_reverse"
|
||||
"assignments::assignment11::linked_list_grade::test_linked_list::test_flatten"
|
||||
"assignments::assignment11::linked_list_grade::test_linked_list::test_from_as_vec"
|
||||
"assignments::assignment11::linked_list_grade::test_linked_list::test_insert"
|
||||
"assignments::assignment11::linked_list_grade::test_linked_list::test_length"
|
||||
"assignments::assignment11::linked_list_grade::test_linked_list::test_map"
|
||||
"assignments::assignment11::linked_list_grade::test_linked_list::test_pair_map"
|
||||
"assignments::assignment11::linked_list_grade::test_linked_list::test_push_pop"
|
||||
"assignments::assignment11::mock_storage_grade::test_mock_storage::test_mock_storage"
|
||||
"assignments::assignment11::tv_room_grade::test_tv_room::test_tv_room"
|
||||
)
|
||||
|
||||
TEST12=(
|
||||
"assignments::assignment12::card_grade::test_card::play"
|
||||
"assignments::assignment12::demux_grade::test_demux::test_demux"
|
||||
"assignments::assignment12::funnel_grade::test_funnel::test_funnel_concurrent"
|
||||
"assignments::assignment12::small_exercises_grade::test_pingpong::test_ping_pong"
|
||||
"assignments::assignment12::small_exercises_grade::test_pingpong::test_scoped_thread"
|
||||
"assignments::assignment12::small_exercises_grade::test_pingpong::test_scoped_thread_concurrent"
|
||||
)
|
||||
|
||||
TEST13=(
|
||||
"assignments::assignment13::small_exercises_grade::test::dot_product_test"
|
||||
"assignments::assignment13::small_exercises_grade::test::matmul_test"
|
||||
"assignments::assignment13::small_exercises_grade::test::test_interleave3_par"
|
||||
"assignments::assignment13::small_exercises_grade::test::test_sigma_par"
|
||||
"assignments::assignment13::small_exercises_grade::test::vec_add_test"
|
||||
)
|
||||
|
||||
get_test_cases() {
|
||||
local TEST_NAME=$1
|
||||
local TEST_CASES=()
|
||||
case $TEST_NAME in
|
||||
TEST01)
|
||||
TEST_CASES=("${TEST01[@]}")
|
||||
;;
|
||||
TEST02)
|
||||
TEST_CASES=("${TEST02[@]}")
|
||||
;;
|
||||
TEST03)
|
||||
TEST_CASES=("${TEST03[@]}")
|
||||
;;
|
||||
TEST04)
|
||||
TEST_CASES=("${TEST04[@]}")
|
||||
;;
|
||||
TEST06)
|
||||
TEST_CASES=("${TEST06[@]}")
|
||||
;;
|
||||
TEST07)
|
||||
TEST_CASES=("${TEST07[@]}")
|
||||
;;
|
||||
TEST08)
|
||||
TEST_CASES=("${TEST08[@]}")
|
||||
;;
|
||||
TEST09)
|
||||
TEST_CASES=("${TEST09[@]}")
|
||||
;;
|
||||
TEST10)
|
||||
TEST_CASES=("${TEST10[@]}")
|
||||
;;
|
||||
TEST11)
|
||||
TEST_CASES=("${TEST11[@]}")
|
||||
;;
|
||||
TEST12)
|
||||
TEST_CASES=("${TEST12[@]}")
|
||||
;;
|
||||
TEST13)
|
||||
TEST_CASES=("${TEST13[@]}")
|
||||
;;
|
||||
*)
|
||||
echo_err "Invalid test name: $TEST_NAME"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
echo "${TEST_CASES[@]}"
|
||||
}
|
||||
export -f get_test_cases
|
||||
@@ -3,8 +3,8 @@
|
||||
//! The primary goal of this assignment is bringing up SSH, VSCode, and all the other necessary tools to develop Rust programs.
|
||||
//! Please make sure you're comfortable with developing Rust programs before moving on to the next assignments.
|
||||
//!
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-01.sh` works fine.
|
||||
//! See `assigment01/small_exercises_grade.rs` and `/scripts/grade-01.sh` for the test script.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade.sh 1` works fine.
|
||||
//! See `assigment01/small_exercises_grade.rs` and `/scripts/grade.sh 1` for the test script.
|
||||
|
||||
pub mod small_exercises;
|
||||
mod small_exercises_grade;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Assignment 1: Preparing Rust Development Environment.
|
||||
//! Welcome to the CS220 course!
|
||||
//!
|
||||
//! You should fill out `add()` and `sub()` function bodies in such a way that `/scripts/grade-01.sh` works fine.
|
||||
//! See `small_problems_grade.rs` and `/scripts/grade-01.sh` for the test script.
|
||||
//! You should fill out `add()` and `sub()` function bodies in such a way that `/scripts/grade.sh 1` works fine.
|
||||
//! See `small_problems_grade.rs` and `/scripts/grade.sh 1` for the test script.
|
||||
//!
|
||||
//! Hint: <https://doc.rust-lang.org/std/primitive.usize.html>
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//! The primary goal of this assignment is to re-learn the common programming concepts in Rust, especially those in the Rust Book chapters 3 and 5.
|
||||
//! Please make sure you're comfortable with the concepts to proceed on to the next assignments.
|
||||
//!
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-02.sh` works fine.
|
||||
//! See `assigment02/*_grade.rs` and `/scripts/grade-02.sh` for the test script.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade.sh 2` works fine.
|
||||
//! See `assigment02/*_grade.rs` and `/scripts/grade.sh 2` for the test script.
|
||||
|
||||
pub mod small_exercises;
|
||||
mod small_exercises_grade;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Assignment 3: Mastering common programming concepts (2/2)
|
||||
//!
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-03.sh` works fine.
|
||||
//! See `assignment03/*_grade.rs` and `/scripts/grade-03.sh` for the test script.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade.sh 3` works fine.
|
||||
//! See `assignment03/*_grade.rs` and `/scripts/grade.sh 3` for the test script.
|
||||
|
||||
pub mod small_exercises;
|
||||
mod small_exercises_grade;
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
//!
|
||||
//! For calculator, just reading `syntax.rs` would suffice for you to understand what to do.
|
||||
//!
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-04.sh` works fine.
|
||||
//! See `assignment04/grade.rs` and `/scripts/grade-04.sh` for the test script.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade.sh 4` works fine.
|
||||
//! See `assignment04/grade.rs` and `/scripts/grade.sh 4` for the test script.
|
||||
//! Run `/scripts/prepare-submissions.sh` and submit `/target/assignment04.zip` to <https://gg.kaist.ac.kr>.
|
||||
|
||||
pub mod context;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
//!
|
||||
//! The primary goal of this assignment is to understand generics, traits, and lifetimes.
|
||||
//!
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-06.sh` works fine.
|
||||
//! See `assignment06/*_grade.rs` and `/scripts/grade-06.sh` for the test script.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade.sh 6` works fine.
|
||||
//! See `assignment06/*_grade.rs` and `/scripts/grade.sh 6` for the test script.
|
||||
|
||||
pub mod semiring;
|
||||
pub mod symbolic_differentiation;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
//!
|
||||
//! The primary goal of this assignment is to understand generics, traits, and lifetimes.
|
||||
//!
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-07.sh` works fine.
|
||||
//! See `assignment07/*_grade.rs` and `/scripts/grade-07.sh` for the test script.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade.sh 7` works fine.
|
||||
//! See `assignment07/*_grade.rs` and `/scripts/grade.sh 7` for the test script.
|
||||
|
||||
pub mod generator;
|
||||
pub mod my_itertools;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
//!
|
||||
//! The primary goal of this assignment is to get used to first-class functions.
|
||||
//!
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-08.sh` works fine.
|
||||
//! See `assignment08/*_grade.rs` and `/scripts/grade-08.sh` for the test script.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade.sh 8` works fine.
|
||||
//! See `assignment08/*_grade.rs` and `/scripts/grade.sh 8` for the test script.
|
||||
|
||||
pub mod church;
|
||||
pub mod small_exercises;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
//!
|
||||
//! The primary goal of this assignment is to get used to iterators.
|
||||
//!
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-09.sh` works fine.
|
||||
//! See `assignment09/*_grade.rs` and `/scripts/grade-09.sh` for the test script.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade.sh 9` works fine.
|
||||
//! See `assignment09/*_grade.rs` and `/scripts/grade.sh 9` for the test script.
|
||||
|
||||
pub mod bigint;
|
||||
pub mod matmul;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Assignment 10: Iterators (2/2).
|
||||
//! The primary goal of this assignment is to get used to iterators.
|
||||
//!
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-10.sh` works fine.
|
||||
//! See `assignment10/*_grade.rs` and `/scripts/grade-10.sh` for the test script.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade.sh 10` works fine.
|
||||
//! See `assignment10/*_grade.rs` and `/scripts/grade.sh 10` for the test script.
|
||||
|
||||
pub mod labyrinth;
|
||||
pub mod small_exercises;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Assignment 11: Familiarizing with smart pointers.
|
||||
//!
|
||||
//! You should fill out `todo!()` placeholders in such a way that `/scripts/grade-11.sh` works fine.
|
||||
//! See `assignment11/*_grade.rs` and `/scripts/grade-11.sh` for the test script.
|
||||
//! You should fill out `todo!()` placeholders in such a way that `/scripts/grade.sh 11` works fine.
|
||||
//! See `assignment11/*_grade.rs` and `/scripts/grade.sh 11` for the test script.
|
||||
//! Run `/scripts/prepare-submissions.sh` and submit `/target/assignment11.zip` to <https://gg.kaist.ac.kr>.
|
||||
|
||||
pub mod graph;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
//!
|
||||
//! The primary goal of this assignment is to get used to concurrency.
|
||||
//!
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-12.sh` works fine.
|
||||
//! See `assignment12/*_grade.rs` and `/scripts/grade-12.sh` for the test script.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade.sh 12` works fine.
|
||||
//! See `assignment12/*_grade.rs` and `/scripts/grade.sh 12` for the test script.
|
||||
|
||||
pub mod card;
|
||||
pub mod demux;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//! The primary goal of this assignment is to get used to data parallelism.
|
||||
//!
|
||||
//! Refer to your solution for assignment 09. You will implement the parallelized version of assignment 09.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade-13.sh` works fine.
|
||||
//! See `assignment13/small_exercises_grade.rs` and `/scripts/grade-13.sh` for the test script.
|
||||
//! You should fill out the `todo!()` placeholders in such a way that `/scripts/grade.sh 13` works fine.
|
||||
//! See `assignment13/small_exercises_grade.rs` and `/scripts/grade.sh 13` for the test script.
|
||||
|
||||
pub mod small_exercises;
|
||||
mod small_exercises_grade;
|
||||
|
||||
Reference in New Issue
Block a user