35 lines
664 B
Bash
Executable File
35 lines
664 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
TEST_DIR="$SCRIPT_DIR/test"
|
|
|
|
rm -rf $TEST_DIR
|
|
mkdir $TEST_DIR
|
|
|
|
#"$SCRIPT_DIR/build.sh"
|
|
|
|
"$SCRIPT_DIR/output/dehydrate.amd64" src $TEST_DIR
|
|
|
|
cat <<EOF > test/main.cpp
|
|
#include "_src.hpp"
|
|
|
|
#include <string>
|
|
#include <filesystem>
|
|
|
|
int main() {
|
|
// get the current path to this executable
|
|
std::filesystem::path exepath= std::filesystem::canonical("/proc/self/exe");
|
|
recreate_src::recreate_tree(exepath.parent_path().string()+"/temp");
|
|
return 0;
|
|
}
|
|
EOF
|
|
|
|
g++ -std=c++17 -I $TEST_DIR -o $TEST_DIR/testexe $TEST_DIR/main.cpp $TEST_DIR/_src.cpp
|
|
|
|
$TEST_DIR/testexe
|
|
|
|
$TEST_DIR/testexe
|
|
|