File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919# For additional information about the PCG random number generation scheme,
2020# visit http://www.pcg-random.org/.
2121#
22- # Determine where the executables are (standard Makefile behavior)
22+ # Determine where the executables are
23+ # Priority: Current Dir (Makefile) -> ../build/test-high (CMake)
2324BASEDIR=$( dirname " $0 " )
2425cd " $BASEDIR "
2526
2627BINDIR=" ."
2728
29+ # Check if executables are in current directory (Makefile build)
30+ if [ ! -f " ./check-pcg32" ] && [ ! -f " ./check-pcg32.exe" ]; then
31+ # Try CMake build directories
32+ if [ -f " ../build/test-high/check-pcg32" ]; then
33+ BINDIR=" ../build/test-high"
34+ elif [ -f " ../build/test-high/Release/check-pcg32.exe" ]; then
35+ BINDIR=" ../build/test-high/Release"
36+ elif [ -f " ../build/test-high/Debug/check-pcg32.exe" ]; then
37+ BINDIR=" ../build/test-high/Debug"
38+ else
39+ echo " ERROR: Cannot find test executables. Please build the project first." >&2
40+ exit 1
41+ fi
42+ fi
43+
2844# Function to run a test, handling potential .exe extension
2945run_test () {
3046 TEST_NAME=$1
31- if [ -f " . /$TEST_NAME .exe" ]; then
32- " . /$TEST_NAME .exe"
33- elif [ -f " . /$TEST_NAME " ]; then
34- " . /$TEST_NAME "
47+ if [ -f " $BINDIR /$TEST_NAME .exe" ]; then
48+ " $BINDIR /$TEST_NAME .exe"
49+ elif [ -f " $BINDIR /$TEST_NAME " ]; then
50+ " $BINDIR /$TEST_NAME "
3551 else
36- echo " ERROR: $TEST_NAME not found in $PWD " >&2
52+ echo " ERROR: $TEST_NAME not found in $BINDIR " >&2
3753 return 1
3854 fi
3955}
You can’t perform that action at this time.
0 commit comments