mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 01:12:56 +00:00
Add tests for the Lsn::fetch_max function.
This commit is contained in:
33
pgbuild.sh
33
pgbuild.sh
@@ -1,33 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Purpose of this script is to build and install postgres in a local directory
|
|
||||||
# so that zenith intergation tests would find pg binaries and support files.
|
|
||||||
#
|
|
||||||
# ./pgbuild.sh would do following:
|
|
||||||
#
|
|
||||||
# 1) run out-of-source build of postgres in REPO_ROOT/tmp_install/build directory (I'm reusing
|
|
||||||
# tmp_install path here since it is already present in .gitignore)
|
|
||||||
#
|
|
||||||
# 2) installs postgres to REPO_ROOT/tmp_install/
|
|
||||||
#
|
|
||||||
|
|
||||||
# Halt immediately if any command fails
|
|
||||||
set -e
|
|
||||||
|
|
||||||
REPO_ROOT=$(dirname "$0")
|
|
||||||
REPO_ROOT="`( cd \"$REPO_ROOT\" && pwd )`"
|
|
||||||
|
|
||||||
# configure
|
|
||||||
echo "Configuring postgres build"
|
|
||||||
mkdir -p $REPO_ROOT/tmp_install/build
|
|
||||||
cd $REPO_ROOT/tmp_install/build
|
|
||||||
../../vendor/postgres/configure CFLAGS='-O0' --enable-debug --enable-cassert \
|
|
||||||
--enable-depend --with-libxml --prefix=/ > configure.log
|
|
||||||
|
|
||||||
# compile
|
|
||||||
echo "Compiling postgres"
|
|
||||||
make -j8 -s
|
|
||||||
export DESTDIR=$REPO_ROOT/tmp_install
|
|
||||||
|
|
||||||
echo "Installing postgres to $DESTDIR"
|
|
||||||
make install -s
|
|
||||||
@@ -244,5 +244,8 @@ mod tests {
|
|||||||
assert_eq!(lsn.load(), Lsn(1234));
|
assert_eq!(lsn.load(), Lsn(1234));
|
||||||
lsn.store(Lsn(5678));
|
lsn.store(Lsn(5678));
|
||||||
assert_eq!(lsn.load(), Lsn(5678));
|
assert_eq!(lsn.load(), Lsn(5678));
|
||||||
|
|
||||||
|
assert_eq!(lsn.fetch_max(Lsn(6000)), Lsn(5678));
|
||||||
|
assert_eq!(lsn.fetch_max(Lsn(5000)), Lsn(6000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user